Wiimote: Added optional status icons for the Wiimote speaker and leds. And a few other small changes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1455 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-12-09 05:37:15 +00:00
parent 668337eb84
commit fee145244c
22 changed files with 739 additions and 88 deletions

View File

@ -297,7 +297,11 @@ std::string GetUserDirectory()
#ifdef _WIN32
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
{
return std::string(path);
//return std::string(path);
/* I dont understand this, I got "E:\Documents and Settings\All Users\Application Data"
from this */
return std::string("");
}
return std::string("");
#else

View File

@ -123,6 +123,25 @@ std::string StringFromFormat(const char* format, ...)
}
// ===================================================
/* For Debugging. Read out an u8 array. */
// ----------------
std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len)
{
//const u8* _data = (const u8*)data;
std::string Temp;
for (u32 i = 0; i < size; i++)
{
char Buffer[128];
sprintf(Buffer, "%02x ", data[i + offset]);
if((i + 1) % line_len == 0) Temp.append("\n"); // break long lines
Temp.append(Buffer);
}
return Temp;
}
// ================
void ToStringFromFormat(std::string* out, const char* format, ...)
{
va_list args;

View File

@ -32,10 +32,12 @@ void ToStringFromFormat(std::string* out, const char* format, ...);
// Expensive!
void StringFromFormatV(std::string* out, const char* format, va_list args);
// Cheap!
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args);
// Good
std::string ArrayToString(const u8 *data, u32 size, u32 offset = 0, int line_len = 20);
template<size_t Count>
inline void CharArrayFromFormat(char (& out)[Count], const char* format, ...)
@ -74,4 +76,3 @@ void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _P
#endif