SAGA2: Remove Some Undefined Macro Compiler Warnings

Previously some of the Dinotopia specific code for cursor cycling was
hidden behind macros, resulting in some bitrot to the code. This has
been migrated to being more live by removing the macros.

This prevents various GCC warnings when -Wundef is passed.
This commit is contained in:
D G Turner 2022-03-19 14:42:10 +00:00
parent 9266ca838c
commit 351f897d2c
4 changed files with 16 additions and 27 deletions

View File

@ -349,42 +349,37 @@ void GrabInfo::clearGauge() {
if (grabObj == nullptr) clearMouseGauge();
}
#if CURSOR_CYCLING
extern bool eyeEnabled;
extern bool walkEnabled;
// FIXME: This code is specific to Dinotopia. Was disabled for some time and needs updating
void cycleCursor() {
if (! g_vm->_mouseInfo.cursorCyclingEnabled)
#if 0
if (! g_vm->_mouseInfo->cursorCyclingEnabled) // FIXME: cursorCyclingEnabled not present in GrabInfo
return;
uint8 curIntent;
curIntent = g_vm->_mouseInfo.getIntent();
uint8 curIntent = g_vm->_mouseInfo->getIntent();
if (++curIntent == GrabInfo::IntentCounts)
g_vm->_mouseInfo.setIntent(1); //Set Cursor First State Skip None
g_vm->_mouseInfo->setIntent(1); //Set Cursor First State Skip None
else {
if (!walkEnabled && curIntent == GrabInfo::WalkTo)
if (!walkEnabled && curIntent == GrabInfo::WalkTo) // FIXME: walkEnabled not present
++curIntent;
if (curIntent == GrabInfo::PickUp && g_vm->_mouseInfo.getObject() != nullptr)
if (curIntent == GrabInfo::PickUp && g_vm->_mouseInfo->getObject() != nullptr)
++curIntent;
if (curIntent == GrabInfo::Drop && g_vm->_mouseInfo.getObject() == nullptr)
if (curIntent == GrabInfo::Drop && g_vm->_mouseInfo->getObject() == nullptr)
++curIntent;
if (!eyeEnabled && curIntent == GrabInfo::LookAt)
if (!eyeEnabled && curIntent == GrabInfo::LookAt) // FIXME: eyeEnabled not present
++curIntent;
if (curIntent == GrabInfo::Navigate) {
if (walkEnabled)
curIntent = 1; //Set Cursor First State Skip None
else {
curIntent = 2;
if (curIntent == GrabInfo::PickUp && g_vm->_mouseInfo.getObject() != nullptr)
if (curIntent == GrabInfo::PickUp && g_vm->_mouseInfo->getObject() != nullptr)
++curIntent;
}
}
g_vm->_mouseInfo.setIntent(curIntent); //Set Cursor To Next State
}
}
g_vm->_mouseInfo->setIntent(curIntent); //Set Cursor To Next State
}
#endif
}
} // end of namespace Saga2

View File

@ -27,6 +27,7 @@
#include "saga2/saga2.h"
#include "saga2/panel.h"
#include "saga2/detection.h"
#include "saga2/fontlib.h"
#include "saga2/floating.h"
#include "saga2/display.h"
@ -775,12 +776,10 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
if (lockUINest > 0)
return;
#if CURSOR_CYCLING
if (_curMouseState.right) {
if (g_vm->getGameId() == GID_DINO && _curMouseState.right) {
cycleCursor();
return;
}
#endif
// Code for "Tool tip delay"
if (prevState.pos != _curMouseState.pos

View File

@ -46,12 +46,7 @@ namespace Saga2 {
Cursor Cycling Stuff
* ===================================================================== */
#if DINO
#define CURSOR_CYCLING 1
#endif
#if CURSOR_CYCLING
void cycleCursor();
#endif
/* ===================================================================== *
Forward declarations

View File

@ -724,7 +724,7 @@ enum platformFlags {
plCutVNeg = (1 << 13)
};
#if OLDPLATFLAAGS
#ifdef OLDPLATFLAAGS
enum platformFlags {
plCutaway = (1 << 0), // remove when player underneath