From 732a2c80ddde4cf0ffd1b1742f514ae940c5301d Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sat, 14 Jul 2012 13:23:54 -0400 Subject: LASTEXPRESS: Remove duplicated include statements --- engines/lastexpress/game/action.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 98d74dd1a7..0ce75f16a4 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -29,7 +29,6 @@ #include "lastexpress/entities/abbot.h" #include "lastexpress/entities/anna.h" -#include "lastexpress/entities/entity.h" #include "lastexpress/game/beetle.h" #include "lastexpress/game/entities.h" @@ -42,9 +41,7 @@ #include "lastexpress/game/state.h" #include "lastexpress/sound/queue.h" -#include "lastexpress/sound/sound.h" -#include "lastexpress/helpers.h" #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" -- cgit v1.2.3 From 552e8d45b265f29d16a02d7a5b01803d1143ef94 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 23 Jul 2012 14:31:33 -0400 Subject: LASTEXPRESS: Switch some warnings to debug console output --- engines/lastexpress/game/action.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 0ce75f16a4..1e5bc0ffd7 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -1739,14 +1739,14 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const { return kCursorBackward; case SceneHotspot::kActionKnockOnDoor: - warning("================================= DOOR %03d =================================", object); + debugC(2, kLastExpressDebugScenes, "================================= DOOR %03d =================================", object); if (object >= kObjectMax) return kCursorNormal; else return (CursorStyle)getObjects()->get(object).cursor; case SceneHotspot::kAction12: - warning("================================= OBJECT %03d =================================", object); + debugC(2, kLastExpressDebugScenes, "================================= OBJECT %03d =================================", object); if (object >= kObjectMax) return kCursorNormal; @@ -1756,7 +1756,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const { return kCursorNormal; case SceneHotspot::kActionPickItem: - warning("================================= ITEM %03d =================================", object); + debugC(2, kLastExpressDebugScenes, "================================= ITEM %03d =================================", object); if (object >= kObjectCompartmentA) return kCursorNormal; @@ -1767,7 +1767,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const { return kCursorNormal; case SceneHotspot::kActionDropItem: - warning("================================= ITEM %03d =================================", object); + debugC(2, kLastExpressDebugScenes, "================================= ITEM %03d =================================", object); if (object >= kObjectCompartmentA) return kCursorNormal; @@ -1884,7 +1884,7 @@ LABEL_KEY: // Handle compartment action case SceneHotspot::kActionCompartment: case SceneHotspot::kActionExitCompartment: - warning("================================= DOOR %03d =================================", object); + debugC(2, kLastExpressDebugScenes, "================================= DOOR %03d =================================", object); if (object >= kObjectMax) return kCursorNormal; -- cgit v1.2.3 From 94e2ea10cd9f5caf7a560b7f1def0f23da9046a5 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 27 Jul 2012 13:41:48 -0400 Subject: LASTEXPRESS: Add menu-related warnings and turn some warnings into errors --- engines/lastexpress/game/action.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 1e5bc0ffd7..4d1c786167 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -404,7 +404,7 @@ SceneIndex Action::processHotspot(const SceneHotspot &hotspot) { ////////////////////////////////////////////////////////////////////////// // Action 0 IMPLEMENT_ACTION(dummy) - warning("[Action::action_dummy] Dummy action function called (hotspot action: %d)", hotspot.action); + error("[Action::action_dummy] Dummy action function called (hotspot action: %d)", hotspot.action); return kSceneInvalid; } -- cgit v1.2.3 From 4ad7d48fe9b306192963398668feb6332a664830 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Wed, 1 Aug 2012 13:55:55 -0400 Subject: LASTEXPRESS: Remove unused code and move functor definition to only file using it --- engines/lastexpress/game/action.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 4d1c786167..60a309518a 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -329,6 +329,22 @@ static const struct { {"8042A", 600} }; +template +class Functor1MemConst : public Common::Functor1 { +public: + typedef Res (T::*FuncType)(Arg) const; + + Functor1MemConst(T *t, const FuncType &func) : _t(t), _func(func) {} + + bool isValid() const { return _func != 0 && _t != 0; } + Res operator()(Arg v1) const { + return (_t->*_func)(v1); + } +private: + mutable T *_t; + const FuncType _func; +}; + Action::Action(LastExpressEngine *engine) : _engine(engine) { ADD_ACTION(dummy); ADD_ACTION(inventory); -- cgit v1.2.3 From bc4e10dabca5b76283eb6fb431702ccd92a001c0 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 21 Aug 2012 23:02:39 -0400 Subject: LASTEXPRESS: Remove some unreachable code --- engines/lastexpress/game/action.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 60a309518a..033fdfc2e8 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -421,8 +421,6 @@ SceneIndex Action::processHotspot(const SceneHotspot &hotspot) { // Action 0 IMPLEMENT_ACTION(dummy) error("[Action::action_dummy] Dummy action function called (hotspot action: %d)", hotspot.action); - - return kSceneInvalid; } ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 275aded0b0e485eead8d5bdac48d9c8dc1a6ef9c Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 21 Aug 2012 23:16:52 -0400 Subject: LASTEXPRESS: Remove unnecessary casts --- engines/lastexpress/game/action.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lastexpress/game/action.cpp') diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp index 033fdfc2e8..796abf2ce7 100644 --- a/engines/lastexpress/game/action.cpp +++ b/engines/lastexpress/game/action.cpp @@ -394,7 +394,7 @@ Action::Action(LastExpressEngine *engine) : _engine(engine) { } Action::~Action() { - for (int i = 0; i < (int)_actions.size(); i++) + for (uint i = 0; i < _actions.size(); i++) SAFE_DELETE(_actions[i]); _actions.clear(); -- cgit v1.2.3