Merge branch 'master' into android-new-control-input-overlay

Conflicts:
	Source/Core/DolphinWX/Src/Android/ButtonManager.h
This commit is contained in:
Ryan Houdek
2013-11-13 16:17:42 -06:00
1107 changed files with 133363 additions and 62767 deletions

View File

@ -47,7 +47,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;
@ -121,7 +121,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 button, int action)
{
@ -168,7 +168,7 @@ namespace ButtonManager
{
// XXX: Make platform specific drawing
}
// InputDevice
void InputDevice::PressEvent(int button, int action)
{
@ -195,8 +195,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;
}
}

View File

@ -76,11 +76,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
{
@ -99,7 +99,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);

View File

@ -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.*/