Renamed megaglest_runtime_error to game_runtime_error

This commit is contained in:
mathusummut
2018-11-02 12:15:57 +01:00
parent 4eb7dc204e
commit 69ab9716da
116 changed files with 1244 additions and 1244 deletions

View File

@@ -201,7 +201,7 @@ namespace Shared {
}
else
{
throw megaglest_runtime_error("Can not open file: " + path);
throw game_runtime_error("Can not open file: " + path);
}
fclose(file);
*/
@@ -216,15 +216,15 @@ namespace Shared {
const char *infile = path.c_str();
if ((fd = open(infile,O_RDONLY)) < 0)
throw megaglest_runtime_error("Can not open file: " + path);
throw game_runtime_error("Can not open file: " + path);
if ((data = (int8 *)malloc(bytes_expected)) == NULL)
throw megaglest_runtime_error("malloc failed, Can not open file: " + path);
throw game_runtime_error("malloc failed, Can not open file: " + path);
bytes_read = read(fd, data, bytes_expected);
//if (bytes_read != bytes_expected)
// throw megaglest_runtime_error("read failed, Can not open file: " + path);
// throw game_runtime_error("read failed, Can not open file: " + path);
for(int i = 0; i < bytes_read; i++) {
addByte(data[i]);
@@ -286,7 +286,7 @@ namespace Shared {
}
}
else {
throw megaglest_runtime_error("Can not open file: " + path);
throw game_runtime_error("Can not open file: " + path);
}
fclose(file);
*/

View File

@@ -44,7 +44,7 @@ namespace Shared {
if (s == "1" || s == "true") {
return true;
}
throw megaglest_runtime_error("Error converting string to bool, expected 0 or 1, found: [" + s + "]");
throw game_runtime_error("Error converting string to bool, expected 0 or 1, found: [" + s + "]");
}
int strToInt(const string &s) {
@@ -53,7 +53,7 @@ namespace Shared {
int intValue = strtol(s.c_str(), &endChar, 10);
if (*endChar != '\0') {
throw megaglest_runtime_error("Error converting from string to int, found: [" + s + "]");
throw game_runtime_error("Error converting from string to int, found: [" + s + "]");
}
return intValue;
@@ -65,7 +65,7 @@ namespace Shared {
uint32 intValue = strtoul(s.c_str(), &endChar, 10);
if (*endChar != '\0') {
throw megaglest_runtime_error("Error converting from string to uint, found: [" + s + "]");
throw game_runtime_error("Error converting from string to uint, found: [" + s + "]");
}
return intValue;
@@ -79,7 +79,7 @@ namespace Shared {
float floatValue = static_cast<float>(strtod(s.c_str(), &endChar));
if (*endChar != '\0') {
throw megaglest_runtime_error("Error converting from string to float, found: [" + s + "]");
throw game_runtime_error("Error converting from string to float, found: [" + s + "]");
}
return floatValue;

View File

@@ -97,7 +97,7 @@ namespace Shared {
FILE *f = fopen(profileLog.c_str(), "w");
#endif
if (f == NULL)
throw megaglest_runtime_error("Can not open file: " + profileLog);
throw game_runtime_error("Can not open file: " + profileLog);
fprintf(f, "Profiler Results\n\n");
@@ -127,7 +127,7 @@ namespace Shared {
currSection->stop();
currSection = currSection->getParent();
} else {
throw megaglest_runtime_error("Profile: Leaving section is not current section: " + name);
throw game_runtime_error("Profile: Leaving section is not current section: " + name);
}
}

View File

@@ -83,7 +83,7 @@ namespace Shared {
if (fileStream.is_open() == false) {
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] path = [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str());
throw megaglest_runtime_error("File NOT FOUND, can't open file: [" + path + "]");
throw game_runtime_error("File NOT FOUND, can't open file: [" + path + "]");
}
if (clearCurrentProperties == true) {
@@ -471,7 +471,7 @@ namespace Shared {
return strToBool(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + key + " in: " + path+"\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + key + " in: " + path+"\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
}
return false;
@@ -482,7 +482,7 @@ namespace Shared {
return strToInt(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
}
return 0;
@@ -491,7 +491,7 @@ namespace Shared {
int Properties::getInt(const string &key, int min, int max, const char *defaultValueIfNotFound) const {
int i = getInt(key, defaultValueIfNotFound);
if (i<min || i>max) {
throw megaglest_runtime_error("Value out of range: " + key + ", min: " + intToStr(min) + ", max: " + intToStr(max));
throw game_runtime_error("Value out of range: " + key + ", min: " + intToStr(min) + ", max: " + intToStr(max));
}
return i;
}
@@ -502,7 +502,7 @@ namespace Shared {
result = strToFloat(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + key + " in: " + path + "\n[" + e.what() + "]");
}
return result;
@@ -511,7 +511,7 @@ namespace Shared {
float Properties::getFloat(const string &key, float min, float max, const char *defaultValueIfNotFound) const {
float f = getFloat(key, defaultValueIfNotFound);
if (f<min || f>max) {
throw megaglest_runtime_error("Value out of range: " + key + ", min: " + floatToStr(min, 16) + ", max: " + floatToStr(max, 16));
throw game_runtime_error("Value out of range: " + key + ", min: " + floatToStr(min, 16) + ", max: " + floatToStr(max, 16));
}
return f;
}
@@ -591,7 +591,7 @@ namespace Shared {
return strToBool(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + string(key) + " in: " + path+"\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + string(key) + " in: " + path+"\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
}
return false;
@@ -602,7 +602,7 @@ namespace Shared {
return strToInt(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
}
return 0;
@@ -614,7 +614,7 @@ namespace Shared {
result = strToFloat(getString(key, defaultValueIfNotFound));
} catch (exception &e) {
SystemFlags::OutputDebug(SystemFlags::debugError, "In [%s::%s Line: %d] Error [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, e.what());
//throw megaglest_runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
//throw game_runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
throw runtime_error("Error accessing value: " + string(key) + " in: " + path + "\n[" + e.what() + "]");
}
return result;

View File

@@ -81,7 +81,7 @@ namespace Shared {
if (min > max) {
char szBuf[8096] = "";
snprintf(szBuf, 8096, "In [%s::%s Line: %d] min > max, min = %d, max = %d", __FILE__, __FUNCTION__, __LINE__, min, max);
throw megaglest_runtime_error(szBuf);
throw game_runtime_error(szBuf);
}
int diff = max - min;
@@ -90,7 +90,7 @@ namespace Shared {
if (res < min || res > max) {
char szBuf[8096] = "";
snprintf(szBuf, 8096, "In [%s::%s Line: %d] res < min || res > max, min = %d, max = %d, res = %d", __FILE__, __FUNCTION__, __LINE__, min, max, res);
throw megaglest_runtime_error(szBuf);
throw game_runtime_error(szBuf);
}
return res;
}
@@ -99,7 +99,7 @@ namespace Shared {
if (min > max) {
char szBuf[8096] = "";
snprintf(szBuf, 8096, "In [%s::%s Line: %d] min > max, min = %f, max = %f", __FILE__, __FUNCTION__, __LINE__, min, max);
throw megaglest_runtime_error(szBuf);
throw game_runtime_error(szBuf);
}
float rand01 = static_cast<float>(this->rand(lastCaller)) / (m - 1);
@@ -109,7 +109,7 @@ namespace Shared {
if (res < min || res > max) {
char szBuf[8096] = "";
snprintf(szBuf, 8096, "In [%s::%s Line: %d] res < min || res > max, min = %f, max = %f, res = %f", __FILE__, __FUNCTION__, __LINE__, min, max, res);
throw megaglest_runtime_error(szBuf);
throw game_runtime_error(szBuf);
}
return res;
}

View File

@@ -235,7 +235,7 @@ namespace Shared {
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
if (threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true) {
//throw megaglest_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
//throw game_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] ERROR threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
//static SystemFlagsType *result = new SystemFlagsType();
static SystemFlags::SystemFlagsType result;
@@ -253,7 +253,7 @@ namespace Shared {
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
if (threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true) {
//throw megaglest_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
//throw game_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] ERROR threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
return;
}
@@ -411,7 +411,7 @@ namespace Shared {
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
if (threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true) {
//throw megaglest_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
//throw game_runtime_error("threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true");
if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] ERROR threadLogger == NULL && SystemFlags::SHUTDOWN_PROGRAM_MODE == true\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
//return;
}
@@ -630,7 +630,7 @@ namespace Shared {
}
if (pos == string::npos) {
throw megaglest_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " pos == string::npos for [" + s + "]");
throw game_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " pos == string::npos for [" + s + "]");
}
if (pos + 1 == s.length() && s.length() > 0 &&
@@ -665,7 +665,7 @@ namespace Shared {
}
if (pos != string::npos) {
//throw megaglest_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " pos == string::npos for [" + s + "]");
//throw game_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " pos == string::npos for [" + s + "]");
//}
return (s.substr(0, pos));
@@ -676,7 +676,7 @@ namespace Shared {
string cutLastExt(const string &s) {
size_t i = s.find_last_of('.');
if (i != string::npos) {
//throw megaglest_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " i==string::npos for [" + s + "]");
//throw game_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " i==string::npos for [" + s + "]");
//}
return (s.substr(0, i));
@@ -690,7 +690,7 @@ namespace Shared {
i = s.find_last_of('.') + 1;
if (i != string::npos) {
//throw megaglest_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " i==string::npos for [" + s + "]");
//throw game_runtime_error(string(extractFileFromDirectoryPath(__FILE__).c_str()) + " line: " + intToStr(__LINE__) + " i==string::npos for [" + s + "]");
//}
return (s.substr(i, s.size() - i));
}