Normalized defaults

This commit is contained in:
mathusummut
2018-12-16 15:06:51 +01:00
parent fb9a48fd02
commit 4769e132d0
39 changed files with 322 additions and 323 deletions

View File

@@ -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);