From 4769e132d06554ed063f623d89b603b77b76b82c Mon Sep 17 00:00:00 2001 From: mathusummut Date: Sun, 16 Dec 2018 15:06:51 +0100 Subject: [PATCH] Normalized defaults --- source/g3d_viewer/main.cpp | 14 +-- source/glest_game/ai/ai_rule.cpp | 32 +++--- source/glest_game/game/commander.cpp | 4 +- source/glest_game/game/game.cpp | 102 +++++++++--------- source/glest_game/game/script_manager.cpp | 4 +- source/glest_game/global/config.cpp | 10 +- source/glest_game/global/core_data.cpp | 2 +- source/glest_game/graphics/renderer.cpp | 10 +- source/glest_game/main/main.cpp | 68 ++++++------ source/glest_game/main/program.cpp | 20 ++-- .../menu/menu_state_connected_game.cpp | 10 +- .../menu/menu_state_custom_game.cpp | 8 +- .../menu/menu_state_custom_game_update.cpp | 2 +- .../glest_game/menu/menu_state_keysetup.cpp | 4 +- .../menu/menu_state_masterserver.cpp | 2 +- source/glest_game/menu/menu_state_options.cpp | 4 +- .../glest_game/network/network_protocol.cpp | 12 +-- source/glest_game/type_instances/faction.cpp | 14 +-- source/glest_game/type_instances/unit.cpp | 42 ++++---- source/glest_game/types/faction_type.cpp | 8 +- source/glest_game/types/unit_type.cpp | 2 +- source/glest_game/world/map.cpp | 10 +- source/glest_game/world/world.cpp | 46 ++++---- source/glest_map_editor/main.cpp | 1 - .../include/platform/common/platform_common.h | 2 +- .../include/platform/posix/socket.h | 2 +- .../include/platform/sdl/data_types.h | 40 +++---- source/shared_lib/include/util/leak_dumper.h | 4 +- source/shared_lib/sources/graphics/model.cpp | 50 ++++----- source/shared_lib/sources/graphics/pixmap.cpp | 50 ++++----- .../sources/graphics/video_player.cpp | 4 +- source/shared_lib/sources/map/map_preview.cpp | 14 +-- .../sources/platform/posix/miniftpclient.cpp | 6 +- .../sources/platform/posix/socket.cpp | 8 +- .../sources/platform/sdl/platform_util.cpp | 2 +- .../sound/openal/sound_player_openal.cpp | 2 +- .../sources/sound/sound_file_loader.cpp | 2 +- .../shared_lib/sources/util/leak_dumper.cpp | 14 +-- source/shared_lib/sources/xml/xml_parser.cpp | 14 +-- 39 files changed, 322 insertions(+), 323 deletions(-) diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index f64ab47f9..0f1f9daaa 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -334,7 +334,7 @@ namespace Shared { if (modelPath != "") { this->modelPathList.push_back(modelPath); - printf("Startup Adding model [%s] list size " MG_SIZE_T_SPECIFIER "\n", modelPath.c_str(), this->modelPathList.size()); + printf("Startup Adding model [%s] list size " SIZE_T_SPECIFIER "\n", modelPath.c_str(), this->modelPathList.size()); } if (particlePath != "") { this->particlePathList.push_back(particlePath); @@ -1271,14 +1271,14 @@ namespace Shared { try { if (path != "" && fileExists(path) == true) { this->modelPathList.push_back(path); - printf("Adding model [%s] list size " MG_SIZE_T_SPECIFIER "\n", path.c_str(), this->modelPathList.size()); + printf("Adding model [%s] list size " SIZE_T_SPECIFIER "\n", path.c_str(), this->modelPathList.size()); } string titlestring = winHeader; for (unsigned int idx = 0; idx < this->modelPathList.size(); idx++) { string modelPath = this->modelPathList[idx]; - //printf("Loading model [%s] %u of " MG_SIZE_T_SPECIFIER "\n",modelPath.c_str(),idx, this->modelPathList.size()); + //printf("Loading model [%s] %u of " SIZE_T_SPECIFIER "\n",modelPath.c_str(),idx, this->modelPathList.size()); if (timer) timer->Stop(); //delete model; @@ -1405,7 +1405,7 @@ namespace Shared { } void MainWindow::loadProjectileParticle(string path) { - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleProjectilePathList.size() = " MG_SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleProjectilePathList.size()); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleProjectilePathList.size() = " SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleProjectilePathList.size()); if (timer) timer->Stop(); if (path != "" && fileExists(path) == true) { @@ -1425,7 +1425,7 @@ namespace Shared { try { if (this->particleProjectilePathList.empty() == false) { - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("this->particleProjectilePathList.size() = " MG_SIZE_T_SPECIFIER "\n", this->particleProjectilePathList.size()); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("this->particleProjectilePathList.size() = " SIZE_T_SPECIFIER "\n", this->particleProjectilePathList.size()); string titlestring = winHeader; for (unsigned int idx = 0; idx < this->particleProjectilePathList.size(); idx++) { @@ -1521,7 +1521,7 @@ namespace Shared { } void MainWindow::loadSplashParticle(string path) { // uses ParticleSystemTypeSplash::load (and own list...) - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleSplashPathList.size() = " MG_SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleSplashPathList.size()); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] about to load [%s] particleSplashPathList.size() = " SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleSplashPathList.size()); if (timer) timer->Stop(); if (path != "" && fileExists(path) == true) { @@ -1622,7 +1622,7 @@ namespace Shared { wxMessageDialog(NULL, ToUnicode(e.what()), ToUnicode("Not a ZetaGlest projectile particle XML file, or broken"), wxOK | wxICON_ERROR).ShowModal(); } if (timer) timer->Start(100); - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] after load [%s] particleSplashPathList.size() = " MG_SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleSplashPathList.size()); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] after load [%s] particleSplashPathList.size() = " SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, path.c_str(), this->particleSplashPathList.size()); } void MainWindow::onMenuModeNormals(wxCommandEvent &event) { diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index a992fa8af..fc4923485 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -1317,7 +1317,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "In produceGeneric priority adding produce task: %d of " - MG_SIZE_T_SPECIFIER " for unit type [%s]", + SIZE_T_SPECIFIER " for unit type [%s]", i, ableUnits.size(), ableUnits[i]->getName(false).c_str()); aiInterface->printLog(4, szBuf); @@ -1338,7 +1338,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "In produceGeneric randomUnitTypeIndex = %d of " - MG_SIZE_T_SPECIFIER " equals unit type [%s]", + SIZE_T_SPECIFIER " equals unit type [%s]", randomUnitTypeIndex, ableUnits.size() - 1, ableUnits[randomUnitTypeIndex]->getName(false). c_str()); @@ -1749,13 +1749,13 @@ namespace Game { szBuf[8096] = ""; printf ("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, + SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, aiInterface->getMyUnitCount(), i, producers.size()); snprintf(szBuf, 8096, "In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER "", __FILE__, + SIZE_T_SPECIFIER "", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, aiInterface->getMyUnitCount(), i, producers.size()); @@ -1802,13 +1802,13 @@ namespace Game { szBuf[8096] = ""; printf ("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, + SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, aiInterface->getMyUnitCount(), i, producers.size()); snprintf(szBuf, 8096, "In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %u, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER "", __FILE__, + SIZE_T_SPECIFIER "", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, aiInterface->getMyUnitCount(), i, @@ -1821,12 +1821,12 @@ namespace Game { szBuf[8096] = ""; printf ("In [%s::%s Line: %d] prIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER " \n", __FILE__, + SIZE_T_SPECIFIER " \n", __FILE__, __FUNCTION__, __LINE__, prIndex, i, producers.size()); snprintf(szBuf, 8096, "In [%s::%s Line: %d] currentProducerIndex >= producers.size(), currentProducerIndex = %d, i = %u,producers.size() = " - MG_SIZE_T_SPECIFIER "", __FILE__, + SIZE_T_SPECIFIER "", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, i, producers.size()); @@ -1928,14 +1928,14 @@ namespace Game { szBuf[8096] = ""; printf ("In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = " - MG_SIZE_T_SPECIFIER "\n", __FILE__, + SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, aiInterface->getMyUnitCount(), i, backupProducers.size()); snprintf(szBuf, 8096, "In [%s::%s Line: %d] currentProducerIndex >= aiInterface->getMyUnitCount(), currentProducerIndex = %d, aiInterface->getMyUnitCount() = %d, i = %u,backupProducers.size() = " - MG_SIZE_T_SPECIFIER "", + SIZE_T_SPECIFIER "", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, @@ -1951,12 +1951,12 @@ namespace Game { szBuf[8096] = ""; printf ("In [%s::%s Line: %d] prIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = " - MG_SIZE_T_SPECIFIER " \n", __FILE__, + SIZE_T_SPECIFIER " \n", __FILE__, __FUNCTION__, __LINE__, prIndex, i, backupProducers.size()); snprintf(szBuf, 8096, "In [%s::%s Line: %d] currentProducerIndex >= backupProducers.size(), currentProducerIndex = %d, i = %u,backupProducers.size() = " - MG_SIZE_T_SPECIFIER "", + SIZE_T_SPECIFIER "", __FILE__, __FUNCTION__, __LINE__, currentProducerIndex, i, @@ -2428,7 +2428,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "In buildGeneric for resource type [%s] aibcResourceProducerUnits = " - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER " priorityUnit.first: [%s]\n", bt->getResourceType()->getName(). c_str(), unitList.size(), @@ -2467,7 +2467,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "In buildGeneric for resource type [%s] aibcBuildingUnits = " - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER " priorityUnit.first: [%s]\n", bt->getResourceType()->getName(). c_str(), unitList.size(), @@ -2551,7 +2551,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "==> START buildBestBuilding buildings.size = " - MG_SIZE_T_SPECIFIER "\n", buildings.size()); + SIZE_T_SPECIFIER "\n", buildings.size()); aiInterface->printLog(4, szBuf); } @@ -2660,7 +2660,7 @@ namespace Game { szBuf[8096] = ""; snprintf(szBuf, 8096, "==> END buildBestBuilding buildings.size = " - MG_SIZE_T_SPECIFIER "\n", buildings.size()); + SIZE_T_SPECIFIER "\n", buildings.size()); aiInterface->printLog(4, szBuf); } } diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 4bce16600..0ccc82169 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -711,7 +711,7 @@ namespace Game { if (replayCommandList.empty() == false) { if (SystemFlags::VERBOSE_MODE_ENABLED) printf("worldFrameCount = %d replayCommandList.size() = " - MG_SIZE_T_SPECIFIER "\n", worldFrameCount, + SIZE_T_SPECIFIER "\n", worldFrameCount, replayCommandList.size()); std::vector < NetworkCommand > replayList; @@ -732,7 +732,7 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED) printf ("worldFrameCount = %d GIVING COMMANDS replayList.size() = " - MG_SIZE_T_SPECIFIER "\n", worldFrameCount, + SIZE_T_SPECIFIER "\n", worldFrameCount, replayList.size()); for (int i = 0; i < (int) replayList.size(); ++i) { giveNetworkCommand(&replayList[i]); diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 8c67f10dc..d582a7e94 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -493,7 +493,7 @@ namespace Game { getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] ==== END GAME ==== getCurrentPixelByteCount() = " - MG_SIZE_T_SPECIFIER "\n", + SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath (__FILE__).c_str(), __FUNCTION__, __LINE__, renderer.getCurrentPixelByteCount()); @@ -650,7 +650,7 @@ namespace Game { getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] ==== END GAME ==== getCurrentPixelByteCount() = " - MG_SIZE_T_SPECIFIER "\n", + SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath (__FILE__).c_str(), __FUNCTION__, __LINE__, renderer.getCurrentPixelByteCount()); @@ -741,7 +741,7 @@ namespace Game { && EndsWith(factionLogoFilter, ".xml") == false) { if (SystemFlags::VERBOSE_MODE_ENABLED) printf("\nLooking for best logo from a list of: " - MG_SIZE_T_SPECIFIER " using filter: [%s]\n", + SIZE_T_SPECIFIER " using filter: [%s]\n", loadScreenList.size(), logoFullPathFilter.c_str()); int bestMinWidthDiff = INT_MAX; @@ -937,7 +937,7 @@ namespace Game { && EndsWith(factionLogoFilter, ".xml") == false) { if (SystemFlags::VERBOSE_MODE_ENABLED) printf("\nLooking for best logo from a list of: " - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER " using filter: [%s]\n", loadScreenList.size(), logoFullPathFilter.c_str()); @@ -1452,7 +1452,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1557,7 +1557,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1600,7 +1600,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1630,7 +1630,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1656,7 +1656,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1688,7 +1688,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1721,7 +1721,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1768,7 +1768,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1810,7 +1810,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1912,7 +1912,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1956,7 +1956,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1974,7 +1974,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2052,7 +2052,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2103,7 +2103,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2126,7 +2126,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2141,7 +2141,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2236,7 +2236,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2272,7 +2272,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2318,7 +2318,7 @@ namespace Game { getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] ==== START GAME ==== getCurrentPixelByteCount() = " - MG_SIZE_T_SPECIFIER "\n", + SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath (__FILE__).c_str(), __FUNCTION__, __LINE__, renderer.getCurrentPixelByteCount()); @@ -2578,7 +2578,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "=============== FRAME: %d In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", world.getFrameCount(), + I64_SPECIFIER "\n", world.getFrameCount(), extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2836,7 +2836,7 @@ namespace Game { __LINE__, chrono.getMillis()); if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2852,7 +2852,7 @@ namespace Game { __LINE__, chrono.getMillis()); if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2881,7 +2881,7 @@ namespace Game { __LINE__, chrono.getMillis()); if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2911,7 +2911,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -2973,7 +2973,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath (__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); @@ -3025,7 +3025,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3082,7 +3082,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3126,7 +3126,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3159,7 +3159,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3178,7 +3178,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3221,7 +3221,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3248,7 +3248,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3279,7 +3279,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " - MG_I64_SPECIFIER "\n", + I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3305,7 +3305,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3330,7 +3330,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3342,7 +3342,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3366,7 +3366,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3742,7 +3742,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3764,7 +3764,7 @@ namespace Game { try { gameStarted = false; - //printf("\nname [%s] scenarioFile [%s] results.size() = " MG_SIZE_T_SPECIFIER "\n",name.c_str(),scenarioFile.c_str(),results.size()); + //printf("\nname [%s] scenarioFile [%s] results.size() = " SIZE_T_SPECIFIER "\n",name.c_str(),scenarioFile.c_str(),results.size()); //printf("[%s:%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); bool isTutorial = Scenario::isGameTutorial(scenarioFile); @@ -3922,7 +3922,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -3992,7 +3992,7 @@ namespace Game { continue; } //else { - // printf("iterMap->second: " MG_I64_SPECIFIER " WARNING_RENDER_MILLIS = %d\n",iterMap->second,WARNING_RENDER_MILLIS); + // printf("iterMap->second: " I64_SPECIFIER " WARNING_RENDER_MILLIS = %d\n",iterMap->second,WARNING_RENDER_MILLIS); //} } else if (iterMap->second < WARNING_MILLIS) { continue; @@ -4977,7 +4977,7 @@ namespace Game { factionIndex); } } - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); //isUnMarkCellEnabled = false; @@ -5481,7 +5481,7 @@ namespace Game { //GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); //gameNetworkInterface->sendMarkCellMessage(mc.getTargetPos(),mc.getFaction()->getIndex(),mc.getNote()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); isMarkCellEnabled = false; cellMarkedData = mc; @@ -5513,7 +5513,7 @@ namespace Game { isUnMarkCellEnabled = false; removeCellMarker(surfaceCellPos, world.getThisFaction()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); Renderer & renderer = Renderer::getInstance(); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); @@ -5568,7 +5568,7 @@ namespace Game { "placeholder for note", world.getThisFaction()->getStartLocationIndex()); - //printf("#2 ADDED in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#2 ADDED in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); isMarkCellEnabled = false; cellMarkedData = mc; @@ -5598,7 +5598,7 @@ namespace Game { isUnMarkCellEnabled = false; removeCellMarker(surfaceCellPos, world.getThisFaction()); - //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); + //printf("#1 ADDED in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",surfaceCellPos.getString().c_str(),mapMarkedCellList.size()); //Renderer &renderer= Renderer::getInstance(); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); @@ -9039,7 +9039,7 @@ namespace Game { vector < XmlNode * >networkCommandNodeList = gameNode->getChildList("NetworkCommand"); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("networkCommandNodeList.size() = " MG_SIZE_T_SPECIFIER + printf("networkCommandNodeList.size() = " SIZE_T_SPECIFIER "\n", networkCommandNodeList.size()); for (unsigned int i = 0; i < networkCommandNodeList.size(); ++i) { XmlNode *node = networkCommandNodeList[i]; diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index fc8ece017..8455b3583 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -3580,7 +3580,7 @@ namespace Game { void ScriptManager::error(LuaHandle * luaHandle, - const game_runtime_error * mgErr, + const game_runtime_error * gameErr, const char *file, const char *function, int line) { char szErrBuf[8096] = ""; @@ -3609,7 +3609,7 @@ namespace Game { string sErrBuf = string("Error! The game may no longer be stable!\n\n") + string(szErrBuf) + "\n" + string(szErrBuf2) + "\n\n" - + string(mgErr->what()); + + string(gameErr->what()); SystemFlags::OutputDebug(SystemFlags::debugError, sErrBuf.c_str()); if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem). diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index 3977e290a..9cd2ecac3 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -936,7 +936,7 @@ namespace Game { replaceFileWithLocalFile(dirList, fileNamePart, result); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("Found file [%s] @ " MG_SIZE_T_SPECIFIER + printf("Found file [%s] @ " SIZE_T_SPECIFIER " [%s]\nNew File [%s]\n", fileName.c_str(), pos, fileNamePart.c_str(), result.c_str()); } else if (fileName.find("tilesets/") != fileName.npos) { @@ -947,7 +947,7 @@ namespace Game { replaceFileWithLocalFile(dirList, fileNamePart, result); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("Found file [%s] @ " MG_SIZE_T_SPECIFIER + printf("Found file [%s] @ " SIZE_T_SPECIFIER " [%s]\nNew File [%s]\n", fileName.c_str(), pos, fileNamePart.c_str(), result.c_str()); } else if (fileName.find("techs/") != fileName.npos) { @@ -958,7 +958,7 @@ namespace Game { replaceFileWithLocalFile(dirList, fileNamePart, result); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("Found file [%s] @ " MG_SIZE_T_SPECIFIER + printf("Found file [%s] @ " SIZE_T_SPECIFIER " [%s]\nNew File [%s]\n", fileName.c_str(), pos, fileNamePart.c_str(), result.c_str()); } else if (fileName.find("scenarios/") != fileName.npos) { @@ -969,7 +969,7 @@ namespace Game { replaceFileWithLocalFile(dirList, fileNamePart, result); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("Found file [%s] @ " MG_SIZE_T_SPECIFIER + printf("Found file [%s] @ " SIZE_T_SPECIFIER " [%s]\nNew File [%s]\n", fileName.c_str(), pos, fileNamePart.c_str(), result.c_str()); } else if (fileName.find("tutorials/") != fileName.npos) { @@ -980,7 +980,7 @@ namespace Game { replaceFileWithLocalFile(dirList, fileNamePart, result); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("Found file [%s] @ " MG_SIZE_T_SPECIFIER + printf("Found file [%s] @ " SIZE_T_SPECIFIER " [%s]\nNew File [%s]\n", fileName.c_str(), pos, fileNamePart.c_str(), result.c_str()); } diff --git a/source/glest_game/global/core_data.cpp b/source/glest_game/global/core_data.cpp index 10c12655d..df0ab31b1 100644 --- a/source/glest_game/global/core_data.cpp +++ b/source/glest_game/global/core_data.cpp @@ -1687,7 +1687,7 @@ namespace Game { gameSettings->setNetworkPauseGameForLaggedClients(properties. getBool ("NetworkPauseGameForLaggedClients", - "false")); + "true")); gameSettings->setThisFactionIndex(properties. getInt("FactionThisFactionIndex")); diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 7a45a1729..1d43bb1e8 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -1410,7 +1410,7 @@ namespace Game { visibleQuad.p[3].x, visibleQuad.p[3].y); for (unsigned int i = 0; i < quadCache.frustumData.size(); ++i) { - printf("\nFrustum #%u [" MG_SIZE_T_SPECIFIER "]: ", i, quadCache.frustumData.size()); + printf("\nFrustum #%u [" SIZE_T_SPECIFIER "]: ", i, quadCache.frustumData.size()); vector &frustumDataInner = quadCache.frustumData[i]; for (unsigned int j = 0; j < frustumDataInner.size(); ++j) { printf("[%f]", quadCache.frustumData[i][j]); @@ -9126,13 +9126,13 @@ namespace Game { if (markedCells.empty() == false) { if (markedCells.find(pos) != markedCells.end()) { - //printf("#1 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); + //printf("#1 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); //if(markedCells.empty() == false) { //SurfaceCell *sc = map->getSurfaceCell(pos); //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); updateMarkedCellScreenPosQuadCache(pos); } else { - //printf("#1 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); + //printf("#1 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); } } } else { @@ -9160,12 +9160,12 @@ namespace Game { if (markedCells.empty() == false) { if (markedCells.find(pos) != markedCells.end()) { - //printf("#2 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); + //printf("#2 ******** VISIBLE SCALED CELL FOUND in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); //if(markedCells.empty() == false) { //quadCache.visibleScaledCellToScreenPosList[pos]=computeScreenPosition(sc->getVertex()); updateMarkedCellScreenPosQuadCache(pos); } else { - //printf("#2 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = " MG_SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); + //printf("#2 VISIBLE SCALED CELL NOT FOUND in marked list pos [%s] markedCells.size() = " SIZE_T_SPECIFIER "\n",pos.getString().c_str(),markedCells.size()); } } } diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 07a1e184f..a83221008 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -132,7 +132,7 @@ namespace Game { tempDataLocation = getUserHome(); static string - mg_app_name = ""; + appNameString = ""; static string mailStringSupport = ""; @@ -324,7 +324,7 @@ namespace Game { Thread::shutdownThreads(); if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("start running threads = " MG_SIZE_T_SPECIFIER "\n", + printf("start running threads = " SIZE_T_SPECIFIER "\n", Thread::getThreadList().size()); time_t elapsed = time(NULL); @@ -339,7 +339,7 @@ namespace Game { lastLazyThreadDump = difftime((long int) time(NULL), elapsed); printf("Waiting for the following threads to exit [" - MG_SIZE_T_SPECIFIER "]:\n", + SIZE_T_SPECIFIER "]:\n", Thread::getThreadList().size()); for (int i = 0; i < (int) Thread::getThreadList().size(); ++i) { @@ -356,7 +356,7 @@ namespace Game { } } if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("end running threads = " MG_SIZE_T_SPECIFIER "\n", + printf("end running threads = " SIZE_T_SPECIFIER "\n", Thread::getThreadList().size()); Thread::shutdownThreads(); @@ -406,7 +406,7 @@ namespace Game { errText = string(msg) + " [" + runtimeErrorMsg + "]"; //puts(msg); string - sErr = string(mg_app_name) + " fatal error"; + sErr = string(appNameString) + " fatal error"; SystemFlags::OutputDebug(SystemFlags::debugError, "%s\n", errText.c_str()); SystemFlags::OutputDebug(SystemFlags::debugSystem, "%s\n", @@ -703,7 +703,7 @@ namespace Game { ExceptionHandler::handle(LPEXCEPTION_POINTERS pointers) { string msg = - "#1 An error occurred and " + string(mg_app_name) + + "#1 An error occurred and " + string(appNameString) + " will close.\nPlease report this bug to: " + string(mailString); msg += ", attaching the generated " + getCrashDumpFileName() + " file."; @@ -729,7 +729,7 @@ namespace Game { ExceptionHandler::handle() { string msg = - "#1 An error occurred and " + string(mg_app_name) + + "#1 An error occurred and " + string(appNameString) + " will close.\nPlease report this bug to: " + string(mailString); #ifdef WIN32 msg += @@ -952,7 +952,7 @@ namespace Game { string err = "#2 An error occurred and "; if (sdl_quitCalled == false) { - err += mg_app_name; + err += appNameString; } err += " will close.\nError msg = [" + errMsg + @@ -2483,8 +2483,8 @@ namespace Game { } } - printf("Found tileset filecount = " MG_SIZE_T_SPECIFIER ", used = " - MG_SIZE_T_SPECIFIER "\n", foundFileList.size(), + printf("Found tileset filecount = " SIZE_T_SPECIFIER ", used = " + SIZE_T_SPECIFIER "\n", foundFileList.size(), loadedFileList.size()); int @@ -3071,8 +3071,8 @@ namespace Game { } } - printf("Found techtree filecount = " MG_SIZE_T_SPECIFIER - ", used = " MG_SIZE_T_SPECIFIER "\n", + printf("Found techtree filecount = " SIZE_T_SPECIFIER + ", used = " SIZE_T_SPECIFIER "\n", foundFileList.size(), loadedFileList.size()); int @@ -3187,7 +3187,7 @@ namespace Game { } printf("----- START duplicate files for CRC [%u] count [" - MG_SIZE_T_SPECIFIER "] first file is [%s]\n", + SIZE_T_SPECIFIER "] first file is [%s]\n", iterMap->first, fileList.size(), fileList[0].c_str()); @@ -3238,7 +3238,7 @@ namespace Game { } printf("----- Finding parents for duplicate files [" - MG_SIZE_T_SPECIFIER "] first file is [%s]\n", + SIZE_T_SPECIFIER "] first file is [%s]\n", fileList.size(), fileList[0].c_str()); for (map < string, int >::iterator iterMap1 = @@ -3254,7 +3254,7 @@ namespace Game { if (purgeDuplicateFiles == true) { printf("----- move / remove duplicate files [" - MG_SIZE_T_SPECIFIER "] first file is [%s]\n", + SIZE_T_SPECIFIER "] first file is [%s]\n", fileList.size(), fileList[0].c_str()); // First move first duplicate to commondata and delete all other copies string @@ -3268,7 +3268,7 @@ namespace Game { off_t fileSize = getFileSize(duplicateFile); - printf("#1 [%u / " MG_SIZE_T_SPECIFIER + printf("#1 [%u / " SIZE_T_SPECIFIER "] removing duplicate [%s]\n", idx, fileList.size(), duplicateFile.c_str()); @@ -3382,7 +3382,7 @@ namespace Game { } printf("----- update XML files for duplicate files [" - MG_SIZE_T_SPECIFIER "] first file is [%s]\n", + SIZE_T_SPECIFIER "] first file is [%s]\n", fileList.size(), fileList[0].c_str()); std::map < string, int > mapUniqueParentList; @@ -3564,7 +3564,7 @@ namespace Game { } - printf("----- END duplicate files [" MG_SIZE_T_SPECIFIER + printf("----- END duplicate files [" SIZE_T_SPECIFIER "] first file is [%s]\n", fileList.size(), fileList[0].c_str()); } @@ -4956,7 +4956,7 @@ namespace Game { } } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); } if (compress_item == "tilesets" || compress_item == "all") { typesSelected++; @@ -5034,7 +5034,7 @@ namespace Game { } } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); } if (typesSelected == 0) { @@ -5365,7 +5365,7 @@ namespace Game { printf("%s\n", mapName.c_str()); } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", maps.size()); + SIZE_T_SPECIFIER "\n", maps.size()); return_value = 0; } @@ -5446,7 +5446,7 @@ namespace Game { name2 = results2[k]; printf("--> %s\n", name2.c_str()); } - printf("--> Total Factions: " MG_SIZE_T_SPECIFIER "\n", + printf("--> Total Factions: " SIZE_T_SPECIFIER "\n", results2.size()); break; } @@ -5455,7 +5455,7 @@ namespace Game { } printf ("===========================================\nTotal Techtrees: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); return_value = 0; } @@ -5516,7 +5516,7 @@ namespace Game { printf("%s\n", name.c_str()); } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); return_value = 0; } @@ -5601,7 +5601,7 @@ namespace Game { } } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); return_value = 0; } @@ -5687,7 +5687,7 @@ namespace Game { } } printf("===========================================\nTotal: " - MG_SIZE_T_SPECIFIER "\n", results.size()); + SIZE_T_SPECIFIER "\n", results.size()); return_value = 0; } @@ -5723,7 +5723,7 @@ namespace Game { PlatformExceptionHandler::application_binary = executable_path(argv[0], true); - mg_app_name = GameConstants::application_name; + appNameString = GameConstants::application_name; mailStringSupport = mailString; SystemFlags::ENABLE_THREADED_LOGGING = false; disableBacktrace = false; @@ -5912,7 +5912,7 @@ namespace Game { (::Shared::PlatformByteOrder::isBigEndian() == true ? "big" : "little")); - // printf("\n\nData type sizes int8 = " MG_SIZE_T_SPECIFIER " int16 = " MG_SIZE_T_SPECIFIER " int32 = " MG_SIZE_T_SPECIFIER " int64 = " MG_SIZE_T_SPECIFIER "\n\n",sizeof(int8),sizeof(int16),sizeof(int32),sizeof(int64)); + // printf("\n\nData type sizes int8 = " SIZE_T_SPECIFIER " int16 = " SIZE_T_SPECIFIER " int32 = " SIZE_T_SPECIFIER " int64 = " SIZE_T_SPECIFIER "\n\n",sizeof(int8),sizeof(int16),sizeof(int32),sizeof(int64)); // // Config::getInstance().setBool("DebugNetworkPackets",true,true); // NetworkMessageIntro data(424336, "mg_version_x","player_x", 3, nmgstOk,444444, 555555, "english"); @@ -5983,8 +5983,8 @@ namespace Game { testVar = ::Shared::PlatformByteOrder::fromCommonEndian(testVar); printf("\nEndian from common value = %d", testVar); - printf("\nint8 sizeof = " MG_SIZE_T_SPECIFIER "", sizeof(int8)); - printf("\nSwitchSetupRequest sizeof = " MG_SIZE_T_SPECIFIER "", + printf("\nint8 sizeof = " SIZE_T_SPECIFIER "", sizeof(int8)); + printf("\nSwitchSetupRequest sizeof = " SIZE_T_SPECIFIER "", SwitchSetupRequest().getDataSize()); } @@ -6295,7 +6295,7 @@ namespace Game { (Socket::getBroadCastPort ()).c_str())); - Socket::disableNagle = config.getBool("DisableNagle", "false"); + Socket::disableNagle = config.getBool("DisableNagle", "true"); if (Socket::disableNagle) { printf ("*WARNING users wants to disable the socket nagle algorithm.\n"); @@ -7386,7 +7386,7 @@ namespace Game { "true")); gameSettings->setNetworkFramePeriod(config.getInt ("NetworkSendFrameCount", - "20")); + "10")); program->initServer(mainWindow, gameSettings); gameInitialized = true; @@ -7641,7 +7641,7 @@ namespace Game { renderer.reset2d(); snprintf(szTextBuf, 8096, "Please wait, converting models [%u of " - MG_SIZE_T_SPECIFIER "] ...", i, models.size()); + SIZE_T_SPECIFIER "] ...", i, models.size()); if (CoreData::getInstance().getMenuFontBig3D() != NULL) { renderer.renderText3D(szTextBuf, @@ -7664,7 +7664,7 @@ namespace Game { SDL_PumpEvents(); try { - printf("About to load model [%s] [%u of " MG_SIZE_T_SPECIFIER + printf("About to load model [%s] [%u of " SIZE_T_SPECIFIER "]\n", file.c_str(), i, models.size()); Model * model = renderer.newModel(rsGlobal, file); diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index dbd746397..50ae9f242 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -615,7 +615,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -634,7 +634,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -671,7 +671,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -709,7 +709,7 @@ namespace Game { #endif if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " updateCount: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), @@ -738,7 +738,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " updateCount: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), @@ -793,7 +793,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " updateCount: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), @@ -826,7 +826,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " updateCount: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), @@ -860,7 +860,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -881,7 +881,7 @@ namespace Game { if (showPerfStats) { sprintf(perfBuf, - "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", + "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); @@ -1526,7 +1526,7 @@ namespace Game { // window->initGl(config.getInt("ColorBits"), // config.getInt("DepthBits"), // config.getInt("StencilBits"), - // config.getBool("HardwareAcceleration","false"), + // config.getBool("HardwareAcceleration","true"), // config.getBool("FullScreenAntiAliasing","false"), // config.getFloat("GammaValue","0.0")); // window->setText(config.getString("WindowTitle","ZetaGlest")); diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index b4a5d47c7..68ed6c6c3 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -2357,7 +2357,7 @@ namespace Game { ((long int) time(NULL), broadcastServerSettingsDelayTimer) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS))) { - //printf("In [%s:%s] Line: %d forceNow = %d broadcastServerSettingsDelayTimer = " MG_SIZE_T_SPECIFIER ", now =" MG_SIZE_T_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,forceNow,broadcastServerSettingsDelayTimer,time(NULL)); + //printf("In [%s:%s] Line: %d forceNow = %d broadcastServerSettingsDelayTimer = " SIZE_T_SPECIFIER ", now =" SIZE_T_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,forceNow,broadcastServerSettingsDelayTimer,time(NULL)); needToBroadcastServerSettings = false; broadcastServerSettingsDelayTimer = time(NULL); @@ -2945,7 +2945,7 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " - MG_SIZE_T_SPECIFIER ", getCurrentMapFile() [%s]\n", + SIZE_T_SPECIFIER ", getCurrentMapFile() [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, listBoxMap.getSelectedItemIndex(), mapFiles.size(), getCurrentMapFile().c_str()); @@ -3269,7 +3269,7 @@ namespace Game { ("ServerControlledAI", "true")); gameSettings-> - setNetworkFramePeriod(config.getInt("NetworkSendFrameCount", "20")); + setNetworkFramePeriod(config.getInt("NetworkSendFrameCount", "10")); if (hasNetworkGameSettings() == true) { if (gameSettings->getTileset() != "") { @@ -7946,9 +7946,9 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER ", mapInfo.players = %d, formattedPlayerSortedMaps[mapInfo.players].size() = " - MG_SIZE_T_SPECIFIER ", scenarioInfo.mapName [%s]\n", + SIZE_T_SPECIFIER ", scenarioInfo.mapName [%s]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, listBoxMap.getSelectedItemIndex(), mapFiles.size(), mapInfo.players, diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index e17a34a2d..eaae8d673 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -924,7 +924,7 @@ namespace Game { listBoxControls[i].setSelectedItemIndex(ctNetwork); } } else { - listBoxControls[1].setSelectedItemIndex(ctCpu); + listBoxControls[1].setSelectedItemIndex(ctCpuZeta); } updateControllers(); updateNetworkSlots(); @@ -4491,7 +4491,7 @@ namespace Game { ("ServerControlledAI", "true")); gameSettings-> - setNetworkFramePeriod(config.getInt("NetworkSendFrameCount", "20")); + setNetworkFramePeriod(config.getInt("NetworkSendFrameCount", "10")); gameSettings->setNetworkPauseGameForLaggedClients(((checkBoxNetworkPauseGameForLaggedClients.getValue() == true))); if (gameSettings->getTileset() != "") { @@ -4662,7 +4662,7 @@ namespace Game { labelGameName.setText(createGameName (serverInterface-> getSlot(i, true)->getName())); - //printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); + //printf("slot = %d, admin key [%d] slot connected time[" SIZE_T_SPECIFIER "] clientConnectedTime [" SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); } if (serverInterface->getSlot(i, true)->getSessionKey() == gameSettings->getMasterserver_admin()) { @@ -4705,7 +4705,7 @@ namespace Game { labelGameName.setText(createGameName (serverInterface-> getSlot(i, true)->getName())); - //printf("slot = %d, admin key [%d] slot connected time[" MG_SIZE_T_SPECIFIER "] clientConnectedTime [" MG_SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); + //printf("slot = %d, admin key [%d] slot connected time[" SIZE_T_SPECIFIER "] clientConnectedTime [" SIZE_T_SPECIFIER "]\n",i,gameSettings->getMasterserver_admin(),serverInterface->getSlot(i)->getConnectedTime(),clientConnectedTime); } if (serverInterface->getSlot(i, true)->getSessionKey() == gameSettings->getMasterserver_admin()) { diff --git a/source/glest_game/menu/menu_state_custom_game_update.cpp b/source/glest_game/menu/menu_state_custom_game_update.cpp index 67d8ccaa7..40f7d7172 100644 --- a/source/glest_game/menu/menu_state_custom_game_update.cpp +++ b/source/glest_game/menu/menu_state_custom_game_update.cpp @@ -1004,7 +1004,7 @@ namespace Game { } // Revert network to CPU - listBoxControls[i].setSelectedItemIndex(ctCpu); + listBoxControls[i].setSelectedItemIndex(ctCpuZeta); } } slot = serverInterface->getSlot(i, true); diff --git a/source/glest_game/menu/menu_state_keysetup.cpp b/source/glest_game/menu/menu_state_keysetup.cpp index ac3902702..9975257e8 100644 --- a/source/glest_game/menu/menu_state_keysetup.cpp +++ b/source/glest_game/menu/menu_state_keysetup.cpp @@ -442,13 +442,13 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] save file [%s] userProperties.size() = " - MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, + SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, userKeysFile.c_str(), userProperties.size()); if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem). enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] save file [%s] userProperties.size() = " - MG_SIZE_T_SPECIFIER "\n", __FILE__, + SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, userKeysFile.c_str(), userProperties.size()); diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index a648009a9..843f2d900 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -1352,7 +1352,7 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED) printf("--------------> server [%s] serverEntities.size() = " - MG_SIZE_T_SPECIFIER " MIN_FIELDS_EXPECTED = %d\n", + SIZE_T_SPECIFIER " MIN_FIELDS_EXPECTED = %d\n", server.c_str(), serverEntities.size(), MIN_FIELDS_EXPECTED); diff --git a/source/glest_game/menu/menu_state_options.cpp b/source/glest_game/menu/menu_state_options.cpp index ac8c080cf..5f3b6272e 100644 --- a/source/glest_game/menu/menu_state_options.cpp +++ b/source/glest_game/menu/menu_state_options.cpp @@ -946,8 +946,8 @@ namespace Game { vector < string > languageFileMappings; Tokenize(txnURLFileListMapping, languageFileMappings, "|"); - printf("URL5 file count = " MG_SIZE_T_SPECIFIER ", " - MG_SIZE_T_SPECIFIER " [%s]\n", languageFiles.size(), + printf("URL5 file count = " SIZE_T_SPECIFIER ", " + SIZE_T_SPECIFIER " [%s]\n", languageFiles.size(), languageFileMappings.size(), (languageFiles.empty() == false ? languageFiles[0].c_str() : "")); diff --git a/source/glest_game/network/network_protocol.cpp b/source/glest_game/network/network_protocol.cpp index 110e181d0..1fa136aa3 100644 --- a/source/glest_game/network/network_protocol.cpp +++ b/source/glest_game/network/network_protocol.cpp @@ -211,7 +211,7 @@ namespace Game { i = i2; } else { i = -1 - (int64) (0xffffffffffffffffull - i2); - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("IN [%s] [%d] [%d] [%d] [%d] [%d] [%d] [%d] [%d] [" MG_I64_SPECIFIER "] [" MG_I64U_SPECIFIER "]\n", __FUNCTION__, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], i, i2); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("IN [%s] [%d] [%d] [%d] [%d] [%d] [%d] [%d] [%d] [" I64_SPECIFIER "] [" I64U_SPECIFIER "]\n", __FUNCTION__, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], i, i2); } return i; @@ -336,8 +336,8 @@ namespace Game { packi64(buf, q); buf += 8; - //if(SystemFlags::VERBOSE_MODE_ENABLED) printf("pack int64 = " MG_I64_SPECIFIER " [%X] q = " MG_I64_SPECIFIER " [%lX] buf pos = %lu\n",(int64)*(buf-8),*(buf-8),q,q,(unsigned long)(buf - bufStart)); - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("pack int64 = " MG_I64_SPECIFIER " [%X] q = " MG_I64_SPECIFIER " buf pos = %lu\n", (int64)*(buf - 8), *(buf - 8), q, (unsigned long) (buf - bufStart)); + //if(SystemFlags::VERBOSE_MODE_ENABLED) printf("pack int64 = " I64_SPECIFIER " [%X] q = " I64_SPECIFIER " [%lX] buf pos = %lu\n",(int64)*(buf-8),*(buf-8),q,q,(unsigned long)(buf - bufStart)); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("pack int64 = " I64_SPECIFIER " [%X] q = " I64_SPECIFIER " buf pos = %lu\n", (int64)*(buf - 8), *(buf - 8), q, (unsigned long) (buf - bufStart)); break; case 'Q': // 64-bit unsigned @@ -346,7 +346,7 @@ namespace Game { packi64(buf, Q); buf += 8; - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("pack uint64 = " MG_I64U_SPECIFIER " [%X] Q = " MG_I64U_SPECIFIER " buf pos = %lu\n", (uint64)*(buf - 8), *(buf - 8), Q, (unsigned long) (buf - bufStart)); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("pack uint64 = " I64U_SPECIFIER " [%X] Q = " I64U_SPECIFIER " buf pos = %lu\n", (uint64)*(buf - 8), *(buf - 8), Q, (unsigned long) (buf - bufStart)); break; case 'f': // float-16 @@ -512,7 +512,7 @@ namespace Game { buf += 8; size += 8; - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("unpack int64 = " MG_I64_SPECIFIER " [%X] q = " MG_I64_SPECIFIER " buf pos = %lu\n", (int64)*(buf - 8), *(buf - 8), *q, (unsigned long) (buf - bufStart)); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("unpack int64 = " I64_SPECIFIER " [%X] q = " I64_SPECIFIER " buf pos = %lu\n", (int64)*(buf - 8), *(buf - 8), *q, (unsigned long) (buf - bufStart)); break; case 'Q': // 64-bit unsigned @@ -521,7 +521,7 @@ namespace Game { buf += 8; size += 8; - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("unpack uint64 = " MG_I64U_SPECIFIER " [%X] Q = " MG_I64U_SPECIFIER " buf pos = %lu\n", (uint64)*(buf - 8), *(buf - 8), *Q, (unsigned long) (buf - bufStart)); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("unpack uint64 = " I64U_SPECIFIER " [%X] Q = " I64U_SPECIFIER " buf pos = %lu\n", (uint64)*(buf - 8), *(buf - 8), *Q, (unsigned long) (buf - bufStart)); break; case 'f': // float diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index 7d678387c..1396e3746 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -1729,7 +1729,7 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "[addResourceTargetToCache] pos [%s]cacheResourceTargetList.size() [" - MG_SIZE_T_SPECIFIER "]", pos.getString().c_str(), + SIZE_T_SPECIFIER "]", pos.getString().c_str(), cacheResourceTargetList.size()); //unit->logSynchData(szBuf); @@ -1765,7 +1765,7 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "[removeResourceTargetFromCache] pos [%s]cacheResourceTargetList.size() [" - MG_SIZE_T_SPECIFIER "]", pos.getString().c_str(), + SIZE_T_SPECIFIER "]", pos.getString().c_str(), cacheResourceTargetList.size()); //unit->logSynchData(szBuf); @@ -1829,7 +1829,7 @@ namespace Game { true) { char szBuf[8096] = ""; snprintf(szBuf, 8096, - "cacheResourceTargetList.size() [" MG_SIZE_T_SPECIFIER + "cacheResourceTargetList.size() [" SIZE_T_SPECIFIER "]", cacheResourceTargetList.size()); if (frameIndex < 0) { @@ -1965,9 +1965,9 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "[cleaning old resource targets] deleteList.size() [" - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER "] cacheResourceTargetList.size() [" - MG_SIZE_T_SPECIFIER "] result [%s]", + SIZE_T_SPECIFIER "] result [%s]", deleteList.size(), cacheResourceTargetList.size(), result.getString().c_str()); @@ -2149,9 +2149,9 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "[cleaning old resource targets] deleteList.size() [" - MG_SIZE_T_SPECIFIER + SIZE_T_SPECIFIER "] cacheResourceTargetList.size() [" - MG_SIZE_T_SPECIFIER "], needToCleanup [%d]", + SIZE_T_SPECIFIER "], needToCleanup [%d]", deleteList.size(), cacheResourceTargetList.size(), needToCleanup); //unit->logSynchData(szBuf); diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 392f35fe5..abc09fca8 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -2752,8 +2752,8 @@ namespace Game { if (progress > PROGRESS_SPEED_MULTIPLIER) { char szBuf[8096] = ""; snprintf(szBuf, 8096, - "In [%s::%s Line: %d] ERROR: progress > " MG_I64_SPECIFIER - ", progress = [" MG_I64_SPECIFIER "]\n", + "In [%s::%s Line: %d] ERROR: progress > " I64_SPECIFIER + ", progress = [" I64_SPECIFIER "]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, PROGRESS_SPEED_MULTIPLIER, progress); @@ -2900,12 +2900,12 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8095, - "currentProgress = " MG_I64_SPECIFIER " updateFPS = " - MG_I64_SPECIFIER " speed = " MG_I64_SPECIFIER - " diagonalFactor = " MG_I64_SPECIFIER " heightFactor = " - MG_I64_SPECIFIER " speedDenominator = " MG_I64_SPECIFIER - " progressIncrease = " MG_I64_SPECIFIER " [" - MG_I64_SPECIFIER + "currentProgress = " I64_SPECIFIER " updateFPS = " + I64_SPECIFIER " speed = " I64_SPECIFIER + " diagonalFactor = " I64_SPECIFIER " heightFactor = " + I64_SPECIFIER " speedDenominator = " I64_SPECIFIER + " progressIncrease = " I64_SPECIFIER " [" + I64_SPECIFIER "] height [%f] airHeight [%f] cellUnitHeight [%d] cellObjectHeight [%d] skill [%s] pos [%s] lastpos [%s]", currentProgress, updateFPS, speed, diagonalFactor, heightFactor, speedDenominator, progressIncrease, @@ -2923,7 +2923,7 @@ namespace Game { newProgress += progressIncrease; // if(currSkill->getClass() == scMove || (currSkill->getClass() == scStop && this->loadCount > 0)) { - // printf("speedDenominator: " MG_I64_SPECIFIER " currentProgress: " MG_I64_SPECIFIER " speed: " MG_I64_SPECIFIER " diagonalFactor: " MG_I64_SPECIFIER " heightFactor: " MG_I64_SPECIFIER " progressIncrease: " MG_I64_SPECIFIER " newProgress: " MG_I64_SPECIFIER " TOP #: " MG_I64_SPECIFIER "\n",speedDenominator,currentProgress,speed,diagonalFactor,heightFactor,progressIncrease,newProgress,(speed * diagonalFactor * heightFactor)); + // printf("speedDenominator: " I64_SPECIFIER " currentProgress: " I64_SPECIFIER " speed: " I64_SPECIFIER " diagonalFactor: " I64_SPECIFIER " heightFactor: " I64_SPECIFIER " progressIncrease: " I64_SPECIFIER " newProgress: " I64_SPECIFIER " TOP #: " I64_SPECIFIER "\n",speedDenominator,currentProgress,speed,diagonalFactor,heightFactor,progressIncrease,newProgress,(speed * diagonalFactor * heightFactor)); // } return newProgress; @@ -2934,7 +2934,7 @@ namespace Game { if (debugBoost) printf ("===================== START Unit [%d - %s] skill: %s affected unit size: " - MG_SIZE_T_SPECIFIER "\n", this->id, + SIZE_T_SPECIFIER "\n", this->id, this->getType()->getName(false).c_str(), currSkill->getBoostDesc(false).c_str(), currentAttackBoostOriginatorEffect. @@ -2980,7 +2980,7 @@ namespace Game { } if (debugBoost) - printf("Line: %d affected unit size: " MG_SIZE_T_SPECIFIER "\n", + printf("Line: %d affected unit size: " SIZE_T_SPECIFIER "\n", __LINE__, currentAttackBoostOriginatorEffect. currentAttackBoostUnits.size()); @@ -2989,7 +2989,7 @@ namespace Game { if (currSkill->isAttackBoostEnabled() == true) { if (debugBoost) - printf("Line: %d affected unit size: " MG_SIZE_T_SPECIFIER "\n", + printf("Line: %d affected unit size: " SIZE_T_SPECIFIER "\n", __LINE__, currentAttackBoostOriginatorEffect.currentAttackBoostUnits. size()); @@ -3004,7 +3004,7 @@ namespace Game { attackBoost->radius); if (debugBoost) - printf("Line: %d candidates unit size: " MG_SIZE_T_SPECIFIER + printf("Line: %d candidates unit size: " SIZE_T_SPECIFIER " attackBoost: %s\n", __LINE__, candidates.size(), attackBoost->getDesc(false).c_str()); for (unsigned int i = 0; i < candidates.size(); ++i) { @@ -3019,7 +3019,7 @@ namespace Game { } if (debugBoost) - printf("Line: %d affected unit size: " MG_SIZE_T_SPECIFIER "\n", + printf("Line: %d affected unit size: " SIZE_T_SPECIFIER "\n", __LINE__, currentAttackBoostOriginatorEffect.currentAttackBoostUnits. size()); @@ -3077,7 +3077,7 @@ namespace Game { } else { if (currSkill->isAttackBoostEnabled() == true) { if (debugBoost) - printf("Line: %d affected unit size: " MG_SIZE_T_SPECIFIER "\n", + printf("Line: %d affected unit size: " SIZE_T_SPECIFIER "\n", __LINE__, currentAttackBoostOriginatorEffect.currentAttackBoostUnits. size()); @@ -3094,7 +3094,7 @@ namespace Game { candidateValidIdList.reserve(candidates.size()); if (debugBoost) - printf("Line: %d candidates unit size: " MG_SIZE_T_SPECIFIER + printf("Line: %d candidates unit size: " SIZE_T_SPECIFIER " attackBoost: %s\n", __LINE__, candidates.size(), attackBoost->getDesc(false).c_str()); @@ -3178,7 +3178,7 @@ namespace Game { } if (debugBoost) - printf("Line: %d affected unit size: " MG_SIZE_T_SPECIFIER "\n", + printf("Line: %d affected unit size: " SIZE_T_SPECIFIER "\n", __LINE__, currentAttackBoostOriginatorEffect.currentAttackBoostUnits. size()); @@ -5528,7 +5528,7 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "FrameCount [%d] Unit = %d [%s][%s] pos = %s, lastPos = %s, targetPos = %s, targetVec = %s, meetingPos = %s, progress [" - MG_I64_SPECIFIER + I64_SPECIFIER "], progress2 [%d] random [%d]\nUnit Path [%s]\n", getFrameCount(), id, getFullName(false).c_str(), faction->getType()->getName(false).c_str(), @@ -5624,7 +5624,7 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "[cleaning old bad harvest targets] purgeList.size() [" - MG_SIZE_T_SPECIFIER "]", purgeList.size()); + SIZE_T_SPECIFIER "]", purgeList.size()); logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(), __LINE__, szBuf); @@ -7101,7 +7101,7 @@ namespace Game { //WaypointPath waypointPath; if (consoleDebug) - printf("#11 Unit: %d CRC: %u commands.size(): " MG_SIZE_T_SPECIFIER + printf("#11 Unit: %d CRC: %u commands.size(): " SIZE_T_SPECIFIER "\n", id, crcForUnit.getSum(), commands.size()); //Commands commands; @@ -7121,7 +7121,7 @@ namespace Game { if (consoleDebug) printf("#11 Unit: %d CRC: %u damageParticleSystems.size(): " - MG_SIZE_T_SPECIFIER "\n", id, crcForUnit.getSum(), + SIZE_T_SPECIFIER "\n", id, crcForUnit.getSum(), damageParticleSystems.size()); //vector unitParticleSystems; diff --git a/source/glest_game/types/faction_type.cpp b/source/glest_game/types/faction_type.cpp index 9479412d5..7c1615180 100644 --- a/source/glest_game/types/faction_type.cpp +++ b/source/glest_game/types/faction_type.cpp @@ -970,7 +970,7 @@ namespace Game { } if (foundUnit == false) { - //printf("Problem for unit [%s] unitTypes.size() = " MG_SIZE_T_SPECIFIER "\n",unitType.getName().c_str(),unitTypes.size()); + //printf("Problem for unit [%s] unitTypes.size() = " SIZE_T_SPECIFIER "\n",unitType.getName().c_str(),unitTypes.size()); char szBuf[8096] = ""; snprintf(szBuf, 8096, @@ -1199,7 +1199,7 @@ namespace Game { } } - printf("In [%s::%s Line: %d] scanning [%s] size = " MG_SIZE_T_SPECIFIER + printf("In [%s::%s Line: %d] scanning [%s] size = " SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, name.c_str(), unitTypes.size()); for (int i = 0; i < (int) unitTypes.size(); i++) { @@ -1239,7 +1239,7 @@ namespace Game { // } // } // - // printf("In [%s::%s Line: %d] scanning [%d] size = " MG_SIZE_T_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,id,unitTypes.size()); + // printf("In [%s::%s Line: %d] scanning [%d] size = " SIZE_T_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,id,unitTypes.size()); // for(int i=0; i < (int)unitTypes.size();i++){ // printf("In [%s::%s Line: %d] scanning [%s] idx = %d [%s][%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,name.c_str(),i,unitTypes[i].getName(false).c_str(),unitTypes[i].getId()); // } @@ -1259,7 +1259,7 @@ namespace Game { } } - printf("In [%s::%s Line: %d] scanning [%s] size = " MG_SIZE_T_SPECIFIER + printf("In [%s::%s Line: %d] scanning [%s] size = " SIZE_T_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, name.c_str(), unitTypes.size()); for (int i = 0; i < (int) upgradeTypes.size(); i++) { diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index baa7e266d..ee646d260 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -1546,7 +1546,7 @@ namespace Game { char szBuf[8096] = ""; snprintf(szBuf, 8096, "In [%s::%s Line: %d] i >= commandTypes.size(), i = %d, commandTypes.size() = " - MG_SIZE_T_SPECIFIER "", + SIZE_T_SPECIFIER "", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, i, commandTypes.size()); throw game_runtime_error(szBuf); diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 08685c137..e6cce2848 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -470,7 +470,7 @@ namespace Game { readBytes = fread(&x, sizeof(int32), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } x = ::Shared::PlatformByteOrder::fromCommonEndian(x); @@ -478,7 +478,7 @@ namespace Game { readBytes = fread(&y, sizeof(int32), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } y = ::Shared::PlatformByteOrder::fromCommonEndian(y); @@ -497,7 +497,7 @@ namespace Game { readBytes = fread(&alt, sizeof(float32), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } alt = ::Shared::PlatformByteOrder::fromCommonEndian(alt); @@ -514,7 +514,7 @@ namespace Game { readBytes = fread(&surf, sizeof(int8), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } surf = ::Shared::PlatformByteOrder::fromCommonEndian(surf); @@ -531,7 +531,7 @@ namespace Game { readBytes = fread(&objNumber, sizeof(int8), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } objNumber = ::Shared::PlatformByteOrder::fromCommonEndian(objNumber); diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index cbaa66d35..8aec075de 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -618,7 +618,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -633,7 +633,7 @@ namespace Game { if (SystemFlags::VERBOSE_MODE_ENABLED && chrono.getMillis() >= 10) printf("In [%s::%s Line: %d] *** Faction thread preprocessing took [%lld] msecs for %d factions for frameCount = %d slavesCompleted = %d.\n", __FILE__, __FUNCTION__, __LINE__, (long long int)chrono.getMillis(), factionCount, frameCount, slavesCompleted); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -645,7 +645,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -672,7 +672,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -680,7 +680,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -735,8 +735,8 @@ namespace Game { totalUnitsChecked++; if (showPerfStats && chronoPerfUnit.getMillis() >= 10) { - //sprintf(perfBuf,"In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER " stuck: %d [%d] for unit:\n%sBEFORE unitBlockCount = %d, AFTER = %d, BEFORE lastStuckFrame = %u, AFTER: %u\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chronoPerfUnit.getMillis(),isStuck,isStuckWithinTolerance,unit->toString().c_str(),unitBlockCount,unit->getPath()->getBlockCount(),lastStuckFrame,unit->getLastStuckFrame()); - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER " stuck: %d for unit:\n%sBEFORE unitBlockCount = %d, AFTER = %d, BEFORE , AFTER: %u\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerfUnit.getMillis(), isStuck, unit->toString().c_str(), unitBlockCount, unit->getPath()->getBlockCount(), unit->getLastStuckFrame()); + //sprintf(perfBuf,"In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " stuck: %d [%d] for unit:\n%sBEFORE unitBlockCount = %d, AFTER = %d, BEFORE lastStuckFrame = %u, AFTER: %u\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chronoPerfUnit.getMillis(),isStuck,isStuckWithinTolerance,unit->toString().c_str(),unitBlockCount,unit->getPath()->getBlockCount(),lastStuckFrame,unit->getLastStuckFrame()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " stuck: %d for unit:\n%sBEFORE unitBlockCount = %d, AFTER = %d, BEFORE , AFTER: %u\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerfUnit.getMillis(), isStuck, unit->toString().c_str(), unitBlockCount, unit->getPath()->getBlockCount(), unit->getLastStuckFrame()); perfList.push_back(perfBuf); } @@ -744,7 +744,7 @@ namespace Game { totalUnitsProcessed += unitCountUpdated; if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER " faction: %d / %d unitCount = %d unitCountUpdated = %d unitCountStuck = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), i + 1, factionCount, unitCount, unitCountUpdated, unitCountStuck); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " faction: %d / %d unitCount = %d unitCountUpdated = %d unitCountStuck = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), i + 1, factionCount, unitCount, unitCountUpdated, unitCountStuck); perfList.push_back(perfBuf); for (std::map::iterator iterMap = mapCommandCount.begin(); @@ -764,7 +764,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER " totalUnitsProcessed = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), totalUnitsProcessed); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " totalUnitsProcessed = %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), totalUnitsProcessed); perfList.push_back(perfBuf); } @@ -849,7 +849,7 @@ namespace Game { if (scriptManager) scriptManager->onDayNightTriggerEvent(); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -859,7 +859,7 @@ namespace Game { attackEffects.update(0.25f); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -872,7 +872,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("updateAllTilesetObjects", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -885,7 +885,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("updateAllFactionUnits", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -897,7 +897,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("underTakeDeadFactionUnits", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -911,7 +911,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("updateAllFactionConsumableCosts", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -927,7 +927,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -936,7 +936,7 @@ namespace Game { bool needToTick = canTickWorld(); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -952,7 +952,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } } @@ -979,7 +979,7 @@ namespace Game { if (showPerfStats) chronoPerf.start(); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -991,7 +991,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("world->computeFow", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER " fogOfWar: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), fogOfWar); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER " fogOfWar: %d\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis(), fogOfWar); perfList.push_back(perfBuf); } @@ -1004,7 +1004,7 @@ namespace Game { } if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -1028,7 +1028,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("world unit->tick()", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } @@ -1079,7 +1079,7 @@ namespace Game { if (this->game) this->game->addPerformanceCount("world faction->setResourceBalance()", chronoGamePerformanceCounts.getMillis()); if (showPerfStats) { - sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); + sprintf(perfBuf, "In [%s::%s] Line: %d took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chronoPerf.getMillis()); perfList.push_back(perfBuf); } diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 495f421e3..748d014c6 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -1645,7 +1645,6 @@ wxT("Help")).ShowModal(); if (argc == 2) { if (argv[1][0] == '-') { // any flag gives help and exits program. std::cout << std::endl << "ZetaGlest Map Editor " << MapEditorVersionString << " [Using " << (const char *) wxConvCurrent->cWX2MB(wxVERSION_STRING) << "]" << std::endl << std::endl; - //std::cout << "\nglest_map_editor [MGM FILE]" << std::endl << std::endl; std::cout << "Creates or edits zetaglest/glest maps. [.zgm/.mgm/.gbm]" << std::endl << std::endl; std::cout << "Draw with left mouse button." << std::endl; std::cout << "Move map with right mouse button." << std::endl; diff --git a/source/shared_lib/include/platform/common/platform_common.h b/source/shared_lib/include/platform/common/platform_common.h index 12f69993a..f9f693ab6 100644 --- a/source/shared_lib/include/platform/common/platform_common.h +++ b/source/shared_lib/include/platform/common/platform_common.h @@ -274,7 +274,7 @@ namespace Shared { inline string trim_at_delim(const string & s, const string &t) { string d(s); string::size_type i(d.find(t)); - //printf("Searching for [%s] in [%s] got " MG_SIZE_T_SPECIFIER "\n",t.c_str(),d.c_str(),i); + //printf("Searching for [%s] in [%s] got " SIZE_T_SPECIFIER "\n",t.c_str(),d.c_str(),i); if (i == string::npos) { return d; diff --git a/source/shared_lib/include/platform/posix/socket.h b/source/shared_lib/include/platform/posix/socket.h index 5bea614d4..1c594f8c8 100644 --- a/source/shared_lib/include/platform/posix/socket.h +++ b/source/shared_lib/include/platform/posix/socket.h @@ -30,7 +30,7 @@ typedef SOCKET PLATFORM_SOCKET; #if defined(_WIN64) -#define PLATFORM_SOCKET_FORMAT_TYPE MG_I64U_SPECIFIER +#define PLATFORM_SOCKET_FORMAT_TYPE I64U_SPECIFIER #else #define PLATFORM_SOCKET_FORMAT_TYPE "%d" #endif diff --git a/source/shared_lib/include/platform/sdl/data_types.h b/source/shared_lib/include/platform/sdl/data_types.h index 8b680b6da..e63053d9e 100644 --- a/source/shared_lib/include/platform/sdl/data_types.h +++ b/source/shared_lib/include/platform/sdl/data_types.h @@ -37,32 +37,32 @@ #endif #if defined(_MSC_VER) - #define MG_SIZE_T_SPECIFIER "%Iu" - #define MG_SSIZE_T_SPECIFIER "%Id" - #define MG_PTRDIFF_T_SPECIFIER "%Id" - #define MG_I64_SPECIFIER "%I64d" - #define MG_I64U_SPECIFIER "%I64u" + #define SIZE_T_SPECIFIER "%Iu" + #define SSIZE_T_SPECIFIER "%Id" + #define PTRDIFF_T_SPECIFIER "%Id" + #define I64_SPECIFIER "%I64d" + #define I64U_SPECIFIER "%I64u" #elif defined(__GNUC__) - #define MG_SIZE_T_SPECIFIER "%zu" - #define MG_SSIZE_T_SPECIFIER "%zd" - #define MG_PTRDIFF_T_SPECIFIER "%zd" - #define MG_I64_SPECIFIER "%" PRId64"" - #define MG_I64U_SPECIFIER "%" PRIu64"" + #define SIZE_T_SPECIFIER "%zu" + #define SSIZE_T_SPECIFIER "%zd" + #define PTRDIFF_T_SPECIFIER "%zd" + #define I64_SPECIFIER "%" PRId64"" + #define I64U_SPECIFIER "%" PRIu64"" #else #if NUMBITS == 32 - #define MG_SIZE_T_SPECIFIER "%lu" - #define MG_SSIZE_T_SPECIFIER "%ld" - #define MG_PTRDIFF_T_SPECIFIER "%ld" - #define MG_I64_SPECIFIER "%lld" - #define MG_I64U_SPECIFIER "%llu" + #define SIZE_T_SPECIFIER "%lu" + #define SSIZE_T_SPECIFIER "%ld" + #define PTRDIFF_T_SPECIFIER "%ld" + #define I64_SPECIFIER "%lld" + #define I64U_SPECIFIER "%llu" #else - #define MG_SIZE_T_SPECIFIER "%llu" - #define MG_SSIZE_T_SPECIFIER "%lld" - #define MG_PTRDIFF_T_SPECIFIER "%lld" - #define MG_I64_SPECIFIER "%lld" - #define MG_I64U_SPECIFIER "%llu" + #define SIZE_T_SPECIFIER "%llu" + #define SSIZE_T_SPECIFIER "%lld" + #define PTRDIFF_T_SPECIFIER "%lld" + #define I64_SPECIFIER "%lld" + #define I64U_SPECIFIER "%llu" #endif #endif diff --git a/source/shared_lib/include/util/leak_dumper.h b/source/shared_lib/include/util/leak_dumper.h index f5659d7b5..b86286d29 100644 --- a/source/shared_lib/include/util/leak_dumper.h +++ b/source/shared_lib/include/util/leak_dumper.h @@ -326,7 +326,7 @@ public: //if(info.line == 0) return; MutexSafeWrapper safeMutexMasterList(mutex); - //printf("ALLOCATE.\tfile: %s, line: %d, bytes: " MG_SIZE_T_SPECIFIER ", array: %d inuse: %d\n", info.file, info.line, info.bytes, info.array, info.inuse); + //printf("ALLOCATE.\tfile: %s, line: %d, bytes: " SIZE_T_SPECIFIER ", array: %d inuse: %d\n", info.file, info.line, info.bytes, info.array, info.inuse); if (info.line > 0) { ++allocCount; @@ -341,7 +341,7 @@ public: } } - printf("ALLOCATE NOT MONITORED.\tfile: %s, line: %d, ptr [%p], bytes: " MG_SIZE_T_SPECIFIER ", array: %d inuse: %d, \n%s\n", info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); + printf("ALLOCATE NOT MONITORED.\tfile: %s, line: %d, ptr [%p], bytes: " SIZE_T_SPECIFIER ", array: %d inuse: %d, \n%s\n", info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); ++nonMonitoredCount; nonMonitoredBytes += info.bytes; diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index 6507ab7cf..1808ef146 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -421,7 +421,7 @@ namespace Shared { size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV2), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianMeshHeaderV2(meshHeader); @@ -501,7 +501,7 @@ namespace Shared { readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(vertices, frameCount*vertexCount); @@ -509,7 +509,7 @@ namespace Shared { readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(normals, frameCount*vertexCount); @@ -518,7 +518,7 @@ namespace Shared { readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if (readBytes != 1 && vertexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(texCoords, vertexCount); @@ -526,7 +526,7 @@ namespace Shared { readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(&diffuseColor, 1); @@ -534,7 +534,7 @@ namespace Shared { readBytes = fread(&opacity, sizeof(float32), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } opacity = Shared::PlatformByteOrder::fromCommonEndian(opacity); @@ -548,7 +548,7 @@ namespace Shared { readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if (readBytes != 1 && indexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); throw game_runtime_error(szBuf); } Shared::PlatformByteOrder::fromEndianTypeArray(indices, indexCount); @@ -565,7 +565,7 @@ namespace Shared { size_t readBytes = fread(&meshHeader, sizeof(MeshHeaderV3), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianMeshHeaderV3(meshHeader); @@ -642,7 +642,7 @@ namespace Shared { readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(vertices, frameCount*vertexCount); @@ -650,7 +650,7 @@ namespace Shared { readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(normals, frameCount*vertexCount); @@ -660,7 +660,7 @@ namespace Shared { readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if (readBytes != 1 && vertexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(texCoords, vertexCount); @@ -669,7 +669,7 @@ namespace Shared { readBytes = fread(&diffuseColor, sizeof(Vec3f), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(&diffuseColor, 1); @@ -677,7 +677,7 @@ namespace Shared { readBytes = fread(&opacity, sizeof(float32), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } opacity = Shared::PlatformByteOrder::fromCommonEndian(opacity); @@ -692,7 +692,7 @@ namespace Shared { readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if (readBytes != 1 && indexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); throw game_runtime_error(szBuf); } Shared::PlatformByteOrder::fromEndianTypeArray(indices, indexCount); @@ -760,7 +760,7 @@ namespace Shared { size_t readBytes = fread(&meshHeader, sizeof(MeshHeader), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianMeshHeader(meshHeader); @@ -807,7 +807,7 @@ namespace Shared { cMapPath[mapPathSize] = 0; if (readBytes != 1 && mapPathSize != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, mapPathSize, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, mapPathSize, __LINE__); throw game_runtime_error(szBuf); } Shared::PlatformByteOrder::fromEndianTypeArray(cMapPath, mapPathSize); @@ -836,7 +836,7 @@ namespace Shared { readBytes = fread(vertices, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(vertices, frameCount*vertexCount); @@ -844,7 +844,7 @@ namespace Shared { readBytes = fread(normals, sizeof(Vec3f)*frameCount*vertexCount, 1, f); if (readBytes != 1 && (frameCount * vertexCount) != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(normals, frameCount*vertexCount); @@ -853,7 +853,7 @@ namespace Shared { readBytes = fread(texCoords, sizeof(Vec2f)*vertexCount, 1, f); if (readBytes != 1 && vertexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u][%u] on line: %d.", readBytes, frameCount, vertexCount, __LINE__); throw game_runtime_error(szBuf); } fromEndianVecArray(texCoords, vertexCount); @@ -861,7 +861,7 @@ namespace Shared { readBytes = fread(indices, sizeof(uint32)*indexCount, 1, f); if (readBytes != 1 && indexCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, indexCount, __LINE__); throw game_runtime_error(szBuf); } Shared::PlatformByteOrder::fromEndianTypeArray(indices, indexCount); @@ -1198,7 +1198,7 @@ namespace Shared { if (readBytes != 1) { fclose(f); char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianFileHeader(fileHeader); @@ -1224,7 +1224,7 @@ namespace Shared { readBytes = fread(&modelHeader, sizeof(ModelHeader), 1, f); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } fromEndianModelHeader(modelHeader); @@ -1257,7 +1257,7 @@ namespace Shared { readBytes = fread(&meshCount, sizeof(meshCount), 1, f); if (readBytes != 1 && meshCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, meshCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, meshCount, __LINE__); throw game_runtime_error(szBuf); } meshCount = Shared::PlatformByteOrder::fromCommonEndian(meshCount); @@ -1283,7 +1283,7 @@ namespace Shared { readBytes = fread(&meshCount, sizeof(meshCount), 1, f); if (readBytes != 1 && meshCount != 0) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, meshCount, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " [%u] on line: %d.", readBytes, meshCount, __LINE__); throw game_runtime_error(szBuf); } meshCount = Shared::PlatformByteOrder::fromCommonEndian(meshCount); @@ -2161,7 +2161,7 @@ namespace Shared { // now we check the screenshot if we find pixels in color of unit identity // to speedup we only check every "skipSteps" line and pixel in a row if we find such a color. - // this is exact enough for MG purpose + // this is exact enough for our purpose for (int hh = 0; hh < h && pickedModels.size() < rendererModels.size(); hh = hh + skipSteps) { for (int ww = 0; ww < w && pickedModels.size() < rendererModels.size(); ww = ww + skipSteps) { diff --git a/source/shared_lib/sources/graphics/pixmap.cpp b/source/shared_lib/sources/graphics/pixmap.cpp index 5b7ca7e7a..dffbaf3f7 100644 --- a/source/shared_lib/sources/graphics/pixmap.cpp +++ b/source/shared_lib/sources/graphics/pixmap.cpp @@ -133,7 +133,7 @@ namespace Shared { size_t readBytes = fread(&fileHeader, sizeof(TargaFileHeader), 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } static bool bigEndianSystem = Shared::PlatformByteOrder::isBigEndian(); @@ -192,7 +192,7 @@ namespace Shared { size_t readBytes = fread(&l, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -206,7 +206,7 @@ namespace Shared { size_t readBytes = fread(&b, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -216,7 +216,7 @@ namespace Shared { readBytes = fread(&g, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -226,7 +226,7 @@ namespace Shared { readBytes = fread(&r, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -237,7 +237,7 @@ namespace Shared { readBytes = fread(&a, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -373,7 +373,7 @@ namespace Shared { size_t readBytes = fread(&fileHeader, sizeof(BitmapFileHeader), 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } static bool bigEndianSystem = Shared::PlatformByteOrder::isBigEndian(); @@ -395,7 +395,7 @@ namespace Shared { readBytes = fread(&infoHeader, sizeof(BitmapInfoHeader), 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -432,7 +432,7 @@ namespace Shared { size_t readBytes = fread(&b, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -441,7 +441,7 @@ namespace Shared { readBytes = fread(&g, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -451,7 +451,7 @@ namespace Shared { readBytes = fread(&r, 1, 1, file); if (readBytes != 1) { char szBuf[8096] = ""; - snprintf(szBuf, 8096, "fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); + snprintf(szBuf, 8096, "fread returned wrong size = " SIZE_T_SPECIFIER " on line: %d.", readBytes, __LINE__); throw game_runtime_error(szBuf); } if (bigEndianSystem == true) { @@ -1055,7 +1055,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1068,7 +1068,7 @@ namespace Shared { std::size_t index = (w * y + x) * components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1080,7 +1080,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + component; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1091,7 +1091,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + component; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1105,7 +1105,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1120,7 +1120,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1133,7 +1133,7 @@ namespace Shared { std::size_t index = (w * y + x) * components; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } float result = pixels[index] / 255.f; @@ -1156,7 +1156,7 @@ namespace Shared { std::size_t index = (w * y + x) * components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1176,7 +1176,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } pixels[index] = static_cast(value[i] * 255.f); @@ -1188,7 +1188,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + component; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1200,7 +1200,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + component; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } @@ -1214,7 +1214,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } pixels[index] = static_cast(p.ptr()[i] * 255.f); @@ -1227,7 +1227,7 @@ namespace Shared { std::size_t index = (w*y + x)*components + i; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } pixels[index] = static_cast(p.ptr()[i] * 255.f); @@ -1239,7 +1239,7 @@ namespace Shared { std::size_t index = (w * y + x) * components; if (index >= getPixelByteCount()) { char szBuf[8096]; - snprintf(szBuf, 8096, "Invalid pixmap index: " MG_SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); + snprintf(szBuf, 8096, "Invalid pixmap index: " SIZE_T_SPECIFIER " for [%s], h = %d, w = %d, components = %d x = %d y = %d\n", index, path.c_str(), h, w, components, x, y); throw game_runtime_error(szBuf); } diff --git a/source/shared_lib/sources/graphics/video_player.cpp b/source/shared_lib/sources/graphics/video_player.cpp index 3b1d85103..c494789fd 100644 --- a/source/shared_lib/sources/graphics/video_player.cpp +++ b/source/shared_lib/sources/graphics/video_player.cpp @@ -612,7 +612,7 @@ namespace Shared { if (verboseEnabled) printf("In [%s] Line: %d, libvlc [%p]\n", __FUNCTION__, __LINE__, ctxPtr->libvlc); - /* It is meaningless to try all this because we have to restart mg to pickup new env vars + /* It is meaningless to try all this because we have to restart the game to pickup new env vars #if defined(WIN32) if(libvlc == NULL) { // For windows check registry for install path @@ -1168,7 +1168,7 @@ namespace Shared { if(verboseEnabled) printf("In [%s] Line: %d, libvlc [%p]\n",__FUNCTION__,__LINE__,libvlc); - // It is meaningless to try all this because we have to restart mg to pickup new env vars + // It is meaningless to try all this because we have to restart the game to pickup new env vars #if defined(WIN32) if(libvlc == NULL) { // For windows check registry for install path diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 4b14bec03..d0f1ffffc 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -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); diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index 6dc8587c3..430ebb5c6 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -118,9 +118,9 @@ namespace Shared { size_t result = fwrite(buffer, size, nmemb, out->stream); if (result != nmemb) { - if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " MG_SIZE_T_SPECIFIER ", result = " MG_SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); - if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " MG_SIZE_T_SPECIFIER ", result = " MG_SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); - SystemFlags::OutputDebug(SystemFlags::debugError, "===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " MG_SIZE_T_SPECIFIER ", result = " MG_SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); + if (SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " SIZE_T_SPECIFIER ", result = " SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); + if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " SIZE_T_SPECIFIER ", result = " SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); + SystemFlags::OutputDebug(SystemFlags::debugError, "===> FTP Client thread FAILED to write data chunk to file [%s] nmemb = " SIZE_T_SPECIFIER ", result = " SIZE_T_SPECIFIER "\n", fullFilePath.c_str(), nmemb, result); //return -1; /* failure, can't open file to write */ } return result; diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 22f078775..3a316e39d 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1236,11 +1236,11 @@ namespace Shared { if (size > 0) { break; } else if (hasDataToRead() == true) { - //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = " MG_SIZE_T_SPECIFIER ", loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); - if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = " MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, err, sock, size); + //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = " SIZE_T_SPECIFIER ", loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); + if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, (hasDataToRead() == true) err = %d, sock = %d, size = " SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, err, sock, size); } else { - //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = " MG_SIZE_T_SPECIFIER ", loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); - if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = " MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, err, sock, size); + //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = " SIZE_T_SPECIFIER ", loopCount = %d\n",__FILE__,__FUNCTION__,__LINE__,err,sock,size,loopCount); + if (SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork, "In [%s::%s Line: %d] WARNING PEEKING SOCKET DATA, err = %d, sock = %d, size = " SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, err, sock, size); break; } diff --git a/source/shared_lib/sources/platform/sdl/platform_util.cpp b/source/shared_lib/sources/platform/sdl/platform_util.cpp index 08d717752..f3be35503 100644 --- a/source/shared_lib/sources/platform/sdl/platform_util.cpp +++ b/source/shared_lib/sources/platform/sdl/platform_util.cpp @@ -122,7 +122,7 @@ namespace Shared { if (dialogCommand) { std::string command = dialogCommand; - string text_file = writepath + "/mg_dialog_text.txt"; + string text_file = writepath + "/dialog_text.txt"; { FILE *fp = fopen(text_file.c_str(),"wt"); if (fp != NULL) { diff --git a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp index e768ed9a5..7e55725a3 100644 --- a/source/shared_lib/sources/sound/openal/sound_player_openal.cpp +++ b/source/shared_lib/sources/sound/openal/sound_player_openal.cpp @@ -625,7 +625,7 @@ namespace Shared { } } - if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound, "In [%s::%s %d] playingCount = %d, staticSources.size() = " MG_SIZE_T_SPECIFIER ", params.staticBufferCount = %u\n", __FILE__, __FUNCTION__, __LINE__, playingCount, (unsigned long) staticSources.size(), params.staticBufferCount); + if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound, "In [%s::%s %d] playingCount = %d, staticSources.size() = " SIZE_T_SPECIFIER ", params.staticBufferCount = %u\n", __FILE__, __FUNCTION__, __LINE__, playingCount, (unsigned long) staticSources.size(), params.staticBufferCount); // create a new source if (staticSources.size() >= params.staticBufferCount) { diff --git a/source/shared_lib/sources/sound/sound_file_loader.cpp b/source/shared_lib/sources/sound/sound_file_loader.cpp index ddf418978..63ff97bc0 100644 --- a/source/shared_lib/sources/sound/sound_file_loader.cpp +++ b/source/shared_lib/sources/sound/sound_file_loader.cpp @@ -240,7 +240,7 @@ namespace Shared { uint32 samples = static_cast(ov_pcm_total(vf, -1)); - if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound, "In [%s::%s Line: %d] path = [%s] vi->version = %d, vi->channels = %d, vi->rate = %ld, vi->bitrate_upper = %ld, vi->bitrate_nominal = %ld, vi->bitrate_lower = %ld, vi->bitrate_window = %ld, samples = " MG_SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, path.c_str(), vi->version, vi->channels, vi->rate, vi->bitrate_upper, vi->bitrate_nominal, vi->bitrate_lower, vi->bitrate_window, samples); + if (SystemFlags::getSystemSettingType(SystemFlags::debugSound).enabled) SystemFlags::OutputDebug(SystemFlags::debugSound, "In [%s::%s Line: %d] path = [%s] vi->version = %d, vi->channels = %d, vi->rate = %ld, vi->bitrate_upper = %ld, vi->bitrate_nominal = %ld, vi->bitrate_lower = %ld, vi->bitrate_window = %ld, samples = " SIZE_T_SPECIFIER "\n", __FILE__, __FUNCTION__, __LINE__, path.c_str(), vi->version, vi->channels, vi->rate, vi->bitrate_upper, vi->bitrate_nominal, vi->bitrate_lower, vi->bitrate_window, samples); soundInfo->setChannels(vi->channels); soundInfo->setsamplesPerSecond(vi->rate); diff --git a/source/shared_lib/sources/util/leak_dumper.cpp b/source/shared_lib/sources/util/leak_dumper.cpp index e20976cc0..1d323b557 100644 --- a/source/shared_lib/sources/util/leak_dumper.cpp +++ b/source/shared_lib/sources/util/leak_dumper.cpp @@ -67,22 +67,22 @@ void AllocRegistry::dump(const char *path) { leakBytes += info.bytes; //allocs[i].stack = AllocInfo::getStackTrace(); - fprintf(f, "Leak #%d.\tfile: %s, line: %d, ptr [%p], bytes: " MG_SIZE_T_SPECIFIER ", array: %d, inuse: %d\n%s\n", ++leakCount, info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); + fprintf(f, "Leak #%d.\tfile: %s, line: %d, ptr [%p], bytes: " SIZE_T_SPECIFIER ", array: %d, inuse: %d\n%s\n", ++leakCount, info.file, info.line, info.ptr, info.bytes, info.array, info.inuse, info.stack.c_str()); } } } - fprintf(f, "\nTotal leaks: %d, " MG_SIZE_T_SPECIFIER " bytes\n", leakCount, leakBytes); - fprintf(f, "Total allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", allocCount, allocBytes); - fprintf(f, "Not monitored allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", nonMonitoredCount, nonMonitoredBytes); + fprintf(f, "\nTotal leaks: %d, " SIZE_T_SPECIFIER " bytes\n", leakCount, leakBytes); + fprintf(f, "Total allocations: %d, " SIZE_T_SPECIFIER " bytes\n", allocCount, allocBytes); + fprintf(f, "Not monitored allocations: %d, " SIZE_T_SPECIFIER " bytes\n", nonMonitoredCount, nonMonitoredBytes); fclose(f); } printf("Memory leak dump summary at: %s\n", szBuf2); - printf("Total leaks: %d, " MG_SIZE_T_SPECIFIER " bytes\n", leakCount, leakBytes); - printf("Total allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", allocCount, allocBytes); - printf("Not monitored allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", nonMonitoredCount, nonMonitoredBytes); + printf("Total leaks: %d, " SIZE_T_SPECIFIER " bytes\n", leakCount, leakBytes); + printf("Total allocations: %d, " SIZE_T_SPECIFIER " bytes\n", allocCount, allocBytes); + printf("Not monitored allocations: %d, " SIZE_T_SPECIFIER " bytes\n", nonMonitoredCount, nonMonitoredBytes); } #endif diff --git a/source/shared_lib/sources/xml/xml_parser.cpp b/source/shared_lib/sources/xml/xml_parser.cpp index 845ed7658..44659d40d 100644 --- a/source/shared_lib/sources/xml/xml_parser.cpp +++ b/source/shared_lib/sources/xml/xml_parser.cpp @@ -364,7 +364,7 @@ namespace Shared { throw game_runtime_error("Can not open file: [" + path + "]", true); } - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); xmlFile.unsetf(ios::skipws); @@ -380,12 +380,12 @@ namespace Shared { } } - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); if (file_size <= 0) { throw game_runtime_error("Invalid file size for file: [" + path + "] size = " + intToStr(file_size)); } - //printf("File size is: " MG_I64_SPECIFIER " for [%s]\n",file_size,path.c_str()); + //printf("File size is: " I64_SPECIFIER " for [%s]\n",file_size,path.c_str()); // Load data and add terminating 0 vector buffer; @@ -393,22 +393,22 @@ namespace Shared { xmlFile.read(&buffer.front(), static_cast(file_size)); buffer[(unsigned int) file_size] = 0; - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); // This is required because rapidxml seems to choke when we load lua // scenarios that have lua + xml style comments replaceAllBetweenTokens(buffer, "", "", true); - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); xml_document<> doc; doc.parse(&buffer.front()); - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); rootNode = new XmlNode(doc.first_node(), mapTagReplacementValues, skipUpdatePathClimbingParts); - if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); + if (showPerfStats) printf("In [%s::%s Line: %d] took msecs: " I64_SPECIFIER "\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__, chrono.getMillis()); #if defined(WIN32) && !defined(__MINGW32__) if (fp) {