mirror of
https://github.com/glest/glest-source.git
synced 2025-08-07 08:56:28 +02:00
Normalized defaults
This commit is contained in:
@@ -810,7 +810,7 @@ namespace Shared {
|
||||
size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
fclose(f1);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
@@ -835,7 +835,7 @@ namespace Shared {
|
||||
bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
startLocations[i].x = Shared::PlatformByteOrder::fromCommonEndian(startLocations[i].x);
|
||||
@@ -843,7 +843,7 @@ namespace Shared {
|
||||
bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
startLocations[i].y = Shared::PlatformByteOrder::fromCommonEndian(startLocations[i].y);
|
||||
@@ -856,7 +856,7 @@ namespace Shared {
|
||||
bytes = fread(&cells[i][j].height, sizeof(float), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
cells[i][j].height = Shared::PlatformByteOrder::fromCommonEndian(cells[i][j].height);
|
||||
@@ -869,7 +869,7 @@ namespace Shared {
|
||||
bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
cells[i][j].surface = Shared::PlatformByteOrder::fromCommonEndian(cells[i][j].surface);
|
||||
@@ -883,7 +883,7 @@ namespace Shared {
|
||||
bytes = fread(&obj, sizeof(int8), 1, f1);
|
||||
if (bytes != 1) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", bytes, __LINE__);
|
||||
throw game_runtime_error(szBuf);
|
||||
}
|
||||
obj = Shared::PlatformByteOrder::fromCommonEndian(obj);
|
||||
@@ -1051,7 +1051,7 @@ namespace Shared {
|
||||
|
||||
if (errorOnInvalidMap == true) {
|
||||
char szBuf[8096] = "";
|
||||
snprintf(szBuf, 8096, "In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [" MG_SIZE_T_SPECIFIER "] [" MG_SIZE_T_SPECIFIER "]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, file.c_str(), readBytes, sizeof(MapFileHeader));
|
||||
snprintf(szBuf, 8096, "In [%s::%s Line: %d]\nfile [%s]\nreadBytes != sizeof(MapFileHeader) [" SIZE_T_SPECIFIER "] [" SIZE_T_SPECIFIER "]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, file.c_str(), readBytes, sizeof(MapFileHeader));
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError, "%s", szBuf);
|
||||
|
||||
throw game_runtime_error(szBuf);
|
||||
|
Reference in New Issue
Block a user