mirror of
https://github.com/glest/glest-source.git
synced 2025-08-27 09:54:26 +02:00
- more cppcheck cleanup, AND some new inernal steam commandline parameters to reset stats and enable debugging
This commit is contained in:
@@ -97,7 +97,7 @@ const char * getDialogCommand() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool showMessage(std::string warning,string writepath) {
|
||||
bool showMessage(std::string warning,const string &writepath) {
|
||||
bool guiMessage = false;
|
||||
const char * dialogCommand = getDialogCommand();
|
||||
if (dialogCommand) {
|
||||
@@ -137,7 +137,7 @@ bool showMessage(std::string warning,string writepath) {
|
||||
return guiMessage;
|
||||
}
|
||||
|
||||
void message(string message, bool isNonGraphicalModeEnabled,string writepath) {
|
||||
void message(const string &message, bool isNonGraphicalModeEnabled,const string &writepath) {
|
||||
std::cerr << "\n\n\n";
|
||||
std::cerr << "******************************************************\n";
|
||||
std::cerr << " " << message << "\n";
|
||||
|
@@ -936,7 +936,7 @@ bool MasterSlaveThreadController::waitTillSlavesTrigger(int waitMilliseconds) {
|
||||
|
||||
result = false;
|
||||
}
|
||||
else if(slaveResult == 0) {
|
||||
else {
|
||||
if(debugMasterSlaveThreadController) printf("In [%s::%s Line: %d] slaveTriggerCounter = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,slaveTriggerCounter);
|
||||
|
||||
result = true;
|
||||
|
@@ -1006,43 +1006,43 @@ bool isKeyPressed(SDL_Keycode compareKey, SDL_KeyboardEvent input,vector<int> mo
|
||||
return result;
|
||||
}
|
||||
|
||||
wchar_t extractKeyPressedUnicode(SDL_KeyboardEvent input) {
|
||||
wchar_t c = SDLK_UNKNOWN;
|
||||
//if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
|
||||
if(input.keysym.sym > 0) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] input.keysym.sym = %d input.keysym.mod = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,input.keysym.sym,input.keysym.mod);
|
||||
|
||||
c = input.keysym.sym;
|
||||
// if(c <= SDLK_UNKNOWN || c >= SDLK_LAST) {
|
||||
// c = SDLKey(c & 0xFF);
|
||||
// }
|
||||
|
||||
//c = toupper(c);
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] #1 (c & 0xFF) [%d] c = [%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,(c & 0xFF),c);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] #1 (c & 0xFF) [%d] c = [%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,(c & 0xFF),c);
|
||||
}
|
||||
if(c == SDLK_UNKNOWN) {
|
||||
c = input.keysym.sym;
|
||||
}
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %u] c = [%d][%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
|
||||
//c = (SDLKey)(c & 0xFF);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] returning key [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] returning key [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
|
||||
string pressKeyName = SDL_GetKeyName((SDL_Keycode)c);
|
||||
//string inputKeyName = SDL_GetKeyName(input.keysym.sym);
|
||||
|
||||
//printf ("PRESS pressed key [%d - %s] input.keysym.sym [%d] input.keysym.unicode [%d] mod = %d\n",
|
||||
// c,pressKeyName.c_str(),input.keysym.sym,input.keysym.unicode,input.keysym.mod);
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] pressed key [%d - %s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c,pressKeyName.c_str());
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] pressed key [%d - %s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c,pressKeyName.c_str());
|
||||
|
||||
return c;
|
||||
}
|
||||
//wchar_t extractKeyPressedUnicode(SDL_KeyboardEvent input) {
|
||||
// wchar_t c = SDLK_UNKNOWN;
|
||||
// //if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
|
||||
// if(input.keysym.sym > 0) {
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] input.keysym.sym = %d input.keysym.mod = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,input.keysym.sym,input.keysym.mod);
|
||||
//
|
||||
// c = input.keysym.sym;
|
||||
//// if(c <= SDLK_UNKNOWN || c >= SDLK_LAST) {
|
||||
//// c = SDLKey(c & 0xFF);
|
||||
//// }
|
||||
//
|
||||
// //c = toupper(c);
|
||||
//
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] #1 (c & 0xFF) [%d] c = [%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,(c & 0xFF),c);
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] #1 (c & 0xFF) [%d] c = [%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,(c & 0xFF),c);
|
||||
// }
|
||||
// if(c == SDLK_UNKNOWN) {
|
||||
// c = input.keysym.sym;
|
||||
// }
|
||||
//
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %u] c = [%d][%lc]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
//
|
||||
// //c = (SDLKey)(c & 0xFF);
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] returning key [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] returning key [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
||||
//
|
||||
// string pressKeyName = SDL_GetKeyName((SDL_Keycode)c);
|
||||
// //string inputKeyName = SDL_GetKeyName(input.keysym.sym);
|
||||
//
|
||||
// //printf ("PRESS pressed key [%d - %s] input.keysym.sym [%d] input.keysym.unicode [%d] mod = %d\n",
|
||||
// // c,pressKeyName.c_str(),input.keysym.sym,input.keysym.unicode,input.keysym.mod);
|
||||
//
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] pressed key [%d - %s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c,pressKeyName.c_str());
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] pressed key [%d - %s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c,pressKeyName.c_str());
|
||||
//
|
||||
// return c;
|
||||
//}
|
||||
|
||||
vector<int> extractKeyPressedUnicodeLength(string text) {
|
||||
vector<int> result;
|
||||
@@ -1110,67 +1110,67 @@ SDL_Keycode extractKeyPressed(SDL_KeyboardEvent input) {
|
||||
return c;
|
||||
}
|
||||
|
||||
bool isAllowedInputTextKey(wchar_t &key) {
|
||||
if(Window::isAllowedKey(key) == true) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool result = (
|
||||
key != SDLK_DELETE &&
|
||||
key != SDLK_BACKSPACE &&
|
||||
key != SDLK_TAB &&
|
||||
key != SDLK_CLEAR &&
|
||||
key != SDLK_RETURN &&
|
||||
key != SDLK_PAUSE &&
|
||||
key != SDLK_UP &&
|
||||
key != SDLK_DOWN &&
|
||||
key != SDLK_RIGHT &&
|
||||
key != SDLK_LEFT &&
|
||||
key != SDLK_INSERT &&
|
||||
key != SDLK_HOME &&
|
||||
key != SDLK_END &&
|
||||
key != SDLK_PAGEUP &&
|
||||
key != SDLK_PAGEDOWN &&
|
||||
key != SDLK_F1 &&
|
||||
key != SDLK_F2 &&
|
||||
key != SDLK_F3 &&
|
||||
key != SDLK_F4 &&
|
||||
key != SDLK_F5 &&
|
||||
key != SDLK_F6 &&
|
||||
key != SDLK_F7 &&
|
||||
key != SDLK_F8 &&
|
||||
key != SDLK_F9 &&
|
||||
key != SDLK_F10 &&
|
||||
key != SDLK_F11 &&
|
||||
key != SDLK_F12 &&
|
||||
key != SDLK_F13 &&
|
||||
key != SDLK_F14 &&
|
||||
key != SDLK_F15 &&
|
||||
key != SDLK_NUMLOCKCLEAR &&
|
||||
key != SDLK_CAPSLOCK &&
|
||||
key != SDLK_SCROLLLOCK &&
|
||||
key != SDLK_RSHIFT &&
|
||||
key != SDLK_LSHIFT &&
|
||||
key != SDLK_RCTRL &&
|
||||
key != SDLK_LCTRL &&
|
||||
key != SDLK_RALT &&
|
||||
key != SDLK_LALT &&
|
||||
key != SDLK_RGUI &&
|
||||
key != SDLK_LGUI &&
|
||||
key != SDLK_MODE &&
|
||||
key != SDLK_HELP &&
|
||||
key != SDLK_PRINTSCREEN &&
|
||||
key != SDLK_SYSREQ &&
|
||||
key != SDLK_PAUSE &&
|
||||
key != SDLK_MENU &&
|
||||
key != SDLK_POWER);
|
||||
|
||||
string inputKeyName = SDL_GetKeyName((SDL_Keycode)key);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] pressed key [%d - %s] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key,inputKeyName.c_str(),result);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] pressed key [%d - %s] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key,inputKeyName.c_str(),result);
|
||||
|
||||
return result;
|
||||
}
|
||||
//bool isAllowedInputTextKey(wchar_t &key) {
|
||||
// if(Window::isAllowedKey(key) == true) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// bool result = (
|
||||
// key != SDLK_DELETE &&
|
||||
// key != SDLK_BACKSPACE &&
|
||||
// key != SDLK_TAB &&
|
||||
// key != SDLK_CLEAR &&
|
||||
// key != SDLK_RETURN &&
|
||||
// key != SDLK_PAUSE &&
|
||||
// key != SDLK_UP &&
|
||||
// key != SDLK_DOWN &&
|
||||
// key != SDLK_RIGHT &&
|
||||
// key != SDLK_LEFT &&
|
||||
// key != SDLK_INSERT &&
|
||||
// key != SDLK_HOME &&
|
||||
// key != SDLK_END &&
|
||||
// key != SDLK_PAGEUP &&
|
||||
// key != SDLK_PAGEDOWN &&
|
||||
// key != SDLK_F1 &&
|
||||
// key != SDLK_F2 &&
|
||||
// key != SDLK_F3 &&
|
||||
// key != SDLK_F4 &&
|
||||
// key != SDLK_F5 &&
|
||||
// key != SDLK_F6 &&
|
||||
// key != SDLK_F7 &&
|
||||
// key != SDLK_F8 &&
|
||||
// key != SDLK_F9 &&
|
||||
// key != SDLK_F10 &&
|
||||
// key != SDLK_F11 &&
|
||||
// key != SDLK_F12 &&
|
||||
// key != SDLK_F13 &&
|
||||
// key != SDLK_F14 &&
|
||||
// key != SDLK_F15 &&
|
||||
// key != SDLK_NUMLOCKCLEAR &&
|
||||
// key != SDLK_CAPSLOCK &&
|
||||
// key != SDLK_SCROLLLOCK &&
|
||||
// key != SDLK_RSHIFT &&
|
||||
// key != SDLK_LSHIFT &&
|
||||
// key != SDLK_RCTRL &&
|
||||
// key != SDLK_LCTRL &&
|
||||
// key != SDLK_RALT &&
|
||||
// key != SDLK_LALT &&
|
||||
// key != SDLK_RGUI &&
|
||||
// key != SDLK_LGUI &&
|
||||
// key != SDLK_MODE &&
|
||||
// key != SDLK_HELP &&
|
||||
// key != SDLK_PRINTSCREEN &&
|
||||
// key != SDLK_SYSREQ &&
|
||||
// key != SDLK_PAUSE &&
|
||||
// key != SDLK_MENU &&
|
||||
// key != SDLK_POWER);
|
||||
//
|
||||
// string inputKeyName = SDL_GetKeyName((SDL_Keycode)key);
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] pressed key [%d - %s] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key,inputKeyName.c_str(),result);
|
||||
// if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] pressed key [%d - %s] result = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key,inputKeyName.c_str(),result);
|
||||
//
|
||||
// return result;
|
||||
//}
|
||||
|
||||
bool isAllowedInputTextKey(SDL_Keycode key) {
|
||||
if(Window::isAllowedKey(key) == true) {
|
||||
@@ -1223,7 +1223,6 @@ bool isAllowedInputTextKey(SDL_Keycode key) {
|
||||
key != SDLK_HELP &&
|
||||
key != SDLK_PRINTSCREEN &&
|
||||
key != SDLK_SYSREQ &&
|
||||
key != SDLK_PAUSE &&
|
||||
key != SDLK_MENU &&
|
||||
key != SDLK_POWER);
|
||||
|
||||
|
Reference in New Issue
Block a user