[Scummvm-git-logs] scummvm master -> 98b06f1ed62e5fa6070e2a04ab417f8d3c6c405c
digitall
noreply at scummvm.org
Wed Jan 18 02:07:37 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
98b06f1ed6 TETRAEDGE: Fix Undefined Symbol GCC Compiler Warnings
Commit: 98b06f1ed62e5fa6070e2a04ab417f8d3c6c405c
https://github.com/scummvm/scummvm/commit/98b06f1ed62e5fa6070e2a04ab417f8d3c6c405c
Author: D G Turner (digitall at scummvm.org)
Date: 2023-01-18T02:05:15Z
Commit Message:
TETRAEDGE: Fix Undefined Symbol GCC Compiler Warnings
These are emitted if -Wundef is passed to GCC.
This commit also modifies the generic naming of these symbols to add
the engine name as a prefix i.e. DEBUG_PATH could be set in the build
environment for other reasons, TETRAEDGE_DEBUG_PATH is clearer and
avoids odd side effects.
Changed paths:
engines/tetraedge/game/application.cpp
engines/tetraedge/game/game.cpp
engines/tetraedge/game/in_game_scene.cpp
engines/tetraedge/game/inventory.cpp
engines/tetraedge/te/te_lua_context.cpp
engines/tetraedge/te/te_text_base2.cpp
engines/tetraedge/te/te_tiled_surface.cpp
diff --git a/engines/tetraedge/game/application.cpp b/engines/tetraedge/game/application.cpp
index b063e135ea3..da6f0aaf372 100644
--- a/engines/tetraedge/game/application.cpp
+++ b/engines/tetraedge/game/application.cpp
@@ -40,7 +40,7 @@
#include "tetraedge/te/te_input_mgr.h"
#include "tetraedge/te/te_sound_manager.h"
-//#define DUMP_LAYOUTS 1
+//#define TETRAEDGE_DUMP_LAYOUTS
namespace Tetraedge {
@@ -403,7 +403,7 @@ void Application::drawFront() {
g_engine->getRenderer()->loadIdentityMatrix();
}
-#if DUMP_LAYOUTS
+#ifdef TETRAEDGE_DUMP_LAYOUTS
static int renderCount = 0;
static void dumpLayout(TeLayout *layout, Common::String indent = "++") {
assert(layout);
@@ -459,7 +459,7 @@ void Application::performRender() {
game->scene().drawPath();
g_system->updateScreen();
-#if DUMP_LAYOUTS
+#ifdef TETRAEDGE_DUMP_LAYOUTS
renderCount++;
if (renderCount % 100 == 0) {
debug("\n--------------------\nFrame %d back layout: ", renderCount);
diff --git a/engines/tetraedge/game/game.cpp b/engines/tetraedge/game/game.cpp
index f6fbdc39958..30d6273a6c9 100644
--- a/engines/tetraedge/game/game.cpp
+++ b/engines/tetraedge/game/game.cpp
@@ -1123,7 +1123,7 @@ bool Game::onMouseClick(const Common::Point &pt) {
return false;
}
-#if ENABLE_CUSTOM_CURSOR_CHECKS
+#ifdef TETRAEDGE_ENABLE_CUSTOM_CURSOR_CHECKS
// Note: None of these cursor files seem to be actually shipped with the game
// but the logic is reproduced here just in case there's some different
// version that uses them.
@@ -1169,7 +1169,7 @@ bool Game::onMouseMove() {
//
// So maybe all this is useless?
-#if ENABLE_CUSTOM_CURSOR_CHECKS
+#ifdef TETRAEDGE_ENABLE_CUSTOM_CURSOR_CHECKS
TeVector2s32 mouseLoc = g_engine->getInputMgr()->lastMousePos();
bool skipFullSearch = false;
@@ -1212,7 +1212,7 @@ bool Game::onMouseMove() {
if (!checkedCursor)
app->mouseCursorLayout().load(DEFAULT_CURSOR);
-#endif // ENABLE_CUSTOM_CURSOR_CHECKS
+#endif
return false;
}
diff --git a/engines/tetraedge/game/in_game_scene.cpp b/engines/tetraedge/game/in_game_scene.cpp
index d3e4ccc0128..46816da1153 100644
--- a/engines/tetraedge/game/in_game_scene.cpp
+++ b/engines/tetraedge/game/in_game_scene.cpp
@@ -42,8 +42,8 @@
#include "tetraedge/te/te_lua_script.h"
#include "tetraedge/te/te_lua_thread.h"
-//#define DEBUG_PATHFINDING 1
-//#define DEBUG_LIGHTS 1
+//#define TETRAEDGE_DEBUG_PATHFINDING
+//#define TETRAEDGE_DEBUG_LIGHTS
namespace Tetraedge {
@@ -350,7 +350,7 @@ void InGameScene::draw() {
currentCamera()->apply();
-#if DEBUG_PATHFINDING
+#ifdef TETRAEDGE_DEBUG_PATHFINDING
if (_character && _character->curve()) {
_character->curve()->setVisible(true);
_character->curve()->draw();
@@ -707,7 +707,7 @@ bool InGameScene::loadLights(const Common::Path &path) {
_lights[i]->enable(i);
}
-#if DEBUG_LIGHTS
+#ifdef TETRAEDGE_DEBUG_LIGHTS
debug("--- Scene lights ---");
debug("Shadow: %s no:%d far:%.02f near:%.02f fov:%.02f", _shadowColor.dump().c_str(), _shadowLightNo, _shadowFarPlane, _shadowNearPlane, _shadowFov);
debug("Global: %s", TeLight::globalAmbient().dump().c_str());
diff --git a/engines/tetraedge/game/inventory.cpp b/engines/tetraedge/game/inventory.cpp
index 2a2be4ec074..dcf5fb990ad 100644
--- a/engines/tetraedge/game/inventory.cpp
+++ b/engines/tetraedge/game/inventory.cpp
@@ -495,25 +495,25 @@ bool Inventory::updateLayout() {
return false;
}
-//#define DEBUG_SAVELOAD 1
+//#define TETRAEDGE_DEBUG_SAVELOAD
Common::Error Inventory::syncState(Common::Serializer &s) {
uint nitems = _invObjects.size();
s.syncAsUint32LE(nitems);
if (s.isLoading()) {
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_DEBUG_SAVELOAD
debug("Inventory::syncState: --- Loading %d inventory items: ---", nitems);
#endif
for (uint i = 0; i < nitems; i++) {
Common::String objname;
s.syncString(objname);
addObject(objname);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_DEBUG_SAVELOAD
debug("Inventory::syncState: %s", objname.c_str());
#endif
}
} else if (nitems) {
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_DEBUG_SAVELOAD
debug("Inventory::syncState: --- Saving %d inventory items: --- ", _invObjects.size());
#endif
// Add items in reverse order as the "addObject" on load will
@@ -523,13 +523,13 @@ Common::Error Inventory::syncState(Common::Serializer &s) {
iter--;
Common::String objname = (*iter)->name();
s.syncString(objname);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_DEBUG_SAVELOAD
debug("Inventory::syncState: %s", objname.c_str());
#endif
}
}
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_DEBUG_SAVELOAD
debug("Inventory::syncState: -------- end --------");
#endif
return Common::kNoError;
diff --git a/engines/tetraedge/te/te_lua_context.cpp b/engines/tetraedge/te/te_lua_context.cpp
index 240a244bcc5..79099977723 100644
--- a/engines/tetraedge/te/te_lua_context.cpp
+++ b/engines/tetraedge/te/te_lua_context.cpp
@@ -128,7 +128,7 @@ enum TeLuaSaveVarType {
String = 4
};
-#define DEBUG_SAVELOAD 1
+#define TETRAEDGE_LUA_DEBUG_SAVELOAD
Common::Error TeLuaContext::syncState(Common::Serializer &s) {
// Save/Load globals. The format of saving is:
@@ -136,7 +136,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
// Vals can be string, number (uint32), or boolean (byte)
// The type of "None" (0) is the end of the list (and has no name/val).
if (s.isSaving()) {
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: --- Saving globals: ---");
#endif
lua_pushvalue(_luaState, LUA_GLOBALSINDEX);
@@ -157,7 +157,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
s.syncString(name);
bool val = lua_toboolean(_luaState, -1);
s.syncAsByte(val);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: bool %s = %s", name.c_str(), val ? "true" : "false");
#endif
} else if (vtype == LUA_TNUMBER) {
@@ -166,7 +166,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
s.syncString(name);
double val = lua_tonumber(_luaState, -1);
s.syncAsDoubleLE(val);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: num %s = %f", name.c_str(), val);
#endif
} else if (vtype == LUA_TSTRING) {
@@ -175,7 +175,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
s.syncString(name);
Common::String val = lua_tostring(_luaState, -1);
s.syncString(val);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: str %s = '%s'", name.c_str(), val.c_str());
#endif
}
@@ -183,7 +183,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
nextresult = lua_next(_luaState, -2);
}
} else {
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: --- Loading globals: --- ");
#endif
// loading
@@ -197,7 +197,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
byte b = 0;
s.syncAsByte(b);
lua_pushboolean(_luaState, b);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: bool %s = %s", name.c_str(), b ? "true" : "false");
#endif
break;
@@ -206,7 +206,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
float d = 0;
s.syncAsDoubleLE(d);
lua_pushnumber(_luaState, d);
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: num %s = %f", name.c_str(), d);
#endif
break;
@@ -215,7 +215,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
Common::String str;
s.syncString(str);
lua_pushstring(_luaState, str.c_str());
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: str %s = '%s'", name.c_str(), str.c_str());
#endif
break;
@@ -228,7 +228,7 @@ Common::Error TeLuaContext::syncState(Common::Serializer &s) {
}
}
-#if DEBUG_SAVELOAD
+#ifdef TETRAEDGE_LUA_DEBUG_SAVELOAD
debug("TeLuaContext::syncState: -------- end --------");
#endif
diff --git a/engines/tetraedge/te/te_text_base2.cpp b/engines/tetraedge/te/te_text_base2.cpp
index c87b7808c5a..a0eb1958be0 100644
--- a/engines/tetraedge/te/te_text_base2.cpp
+++ b/engines/tetraedge/te/te_text_base2.cpp
@@ -19,9 +19,9 @@
*
*/
-//#define DUMP_RENDERED_FONTS 1
+//#define TETRAEDGE_DUMP_RENDERED_FONTS
-#ifdef DUMP_RENDERED_FONTS
+#ifdef TETRAEDGE_DUMP_RENDERED_FONTS
#include "image/png.h"
#endif
@@ -41,7 +41,7 @@ TeTextBase2::~TeTextBase2() {
delete _mesh;
}
-#ifdef DUMP_RENDERED_FONTS
+#ifdef TETRAEDGE_DUMP_RENDERED_FONTS
static int dumpCount = 0;
#endif
@@ -107,7 +107,7 @@ void TeTextBase2::build() {
TeIntrusivePtr<Te3DTexture> texture = Te3DTexture::makeInstance();
texture->load(img);
-#if DUMP_RENDERED_FONTS
+#ifdef TETRAEDGE_DUMP_RENDERED_FONTS
Common::DumpFile dumpFile;
dumpFile.open(Common::String::format("/tmp/rendered-font-dump-%04d.png", dumpCount));
dumpCount++;
diff --git a/engines/tetraedge/te/te_tiled_surface.cpp b/engines/tetraedge/te/te_tiled_surface.cpp
index ae07f11a0f7..3c56c102e2d 100644
--- a/engines/tetraedge/te/te_tiled_surface.cpp
+++ b/engines/tetraedge/te/te_tiled_surface.cpp
@@ -25,9 +25,9 @@
#include "tetraedge/te/te_frame_anim.h"
#include "tetraedge/te/te_resource_manager.h"
-//#define DUMP_LOADED_IMAGES 1
+//#define TETRAEDGE_DUMP_LOADED_IMAGES
-#ifdef DUMP_LOADED_IMAGES
+#ifdef TETRAEDGE_DUMP_LOADED_IMAGES
#include "image/png.h"
#endif
@@ -106,7 +106,7 @@ bool TeTiledSurface::load(const Common::Path &path) {
img.createImg(_codec->width(), _codec->height(), nullpal, _imgFormat, bufx, bufy);
if (_codec->update(0, img)) {
-#if DUMP_LOADED_IMAGES
+#ifdef TETRAEDGE_DUMP_LOADED_IMAGES
static int dumpCount = 0;
Common::DumpFile dumpFile;
dumpFile.open(Common::String::format("/tmp/dump-tiledsurf-%s-%04d.png", name().c_str(), dumpCount));
More information about the Scummvm-git-logs
mailing list