mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 10:09:36 -06:00
Run code through the advanced tool 'sed' to remove trailing whitespace.
This commit is contained in:
@ -55,7 +55,7 @@ namespace ButtonManager
|
||||
"InputL",
|
||||
"InputR" };
|
||||
const int configStringNum = 20;
|
||||
|
||||
|
||||
void AddBind(std::string dev, sBind *bind)
|
||||
{
|
||||
auto it = m_controllers.find(dev);
|
||||
@ -93,9 +93,9 @@ namespace ButtonManager
|
||||
{
|
||||
hasbind = true;
|
||||
type = BIND_AXIS;
|
||||
sscanf(value.c_str(), "Device '%[^\']'-Axis %d%c", dev, &bindnum, &modifier);
|
||||
sscanf(value.c_str(), "Device '%[^\']'-Axis %d%c", dev, &bindnum, &modifier);
|
||||
}
|
||||
else if (std::string::npos != value.find("Button"))
|
||||
else if (std::string::npos != value.find("Button"))
|
||||
{
|
||||
hasbind = true;
|
||||
type = BIND_BUTTON;
|
||||
@ -123,7 +123,7 @@ namespace ButtonManager
|
||||
auto it = m_controllers.begin();
|
||||
if (it == m_controllers.end())
|
||||
return 0.0f;
|
||||
return it->second->AxisValue(axis);
|
||||
return it->second->AxisValue(axis);
|
||||
}
|
||||
void TouchEvent(int action, float x, float y)
|
||||
{
|
||||
@ -185,7 +185,7 @@ namespace ButtonManager
|
||||
{
|
||||
// XXX: Make platform specific drawing
|
||||
}
|
||||
|
||||
|
||||
// InputDevice
|
||||
void InputDevice::PressEvent(int button, int action)
|
||||
{
|
||||
@ -212,8 +212,8 @@ namespace ButtonManager
|
||||
return 0.0f;
|
||||
if (it->second->m_bindtype == BIND_BUTTON)
|
||||
return ButtonValue(axis);
|
||||
else
|
||||
else
|
||||
return m_axises[it->second->m_bind] * it->second->m_neg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace ButtonManager
|
||||
char *image;
|
||||
// image = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str(), width, height);
|
||||
// XXX: Make platform specific drawing
|
||||
|
||||
|
||||
m_button = button;
|
||||
memcpy(m_coords, coords, sizeof(float) * 8);
|
||||
m_state = BUTTON_RELEASED;
|
||||
@ -87,7 +87,7 @@ namespace ButtonManager
|
||||
ButtonType GetButtonType() { return m_button; }
|
||||
GLuint GetTexture() { return m_tex; }
|
||||
float *GetCoords() { return m_coords; }
|
||||
|
||||
|
||||
~Button() { }
|
||||
};
|
||||
|
||||
@ -97,11 +97,11 @@ namespace ButtonManager
|
||||
const BindType m_bindtype;
|
||||
const int m_bind;
|
||||
const float m_neg;
|
||||
sBind(ButtonType buttontype, BindType bindtype, int bind, float neg)
|
||||
: m_buttontype(buttontype), m_bindtype(bindtype), m_bind(bind), m_neg(neg)
|
||||
sBind(ButtonType buttontype, BindType bindtype, int bind, float neg)
|
||||
: m_buttontype(buttontype), m_bindtype(bindtype), m_bind(bind), m_neg(neg)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
@ -120,7 +120,7 @@ namespace ButtonManager
|
||||
for (auto it = m_binds.begin(); it != m_binds.end(); ++it)
|
||||
delete it->second;
|
||||
}
|
||||
void AddBind(sBind *bind) { m_binds[bind->m_buttontype] = bind; }
|
||||
void AddBind(sBind *bind) { m_binds[bind->m_buttontype] = bind; }
|
||||
void PressEvent(int button, int action);
|
||||
void AxisEvent(int axis, float value);
|
||||
bool ButtonValue(ButtonType button);
|
||||
|
@ -40,7 +40,7 @@ char* LoadPNG(const char *filename, u32 &width, u32 &height)
|
||||
|
||||
/* Open the file. */
|
||||
infile = fopen(filename, "rb");
|
||||
if (!infile)
|
||||
if (!infile)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
@ -55,8 +55,8 @@ char* LoadPNG(const char *filename, u32 &width, u32 &height)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the PNG structs
|
||||
/*
|
||||
* Set up the PNG structs
|
||||
*/
|
||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
if (!png_ptr) {
|
||||
@ -73,7 +73,7 @@ char* LoadPNG(const char *filename, u32 &width, u32 &height)
|
||||
|
||||
|
||||
/*
|
||||
* block to handle libpng errors,
|
||||
* block to handle libpng errors,
|
||||
* then check whether the PNG file had a bKGD chunk
|
||||
*/
|
||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||
@ -82,16 +82,16 @@ char* LoadPNG(const char *filename, u32 &width, u32 &height)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* takes our file stream pointer (infile) and
|
||||
/*
|
||||
* takes our file stream pointer (infile) and
|
||||
* stores it in the png_ptr struct for later use.
|
||||
*/
|
||||
/* png_ptr->io_ptr = (png_voidp)infile;*/
|
||||
png_init_io(png_ptr, infile);
|
||||
|
||||
/*
|
||||
* lets libpng know that we already checked the 8
|
||||
* signature bytes, so it should not expect to find
|
||||
* lets libpng know that we already checked the 8
|
||||
* signature bytes, so it should not expect to find
|
||||
* them at the current file pointer location
|
||||
*/
|
||||
png_set_sig_bytes(png_ptr, 8);
|
||||
@ -99,25 +99,25 @@ char* LoadPNG(const char *filename, u32 &width, u32 &height)
|
||||
/* Read the image */
|
||||
|
||||
/*
|
||||
* reads and processes not only the PNG file's IHDR chunk
|
||||
* but also any other chunks up to the first IDAT
|
||||
* reads and processes not only the PNG file's IHDR chunk
|
||||
* but also any other chunks up to the first IDAT
|
||||
* (i.e., everything before the image data).
|
||||
*/
|
||||
|
||||
/* read all the info up to the image data */
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &_width, &_height, &bit_depth,
|
||||
png_get_IHDR(png_ptr, info_ptr, &_width, &_height, &bit_depth,
|
||||
&color_type, NULL, NULL, NULL);
|
||||
|
||||
/* Set up some transforms. */
|
||||
if (bit_depth > 8)
|
||||
if (bit_depth > 8)
|
||||
png_set_strip_16(png_ptr);
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
if (color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
png_set_palette_to_rgb(png_ptr);
|
||||
|
||||
/* Update the png info struct.*/
|
||||
|
Reference in New Issue
Block a user