[Scummvm-git-logs] scummvm master -> ff078328bc51306874bfe35a0c0690ffbdf5d405
fracturehill
76959842+fracturehill at users.noreply.github.com
Thu Mar 25 23:18:46 UTC 2021
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:
ff078328bc NANCY: Includes cleanup
Commit: ff078328bc51306874bfe35a0c0690ffbdf5d405
https://github.com/scummvm/scummvm/commit/ff078328bc51306874bfe35a0c0690ffbdf5d405
Author: fracturehill (strahy at outlook.com)
Date: 2021-03-26T01:17:07+02:00
Commit Message:
NANCY: Includes cleanup
Cleaned up the engine's #includes. Also moved the NancyEngine::GameState enum to commontypes.h and renamed it to NancyState.
Changed paths:
engines/nancy/action/actionmanager.cpp
engines/nancy/action/actionmanager.h
engines/nancy/action/actionrecord.cpp
engines/nancy/action/actionrecord.h
engines/nancy/action/arfactory.cpp
engines/nancy/action/leverpuzzle.cpp
engines/nancy/action/leverpuzzle.h
engines/nancy/action/orderingpuzzle.cpp
engines/nancy/action/orderingpuzzle.h
engines/nancy/action/passwordpuzzle.cpp
engines/nancy/action/passwordpuzzle.h
engines/nancy/action/primaryvideo.cpp
engines/nancy/action/primaryvideo.h
engines/nancy/action/recordtypes.cpp
engines/nancy/action/recordtypes.h
engines/nancy/action/responses.cpp
engines/nancy/action/rotatinglockpuzzle.cpp
engines/nancy/action/rotatinglockpuzzle.h
engines/nancy/action/secondarymovie.cpp
engines/nancy/action/secondarymovie.h
engines/nancy/action/secondaryvideo.cpp
engines/nancy/action/secondaryvideo.h
engines/nancy/action/sliderpuzzle.cpp
engines/nancy/action/sliderpuzzle.h
engines/nancy/action/staticbitmapanim.cpp
engines/nancy/action/staticbitmapanim.h
engines/nancy/action/telephone.cpp
engines/nancy/action/telephone.h
engines/nancy/cheat.cpp
engines/nancy/cheat.h
engines/nancy/commontypes.cpp
engines/nancy/commontypes.h
engines/nancy/console.cpp
engines/nancy/cursor.cpp
engines/nancy/cursor.h
engines/nancy/detection.cpp
engines/nancy/font.h
engines/nancy/graphics.cpp
engines/nancy/graphics.h
engines/nancy/iff.cpp
engines/nancy/input.cpp
engines/nancy/input.h
engines/nancy/metaengine.cpp
engines/nancy/nancy.cpp
engines/nancy/nancy.h
engines/nancy/renderobject.cpp
engines/nancy/renderobject.h
engines/nancy/resource.cpp
engines/nancy/sound.cpp
engines/nancy/sound.h
engines/nancy/state/credits.cpp
engines/nancy/state/credits.h
engines/nancy/state/help.cpp
engines/nancy/state/help.h
engines/nancy/state/logo.cpp
engines/nancy/state/logo.h
engines/nancy/state/map.cpp
engines/nancy/state/map.h
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
engines/nancy/state/state.h
engines/nancy/ui/button.cpp
engines/nancy/ui/fullscreenimage.cpp
engines/nancy/ui/inventorybox.cpp
engines/nancy/ui/inventorybox.h
engines/nancy/ui/scrollbar.cpp
engines/nancy/ui/scrollbar.h
engines/nancy/ui/textbox.cpp
engines/nancy/ui/textbox.h
engines/nancy/ui/viewport.cpp
engines/nancy/ui/viewport.h
engines/nancy/video.cpp
engines/nancy/video.h
diff --git a/engines/nancy/action/actionmanager.cpp b/engines/nancy/action/actionmanager.cpp
index 0d2dd4dd63..5ee87eca0c 100644
--- a/engines/nancy/action/actionmanager.cpp
+++ b/engines/nancy/action/actionmanager.cpp
@@ -20,20 +20,16 @@
*
*/
-#include "engines/nancy/commontypes.h"
#include "engines/nancy/action/actionmanager.h"
+
#include "engines/nancy/state/scene.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/state/scene.h"
-#include "engines/nancy/ui/viewport.h"
+#include "engines/nancy/sound.h"
-#include "common/memstream.h"
-#include "common/events.h"
-#include "common/str.h"
#include "common/serializer.h"
namespace Nancy {
diff --git a/engines/nancy/action/actionmanager.h b/engines/nancy/action/actionmanager.h
index fcf16e5ed6..72d00031a1 100644
--- a/engines/nancy/action/actionmanager.h
+++ b/engines/nancy/action/actionmanager.h
@@ -25,13 +25,9 @@
#include "engines/nancy/action/actionrecord.h"
-#include "common/str.h"
-#include "common/stream.h"
-#include "common/array.h"
-#include "common/func.h"
-
namespace Common {
class Serializer;
+class SeekableReadStream;
}
namespace Nancy {
diff --git a/engines/nancy/action/actionrecord.cpp b/engines/nancy/action/actionrecord.cpp
index 3e80110bbf..62d123a120 100644
--- a/engines/nancy/action/actionrecord.cpp
+++ b/engines/nancy/action/actionrecord.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "engines/nancy/action/actionmanager.h"
+#include "engines/nancy/action/actionrecord.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/actionrecord.h b/engines/nancy/action/actionrecord.h
index 1bfb04e4ad..ade79841bb 100644
--- a/engines/nancy/action/actionrecord.h
+++ b/engines/nancy/action/actionrecord.h
@@ -23,18 +23,19 @@
#ifndef NANCY_ACTION_ACTIONRECORD_H
#define NANCY_ACTION_ACTIONRECORD_H
-#include "engines/nancy/input.h"
+#include "common/str.h"
#include "engines/nancy/time.h"
#include "engines/nancy/cursor.h"
-#include "common/str.h"
-#include "common/stream.h"
-#include "common/rect.h"
+namespace Common {
+class SeekableReadStream;
+}
namespace Nancy {
class NancyEngine;
+struct NancyInput;
namespace Action {
diff --git a/engines/nancy/action/arfactory.cpp b/engines/nancy/action/arfactory.cpp
index 4ce7848144..a981639111 100644
--- a/engines/nancy/action/arfactory.cpp
+++ b/engines/nancy/action/arfactory.cpp
@@ -36,8 +36,6 @@
#include "engines/nancy/state/scene.h"
-#include "engines/nancy/nancy.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/leverpuzzle.cpp b/engines/nancy/action/leverpuzzle.cpp
index a7e672191f..e63ca730d5 100644
--- a/engines/nancy/action/leverpuzzle.cpp
+++ b/engines/nancy/action/leverpuzzle.cpp
@@ -22,12 +22,14 @@
#include "engines/nancy/action/leverpuzzle.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/state/scene.h"
+#include "engines/nancy/input.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/leverpuzzle.h b/engines/nancy/action/leverpuzzle.h
index e19b568f5b..1afcf131b8 100644
--- a/engines/nancy/action/leverpuzzle.h
+++ b/engines/nancy/action/leverpuzzle.h
@@ -28,11 +28,6 @@
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-
-#include "graphics/managed_surface.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/orderingpuzzle.cpp b/engines/nancy/action/orderingpuzzle.cpp
index b83f513d84..7f23e2df8b 100644
--- a/engines/nancy/action/orderingpuzzle.cpp
+++ b/engines/nancy/action/orderingpuzzle.cpp
@@ -22,18 +22,16 @@
#include "engines/nancy/action/orderingpuzzle.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/state/scene.h"
-#include "engines/nancy/ui/viewport.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/sound.h"
-#include "graphics/surface.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/orderingpuzzle.h b/engines/nancy/action/orderingpuzzle.h
index 9931bcb135..df58833e19 100644
--- a/engines/nancy/action/orderingpuzzle.h
+++ b/engines/nancy/action/orderingpuzzle.h
@@ -28,12 +28,6 @@
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-#include "common/rect.h"
-
-#include "graphics/managed_surface.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/passwordpuzzle.cpp b/engines/nancy/action/passwordpuzzle.cpp
index b4b1f00a0f..73f131e37b 100644
--- a/engines/nancy/action/passwordpuzzle.cpp
+++ b/engines/nancy/action/passwordpuzzle.cpp
@@ -22,14 +22,14 @@
#include "engines/nancy/action/passwordpuzzle.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/state/scene.h"
-
-#include "graphics/font.h"
+#include "engines/nancy/input.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/passwordpuzzle.h b/engines/nancy/action/passwordpuzzle.h
index 884715ee91..ff1531f5a4 100644
--- a/engines/nancy/action/passwordpuzzle.h
+++ b/engines/nancy/action/passwordpuzzle.h
@@ -27,10 +27,6 @@
#include "engines/nancy/renderobject.h"
#include "engines/nancy/commontypes.h"
-#include "engines/nancy/time.h"
-
-#include "common/str.h"
-#include "common/rect.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/primaryvideo.cpp b/engines/nancy/action/primaryvideo.cpp
index c301944303..5e9d821ab6 100644
--- a/engines/nancy/action/primaryvideo.cpp
+++ b/engines/nancy/action/primaryvideo.cpp
@@ -22,18 +22,16 @@
#include "engines/nancy/action/primaryvideo.h"
+#include "common/random.h"
+
#include "engines/nancy/action/responses.cpp"
-#include "engines/nancy/action/actionmanager.h"
-#include "engines/nancy/nancy.h"
#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
-#include "common/file.h"
-#include "common/random.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/primaryvideo.h b/engines/nancy/action/primaryvideo.h
index f83ea14ca9..b669cccf2b 100644
--- a/engines/nancy/action/primaryvideo.h
+++ b/engines/nancy/action/primaryvideo.h
@@ -29,9 +29,6 @@
#include "engines/nancy/video.h"
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-
namespace Nancy {
class NancyEngine;
diff --git a/engines/nancy/action/recordtypes.cpp b/engines/nancy/action/recordtypes.cpp
index 09efb5e12c..ebe4a48364 100644
--- a/engines/nancy/action/recordtypes.cpp
+++ b/engines/nancy/action/recordtypes.cpp
@@ -20,12 +20,13 @@
*
*/
+#include "engines/nancy/action/recordtypes.h"
+
#include "engines/nancy/action/actionrecord.h"
-#include "engines/nancy/action/actionmanager.h"
+#include "engines/nancy/action/responses.cpp"
#include "engines/nancy/state/scene.h"
-#include "engines/nancy/nancy.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
@@ -33,10 +34,6 @@
#include "engines/nancy/resource.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/action/responses.cpp"
-
-#include "common/str.h"
-
namespace Nancy {
namespace Action {
@@ -126,7 +123,7 @@ void MapCall::readData(Common::SeekableReadStream &stream) {
void MapCall::execute() {
_execType = kRepeating;
- NancySceneState.requestStateChange(NancyEngine::kMap);
+ NancySceneState.requestStateChange(NancyState::kMap);
finishExecution();
}
@@ -295,7 +292,7 @@ void LoseGame::readData(Common::SeekableReadStream &stream) {
void LoseGame::execute() {
g_nancy->_sound->stopAndUnloadSpecificSounds();
- g_nancy->setState(NancyEngine::kMainMenu);
+ g_nancy->setState(NancyState::kMainMenu);
NancySceneState.resetStateToInit();
_isDone = true;
}
@@ -314,7 +311,7 @@ void WinGame::readData(Common::SeekableReadStream &stream) {
void WinGame::execute() {
g_nancy->_sound->stopAndUnloadSpecificSounds();
- g_nancy->setState(NancyEngine::kCredits, NancyEngine::kMainMenu);
+ g_nancy->setState(NancyState::kCredits, NancyState::kMainMenu);
// TODO replace with destroy()?
NancySceneState.resetStateToInit();
diff --git a/engines/nancy/action/recordtypes.h b/engines/nancy/action/recordtypes.h
index b653ffc5cf..1fa4077ae5 100644
--- a/engines/nancy/action/recordtypes.h
+++ b/engines/nancy/action/recordtypes.h
@@ -24,15 +24,10 @@
#define NANCY_ACTION_RECORDTYPES_H
#include "engines/nancy/action/actionrecord.h"
-#include "engines/nancy/commontypes.h"
#include "engines/nancy/renderobject.h"
#include "engines/nancy/commontypes.h"
-#include "common/stream.h"
-#include "common/array.h"
-#include "common/str.h"
-
namespace Nancy {
class NancyEngine;
diff --git a/engines/nancy/action/responses.cpp b/engines/nancy/action/responses.cpp
index f6caedae69..ee4871543f 100644
--- a/engines/nancy/action/responses.cpp
+++ b/engines/nancy/action/responses.cpp
@@ -20,8 +20,7 @@
*
*/
-#include "engines/nancy/action/recordtypes.h"
-#include "common/array.h"
+#include "engines/nancy/commontypes.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/rotatinglockpuzzle.cpp b/engines/nancy/action/rotatinglockpuzzle.cpp
index 6e1f604361..2a039dcdcd 100644
--- a/engines/nancy/action/rotatinglockpuzzle.cpp
+++ b/engines/nancy/action/rotatinglockpuzzle.cpp
@@ -22,14 +22,16 @@
#include "engines/nancy/action/rotatinglockpuzzle.h"
+#include "common/random.h"
+
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/state/scene.h"
-
-#include "common/random.h"
+#include "engines/nancy/input.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/rotatinglockpuzzle.h b/engines/nancy/action/rotatinglockpuzzle.h
index 21d4e07d97..82522b1c34 100644
--- a/engines/nancy/action/rotatinglockpuzzle.h
+++ b/engines/nancy/action/rotatinglockpuzzle.h
@@ -27,11 +27,6 @@
#include "engines/nancy/renderobject.h"
#include "engines/nancy/commontypes.h"
-#include "engines/nancy/time.h"
-
-#include "common/str.h"
-#include "common/array.h"
-#include "common/rect.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index c00d1825b5..a64be98b15 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -22,10 +22,12 @@
#include "engines/nancy/action/secondarymovie.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/state/scene.h"
+#include "engines/nancy/sound.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/secondarymovie.h b/engines/nancy/action/secondarymovie.h
index 01070cc9dd..581aedc3ab 100644
--- a/engines/nancy/action/secondarymovie.h
+++ b/engines/nancy/action/secondarymovie.h
@@ -29,9 +29,6 @@
#include "engines/nancy/video.h"
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/secondaryvideo.cpp b/engines/nancy/action/secondaryvideo.cpp
index a2050523ff..68397f9bdd 100644
--- a/engines/nancy/action/secondaryvideo.cpp
+++ b/engines/nancy/action/secondaryvideo.cpp
@@ -24,8 +24,6 @@
#include "engines/nancy/state/scene.h"
-#include "engines/nancy/ui/viewport.h"
-
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
#include "engines/nancy/sound.h"
@@ -34,9 +32,6 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
-#include "common/system.h"
-#include "common/events.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/secondaryvideo.h b/engines/nancy/action/secondaryvideo.h
index 201317de16..85bc25d9f2 100644
--- a/engines/nancy/action/secondaryvideo.h
+++ b/engines/nancy/action/secondaryvideo.h
@@ -29,9 +29,6 @@
#include "engines/nancy/video.h"
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/sliderpuzzle.cpp b/engines/nancy/action/sliderpuzzle.cpp
index cf8706ca00..fb9ae27012 100644
--- a/engines/nancy/action/sliderpuzzle.cpp
+++ b/engines/nancy/action/sliderpuzzle.cpp
@@ -22,14 +22,14 @@
#include "engines/nancy/action/sliderpuzzle.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/state/scene.h"
-
-#include "common/serializer.h"
+#include "engines/nancy/input.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/sliderpuzzle.h b/engines/nancy/action/sliderpuzzle.h
index e6219d64dc..1a70ea27bc 100644
--- a/engines/nancy/action/sliderpuzzle.h
+++ b/engines/nancy/action/sliderpuzzle.h
@@ -28,12 +28,6 @@
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-#include "common/rect.h"
-
-#include "graphics/managed_surface.h"
-
namespace Common {
class Serializer;
}
diff --git a/engines/nancy/action/staticbitmapanim.cpp b/engines/nancy/action/staticbitmapanim.cpp
index 9abf7a698f..28a54297d6 100644
--- a/engines/nancy/action/staticbitmapanim.cpp
+++ b/engines/nancy/action/staticbitmapanim.cpp
@@ -22,15 +22,15 @@
#include "engines/nancy/action/staticbitmapanim.h"
-#include "engines/nancy/sound.h"
+#include "common/rational.h"
+
#include "engines/nancy/state/scene.h"
+#include "engines/nancy/sound.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
#include "engines/nancy/resource.h"
-#include "common/rational.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/staticbitmapanim.h b/engines/nancy/action/staticbitmapanim.h
index 607e430d1a..87e9dce511 100644
--- a/engines/nancy/action/staticbitmapanim.h
+++ b/engines/nancy/action/staticbitmapanim.h
@@ -28,9 +28,6 @@
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/telephone.cpp b/engines/nancy/action/telephone.cpp
index 118a68d662..a98b014fc4 100644
--- a/engines/nancy/action/telephone.cpp
+++ b/engines/nancy/action/telephone.cpp
@@ -22,16 +22,18 @@
#include "engines/nancy/action/telephone.h"
+#include "engines/nancy/state/scene.h"
+
+#include "engines/nancy/ui/textbox.h"
+
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/cursor.h"
+#include "engines/nancy/input.h"
-#include "engines/nancy/state/scene.h"
-
-#include "engines/nancy/ui/textbox.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/telephone.h b/engines/nancy/action/telephone.h
index a80376e33f..e6009515ae 100644
--- a/engines/nancy/action/telephone.h
+++ b/engines/nancy/action/telephone.h
@@ -28,12 +28,6 @@
#include "engines/nancy/commontypes.h"
-#include "common/str.h"
-#include "common/array.h"
-#include "common/rect.h"
-
-#include "graphics/managed_surface.h"
-
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/cheat.cpp b/engines/nancy/cheat.cpp
index a053e4b440..5e3d9f514e 100644
--- a/engines/nancy/cheat.cpp
+++ b/engines/nancy/cheat.cpp
@@ -22,18 +22,16 @@
#include "engines/nancy/cheat.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/iff.h"
-#include "engines/nancy/state/scene.h"
-
#include "common/winexe.h"
-#include "common/stream.h"
#include "common/translation.h"
-#include "common/ustr.h"
+#include "common/stream.h"
#include "gui/widgets/tab.h"
#include "gui/widgets/edittext.h"
+#include "engines/nancy/iff.h"
+#include "engines/nancy/state/scene.h"
+
namespace Nancy {
CheatDialog::CheatDialog() : GUI::Dialog(20, 20, 600, 440) {
diff --git a/engines/nancy/cheat.h b/engines/nancy/cheat.h
index b6e3985b82..e40b98beaa 100644
--- a/engines/nancy/cheat.h
+++ b/engines/nancy/cheat.h
@@ -23,17 +23,14 @@
#ifndef NANCY_CHEAT_H
#define NANCY_CHEAT_H
-#include "engines/nancy/commontypes.h"
-
#include "gui/dialog.h"
-#include "gui/widget.h"
#include "common/str.h"
#include "common/array.h"
namespace GUI {
-class TabWidget;
class EditTextWidget;
+class CheckboxWidget;
}
namespace Nancy {
diff --git a/engines/nancy/commontypes.cpp b/engines/nancy/commontypes.cpp
index 488e3e2d88..a6c358d370 100644
--- a/engines/nancy/commontypes.cpp
+++ b/engines/nancy/commontypes.cpp
@@ -22,12 +22,11 @@
#include "engines/nancy/commontypes.h"
+#include "common/stream.h"
+
#include "engines/nancy/util.h"
-#include "engines/nancy/nancy.h"
#include "engines/nancy/state/scene.h"
-#include "common/stream.h"
-
namespace Nancy {
void SceneChangeDescription::readData(Common::SeekableReadStream &stream) {
diff --git a/engines/nancy/commontypes.h b/engines/nancy/commontypes.h
index cd788a2688..41a3d46db5 100644
--- a/engines/nancy/commontypes.h
+++ b/engines/nancy/commontypes.h
@@ -23,7 +23,6 @@
#ifndef NANCY_COMMONYPES_H
#define NANCY_COMMONYPES_H
-#include "common/scummsys.h"
#include "common/rect.h"
#include "common/str.h"
@@ -38,6 +37,30 @@ class NancyEngine;
enum NancyFlag : byte { kFalse = 1, kTrue = 2 };
enum MovementDirection : byte { kUp = 1, kDown = 2, kLeft = 4, kRight = 8, kMoveFast = 16 };
+// Separate namespace to remove possible clashes
+namespace NancyState {
+enum NancyState {
+ kBoot,
+ kPartnerLogo,
+ kLogo,
+ kCredits,
+ kMap,
+ kMainMenu,
+ kLoadSave,
+ kSetup,
+ // unknown/invalid
+ kHelp,
+ kScene,
+ // CD change
+ kCheat,
+ kQuit,
+ // regain focus
+ kNone,
+ kPause, // only used when the GMM is on screen
+ kReloadSave
+};
+}
+
// Describes a scene transition
struct SceneChangeDescription {
uint16 sceneID = 0;
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 9f533a234c..b2eeb71c34 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -21,6 +21,12 @@
*/
#include "engines/nancy/console.h"
+
+#include "common/system.h"
+#include "common/events.h"
+
+#include "audio/audiostream.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/video.h"
@@ -30,13 +36,6 @@
#include "engines/nancy/input.h"
#include "engines/nancy/graphics.h"
-#include "common/system.h"
-#include "common/events.h"
-
-#include "graphics/surface.h"
-
-#include "audio/audiostream.h"
-
namespace Nancy {
NancyConsole::NancyConsole() : GUI::Debugger() {
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 170b260dec..11395f3894 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -22,14 +22,13 @@
#include "engines/nancy/cursor.h"
+#include "graphics/cursorman.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/util.h"
-#include "common/stream.h"
-#include "common/str.h"
-
namespace Nancy {
void CursorManager::init() {
diff --git a/engines/nancy/cursor.h b/engines/nancy/cursor.h
index a2fb253b59..3ad8a3e4bd 100644
--- a/engines/nancy/cursor.h
+++ b/engines/nancy/cursor.h
@@ -23,7 +23,8 @@
#ifndef NANCY_CURSOR_H
#define NANCY_CURSOR_H
-#include "graphics/cursorman.h"
+#include "common/array.h"
+
#include "graphics/managed_surface.h"
namespace Nancy {
diff --git a/engines/nancy/detection.cpp b/engines/nancy/detection.cpp
index d2ab5cc323..55e64dbd18 100644
--- a/engines/nancy/detection.cpp
+++ b/engines/nancy/detection.cpp
@@ -22,15 +22,6 @@
#include "engines/nancy/detection.h"
-#include "common/system.h"
-#include "common/savefile.h"
-#include "common/textconsole.h"
-
-#include "graphics/thumbnail.h"
-#include "graphics/surface.h"
-
-#include "engines/advancedDetector.h"
-
const char *const directoryGlobs[] = {
"game",
"datafiles",
diff --git a/engines/nancy/font.h b/engines/nancy/font.h
index 788e5f6277..41d2ed867f 100644
--- a/engines/nancy/font.h
+++ b/engines/nancy/font.h
@@ -22,14 +22,14 @@
#ifndef NANCY_FONT_H
#define NANCY_FONT_H
-#include "graphics/font.h"
+#include "common/array.h"
+#include "graphics/font.h"
#include "graphics/surface.h"
-#include "common/stream.h"
-#include "common/array.h"
-#include "common/rect.h"
-#include "common/str.h"
+namespace Common {
+class SeekableReadStream;
+}
namespace Nancy {
diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index 76dd952dfd..3082114680 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -22,21 +22,14 @@
#include "engines/nancy/graphics.h"
-#include "engines/nancy/renderobject.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/cursor.h"
-#include "engines/nancy/state/scene.h"
-#include "engines/nancy/ui/viewport.h"
-
-#include "common/file.h"
-#include "common/system.h"
-
#include "image/bmp.h"
#include "engines/util.h"
+#include "engines/nancy/renderobject.h"
+#include "engines/nancy/resource.h"
+#include "engines/nancy/nancy.h"
+
namespace Nancy {
GraphicsManager::GraphicsManager() :
diff --git a/engines/nancy/graphics.h b/engines/nancy/graphics.h
index 7be0d3ab16..bd236595de 100644
--- a/engines/nancy/graphics.h
+++ b/engines/nancy/graphics.h
@@ -23,16 +23,16 @@
#ifndef NANCY_GRAPHICS_H
#define NANCY_GRAPHICS_H
-#include "engines/nancy/renderobject.h"
-#include "engines/nancy/font.h"
-
#include "common/array.h"
#include "graphics/screen.h"
+#include "engines/nancy/font.h"
+
namespace Nancy {
class NancyEngine;
+class RenderObject;
// Graphics class that handles multilayered surface rendering with minimal redraw
class GraphicsManager {
diff --git a/engines/nancy/iff.cpp b/engines/nancy/iff.cpp
index 669867e76e..5ee28123d5 100644
--- a/engines/nancy/iff.cpp
+++ b/engines/nancy/iff.cpp
@@ -20,14 +20,13 @@
*
*/
-#include "engines/nancy/nancy.h"
#include "engines/nancy/iff.h"
-#include "engines/nancy/resource.h"
#include "common/memstream.h"
#include "common/iff_container.h"
-#include "common/debug.h"
-#include "common/endian.h"
+
+#include "engines/nancy/nancy.h"
+#include "engines/nancy/resource.h"
namespace Nancy {
diff --git a/engines/nancy/input.cpp b/engines/nancy/input.cpp
index fa648f30dc..18275b1a91 100644
--- a/engines/nancy/input.cpp
+++ b/engines/nancy/input.cpp
@@ -25,6 +25,7 @@
#include "engines/nancy/nancy.h"
#include "common/translation.h"
+#include "common/events.h"
#include "backends/keymapper/action.h"
#include "backends/keymapper/keymap.h"
diff --git a/engines/nancy/input.h b/engines/nancy/input.h
index 7dcf655725..d53a3f06b1 100644
--- a/engines/nancy/input.h
+++ b/engines/nancy/input.h
@@ -23,20 +23,17 @@
#ifndef NANCY_INPUT_H
#define NANCY_INPUT_H
-#include "engines/nancy/commontypes.h"
-
#include "common/rect.h"
#include "common/array.h"
-#include "common/events.h"
+#include "common/keyboard.h"
namespace Common {
+class Keymap;
typedef class Array<Keymap *> KeymapArray;
}
namespace Nancy {
-class NancyEngine;
-
namespace State {
class State;
}
diff --git a/engines/nancy/metaengine.cpp b/engines/nancy/metaengine.cpp
index 5c8d1a9501..e41c62fde2 100644
--- a/engines/nancy/metaengine.cpp
+++ b/engines/nancy/metaengine.cpp
@@ -20,19 +20,11 @@
*
*/
+#include "engines/advancedDetector.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/input.h"
-#include "common/config-manager.h"
-#include "common/savefile.h"
-#include "common/system.h"
-
-#include "graphics/thumbnail.h"
-
-#include "base/plugins.h"
-
-#include "engines/advancedDetector.h"
-
class NancyMetaEngine : public AdvancedMetaEngine {
public:
const char *getName() const override {
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 1b3b65b97c..ea5b10cf1b 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -20,17 +20,23 @@
*
*/
+#include "engines/nancy/nancy.h"
+
+#include "common/system.h"
+#include "common/random.h"
+#include "common/debug-channels.h"
+#include "common/config-manager.h"
+#include "common/memstream.h"
+#include "common/installshield_cab.h"
+#include "common/savefile.h"
+#include "common/serializer.h"
+
#include "engines/nancy/state/logo.h"
#include "engines/nancy/state/scene.h"
#include "engines/nancy/state/help.h"
#include "engines/nancy/state/map.h"
#include "engines/nancy/state/credits.h"
-#include "engines/nancy/action/sliderpuzzle.h"
-#include "engines/nancy/action/primaryvideo.h"
-#include "engines/nancy/action/secondarymovie.h"
-
-#include "engines/nancy/nancy.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/iff.h"
#include "engines/nancy/sound.h"
@@ -39,26 +45,9 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/cheat.h"
+#include "engines/nancy/console.h"
-#include "common/system.h"
-#include "common/random.h"
-#include "common/error.h"
-#include "common/events.h"
-#include "common/debug-channels.h"
-#include "common/config-manager.h"
-#include "common/textconsole.h"
-#include "common/memstream.h"
-#include "common/installshield_cab.h"
-#include "common/str.h"
-#include "common/savefile.h"
-#include "common/serializer.h"
-
-#include "graphics/surface.h"
-
-#include "audio/mixer.h"
-#include "audio/audiostream.h"
-
-#include "engines/util.h"
+#include "engines/nancy/action/primaryvideo.h"
namespace Nancy {
@@ -164,14 +153,14 @@ Common::Platform NancyEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
-void NancyEngine::setState(GameState state, GameState overridePrevious) {
+void NancyEngine::setState(NancyState::NancyState state, NancyState::NancyState overridePrevious) {
// Handle special cases first
switch (state) {
- case kBoot:
+ case NancyState::kBoot:
bootGameEngine();
- setState(kLogo);
+ setState(NancyState::kLogo);
return;
- case kMainMenu:
+ case NancyState::kMainMenu:
if (_gameFlow.currentState) {
if (_gameFlow.currentState->onStateExit()) {
_gameFlow.currentState = nullptr;
@@ -190,7 +179,7 @@ void NancyEngine::setState(GameState state, GameState overridePrevious) {
}
return;
- case kCheat:
+ case NancyState::kCheat:
if (_cheatTypeIsEventFlag) {
EventFlagDialog *dialog = new EventFlagDialog();
runDialog(*dialog);
@@ -219,7 +208,7 @@ void NancyEngine::setState(GameState state, GameState overridePrevious) {
_gameFlow.currentState->onStateEnter();
}
- if (overridePrevious != kNone) {
+ if (overridePrevious != NancyState::kNone) {
_gameFlow.previousState = getStateObject(state);
}
}
@@ -241,19 +230,19 @@ void NancyEngine::setMouseEnabled(bool enabled) {
}
void NancyEngine::callCheatMenu(bool eventFlags) {
- setState(kCheat), _cheatTypeIsEventFlag = eventFlags;
+ setState(NancyState::kCheat), _cheatTypeIsEventFlag = eventFlags;
}
Common::Error NancyEngine::run() {
// Boot the engine
- setState(kBoot);
+ setState(NancyState::kBoot);
// Check if we need to load a save state from the launcher
if (ConfMan.hasKey("save_slot")) {
int saveSlot = ConfMan.getInt("save_slot");
if (saveSlot >= 0 && saveSlot <= getMetaEngine().getMaximumSaveSlot()) {
// Set to Scene but do not do the loading yet
- setState(kScene);
+ setState(NancyState::kScene);
}
}
@@ -360,17 +349,17 @@ void NancyEngine::bootGameEngine() {
_cursorManager->init();
}
-State::State *NancyEngine::getStateObject(GameState state) const {
+State::State *NancyEngine::getStateObject(NancyState::NancyState state) const {
switch (state) {
- case kLogo:
+ case NancyState::kLogo:
return &State::Logo::instance();
- case kCredits:
+ case NancyState::kCredits:
return &State::Credits::instance();
- case kMap:
+ case NancyState::kMap:
return &State::Map::instance();
- case kHelp:
+ case NancyState::kHelp:
return &State::Help::instance();
- case kScene:
+ case NancyState::kScene:
return &State::Scene::instance();
default:
return nullptr;
diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h
index e2b93cf822..2ef52d600b 100644
--- a/engines/nancy/nancy.h
+++ b/engines/nancy/nancy.h
@@ -23,14 +23,15 @@
#ifndef NANCY_H
#define NANCY_H
-#include "nancy/console.h"
-#include "nancy/detection.h"
-#include "nancy/time.h"
-
-#include "engines/engine.h"
#include "common/file.h"
#include "common/str.h"
+#include "engines/engine.h"
+
+#include "nancy/detection.h"
+#include "nancy/time.h"
+#include "nancy/commontypes.h"
+
namespace Common {
class RandomSource;
class Serializer;
@@ -69,6 +70,7 @@ class SoundManager;
class GraphicsManager;
class CursorManager;
class CheatDialog;
+class NancyConsole;
namespace State {
class State;
@@ -83,27 +85,6 @@ class NancyEngine : public Engine {
public:
friend class NancyConsole;
- enum GameState {
- kBoot,
- kPartnerLogo,
- kLogo,
- kCredits,
- kMap,
- kMainMenu,
- kLoadSave,
- kSetup,
- // unknown/invalid
- kHelp,
- kScene,
- // CD change
- kCheat,
- kQuit,
- // regain focus
- kNone,
- kPause, // only used when the GMM is on screen
- kReloadSave
- };
-
NancyEngine(OSystem *syst, const NancyGameDescription *gd);
~NancyEngine();
@@ -124,7 +105,7 @@ public:
GameType getGameType() const;
Common::Platform getPlatform() const;
- void setState(GameState state, GameState overridePrevious = kNone);
+ void setState(NancyState::NancyState state, NancyState::NancyState overridePrevious = NancyState::kNone);
State::State *getState() { return _gameFlow.currentState; }
void setPreviousState();
@@ -164,7 +145,7 @@ private:
void bootGameEngine();
- State::State *getStateObject(GameState state) const;
+ State::State *getStateObject(NancyState::NancyState state) const;
bool addBootChunk(const Common::String &name, Common::SeekableReadStream *stream);
void clearBootChunks();
diff --git a/engines/nancy/renderobject.cpp b/engines/nancy/renderobject.cpp
index 70e57b43d1..9e3d418a2a 100644
--- a/engines/nancy/renderobject.cpp
+++ b/engines/nancy/renderobject.cpp
@@ -22,13 +22,12 @@
#include "engines/nancy/renderobject.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/graphics.h"
-#include "engines/nancy/input.h"
+#include "common/stream.h"
+
#include "engines/nancy/state/scene.h"
-#include "engines/nancy/ui/viewport.h"
-#include "common/stream.h"
+#include "engines/nancy/nancy.h"
+#include "engines/nancy/graphics.h"
namespace Nancy {
diff --git a/engines/nancy/renderobject.h b/engines/nancy/renderobject.h
index d37fbe50b7..a29b1e396c 100644
--- a/engines/nancy/renderobject.h
+++ b/engines/nancy/renderobject.h
@@ -23,16 +23,14 @@
#ifndef NANCY_RENDEROBJECT_H
#define NANCY_RENDEROBJECT_H
-#include "engines/nancy/commontypes.h"
-
#include "common/rect.h"
-#include "common/keyboard.h"
#include "graphics/managed_surface.h"
namespace Nancy {
class NancyEngine;
+class GraphicsManager;
// Loosely equivalent to the original engine's ZRenderStructs.
// A subclass of this will be automatically updated and drawn from the graphics manager,
diff --git a/engines/nancy/resource.cpp b/engines/nancy/resource.cpp
index bfd9bbb49c..d69f80e41c 100644
--- a/engines/nancy/resource.cpp
+++ b/engines/nancy/resource.cpp
@@ -21,20 +21,15 @@
*/
#include "engines/nancy/resource.h"
-#include "engines/nancy/decompress.h"
-#include "engines/nancy/graphics.h"
-#include "engines/nancy/nancy.h"
-#include "common/file.h"
-#include "common/textconsole.h"
-#include "common/debug.h"
-#include "common/stream.h"
#include "common/memstream.h"
-#include "graphics/surface.h"
-
#include "image/bmp.h"
+#include "engines/nancy/decompress.h"
+#include "engines/nancy/graphics.h"
+#include "engines/nancy/nancy.h"
+
namespace Nancy {
static void readCifInfo20(Common::File &f, ResourceManager::CifInfo &info, uint32 *dataOffset = nullptr) {
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 22b190efe4..39d219af27 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -21,18 +21,16 @@
*/
#include "engines/nancy/sound.h"
-#include "engines/nancy/nancy.h"
#include "common/system.h"
-#include "common/debug.h"
-#include "common/textconsole.h"
-#include "common/stream.h"
#include "common/substream.h"
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/vorbis.h"
+#include "engines/nancy/nancy.h"
+
namespace Nancy {
enum SoundType {
diff --git a/engines/nancy/sound.h b/engines/nancy/sound.h
index cd402e1e58..6a2e8e5cf8 100644
--- a/engines/nancy/sound.h
+++ b/engines/nancy/sound.h
@@ -23,9 +23,6 @@
#ifndef NANCY_SOUND_H
#define NANCY_SOUND_H
-#include "engines/nancy/commontypes.h"
-
-#include "common/types.h"
#include "common/str.h"
#include "audio/mixer.h"
@@ -41,6 +38,7 @@ class SeekableAudioStream;
namespace Nancy {
class NancyEngine;
+struct SoundDescription;
class SoundManager {
public:
diff --git a/engines/nancy/state/credits.cpp b/engines/nancy/state/credits.cpp
index 41a81454e0..351fd8afe4 100644
--- a/engines/nancy/state/credits.cpp
+++ b/engines/nancy/state/credits.cpp
@@ -30,8 +30,6 @@
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
-#include "common/stream.h"
-
namespace Common {
DECLARE_SINGLETON(Nancy::State::Credits);
}
@@ -92,7 +90,7 @@ void Credits::run() {
if (input.input & NancyInput::kLeftMouseButtonDown) {
_state = kInit;
g_nancy->_sound->stopSound(_sound);
- g_nancy->setState(NancyEngine::kMainMenu);
+ g_nancy->setState(NancyState::kMainMenu);
g_nancy->_cursorManager->showCursor(true);
_fullTextSurface.free();
}
diff --git a/engines/nancy/state/credits.h b/engines/nancy/state/credits.h
index f414388de3..f3ffe6ec97 100644
--- a/engines/nancy/state/credits.h
+++ b/engines/nancy/state/credits.h
@@ -23,6 +23,8 @@
#ifndef NANCY_STATE_CREDITS_H
#define NANCY_STATE_CREDITS_H
+#include "common/singleton.h"
+
#include "engines/nancy/state/state.h"
#include "engines/nancy/ui/fullscreenimage.h"
@@ -30,15 +32,8 @@
#include "engines/nancy/time.h"
#include "engines/nancy/commontypes.h"
-#include "common/rect.h"
-#include "common/singleton.h"
-
-#include "graphics/managed_surface.h"
-
namespace Nancy {
-class NancyEngine;
-
namespace State {
class Credits : public State, public Common::Singleton<Credits> {
diff --git a/engines/nancy/state/help.cpp b/engines/nancy/state/help.cpp
index f8e94853e8..bc4ae17849 100644
--- a/engines/nancy/state/help.cpp
+++ b/engines/nancy/state/help.cpp
@@ -23,14 +23,11 @@
#include "engines/nancy/state/help.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/commontypes.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/util.h"
-#include "common/stream.h"
-
namespace Common {
DECLARE_SINGLETON(Nancy::State::Help);
}
diff --git a/engines/nancy/state/help.h b/engines/nancy/state/help.h
index 23880ea88f..981728c1c1 100644
--- a/engines/nancy/state/help.h
+++ b/engines/nancy/state/help.h
@@ -23,19 +23,16 @@
#ifndef NANCY_STATE_HELP_H
#define NANCY_STATE_HELP_H
+#include "common/singleton.h"
+
#include "engines/nancy/state/state.h"
#include "engines/nancy/ui/fullscreenimage.h"
#include "engines/nancy/commontypes.h"
-#include "common/rect.h"
-#include "common/singleton.h"
-
namespace Nancy {
-class NancyEngine;
-
namespace State {
class Help : public State, public Common::Singleton<Help> {
diff --git a/engines/nancy/state/logo.cpp b/engines/nancy/state/logo.cpp
index 024db5df1d..8311c1ba97 100644
--- a/engines/nancy/state/logo.cpp
+++ b/engines/nancy/state/logo.cpp
@@ -23,20 +23,9 @@
#include "engines/nancy/state/logo.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
-#include "common/error.h"
-#include "common/system.h"
-#include "common/events.h"
-#include "common/str.h"
-
-#include "audio/audiostream.h"
-#include "audio/mixer.h"
-
-#include "graphics/surface.h"
-
namespace Common {
DECLARE_SINGLETON(Nancy::State::Logo);
}
@@ -81,12 +70,12 @@ void Logo::startSound() {
g_nancy->_sound->loadSound(_msnd);
g_nancy->_sound->playSound(_msnd);
- _startTicks = g_system->getMillis();
+ _startTicks = g_nancy->getTotalPlayTime();
_state = kRun;
}
void Logo::run() {
- if (g_system->getMillis() - _startTicks >= 7000 || (g_nancy->_input->getInput().input & NancyInput::kLeftMouseButtonDown)) {
+ if (g_nancy->getTotalPlayTime() - _startTicks >= 7000 || (g_nancy->_input->getInput().input & NancyInput::kLeftMouseButtonDown)) {
_state = kStop;
}
}
@@ -98,7 +87,7 @@ void Logo::stop() {
g_nancy->_sound->stopSound(_msnd);
- g_nancy->setState(NancyEngine::kScene);
+ g_nancy->setState(NancyState::kScene);
}
} // End of namespace State
diff --git a/engines/nancy/state/logo.h b/engines/nancy/state/logo.h
index ead3d6367a..f85c937e92 100644
--- a/engines/nancy/state/logo.h
+++ b/engines/nancy/state/logo.h
@@ -23,20 +23,16 @@
#ifndef NANCY_STATE_LOGO_H
#define NANCY_STATE_LOGO_H
+#include "common/singleton.h"
+
#include "engines/nancy/state/state.h"
-#include "engines/nancy/ui/fullscreenimage.h"
+#include "engines/nancy/commontypes.h"
-#include "common/singleton.h"
-
-namespace Graphics {
-struct Surface;
-}
+#include "engines/nancy/ui/fullscreenimage.h"
namespace Nancy {
-class NancyEngine;
-
namespace State {
class Logo : public State, public Common::Singleton<Logo> {
diff --git a/engines/nancy/state/map.cpp b/engines/nancy/state/map.cpp
index f62866c4aa..0df8e3e350 100644
--- a/engines/nancy/state/map.cpp
+++ b/engines/nancy/state/map.cpp
@@ -24,7 +24,6 @@
#include "engines/nancy/state/scene.h"
-#include "engines/nancy/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
@@ -32,9 +31,6 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
-#include "common/stream.h"
-#include "common/str.h"
-
namespace Common {
DECLARE_SINGLETON(Nancy::State::Map);
}
@@ -42,6 +38,14 @@ DECLARE_SINGLETON(Nancy::State::Map);
namespace Nancy {
namespace State {
+Map::Map() : _state(kInit),
+ _mapID(0),
+ _mapButtonClicked(false),
+ _pickedLocationID(-1),
+ _viewport(),
+ _label(NancySceneState.getFrame(), this),
+ _button(NancySceneState.getFrame(), this) {}
+
void Map::process() {
switch (_state) {
case kInit:
@@ -134,7 +138,7 @@ void Map::run() {
_button.handleInput(input);
if (_mapButtonClicked) {
- g_nancy->setState(NancyEngine::kScene);
+ g_nancy->setState(NancyState::kScene);
return;
}
@@ -147,7 +151,7 @@ void Map::run() {
if (input.input & NancyInput::kLeftMouseButtonUp) {
_pickedLocationID = i;
- g_nancy->setState(NancyEngine::kScene);
+ g_nancy->setState(NancyState::kScene);
}
return;
@@ -162,7 +166,7 @@ bool Map::onStateExit() {
sound.read(*chunk, SoundDescription::kMenu);
g_nancy->_sound->stopSound(sound);
- g_nancy->setState(NancyEngine::kScene);
+ g_nancy->setState(NancyState::kScene);
if (_pickedLocationID != -1) {
auto &loc = _locations[_pickedLocationID];
diff --git a/engines/nancy/state/map.h b/engines/nancy/state/map.h
index e85b2f3370..a04d3c96b7 100644
--- a/engines/nancy/state/map.h
+++ b/engines/nancy/state/map.h
@@ -23,23 +23,16 @@
#ifndef NANCY_STATE_MAP_H
#define NANCY_STATE_MAP_H
+#include "common/array.h"
+#include "common/singleton.h"
+
#include "engines/nancy/state/state.h"
#include "engines/nancy/ui/viewport.h"
#include "engines/nancy/ui/button.h"
-#include "engines/nancy/state/scene.h"
-
-#include "engines/nancy/video.h"
#include "engines/nancy/renderobject.h"
-#include "common/str.h"
-#include "common/array.h"
-#include "common/rect.h"
-#include "common/singleton.h"
-
-#include "graphics/surface.h"
-
namespace Nancy {
class NancyEngine;
@@ -51,13 +44,7 @@ class Map : public State, public Common::Singleton<Map> {
friend class MapButton;
public:
enum State { kInit, kRun };
- Map() : _state(kInit),
- _mapID(0),
- _mapButtonClicked(false),
- _pickedLocationID(-1),
- _viewport(),
- _label(NancySceneState.getFrame(), this),
- _button(NancySceneState.getFrame(), this) {}
+ Map();
// State API
virtual void process() override;
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 3f8c6d3ab9..fcb8b44f66 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -22,27 +22,17 @@
#include "engines/nancy/state/scene.h"
+#include "common/serializer.h"
+#include "common/config-manager.h"
+
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
#include "engines/nancy/iff.h"
#include "engines/nancy/input.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/cursor.h"
-#include "engines/nancy/time.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/action/actionmanager.h"
-#include "engines/nancy/action/sliderpuzzle.h"
-
-#include "common/memstream.h"
-#include "common/rect.h"
-#include "common/func.h"
-#include "common/serializer.h"
-#include "common/config-manager.h"
-
-#include "graphics/surface.h"
-
namespace Common {
DECLARE_SINGLETON(Nancy::State::Scene);
}
@@ -138,7 +128,7 @@ bool Scene::onStateExit() {
_timers.pushedPlayTime = g_nancy->getTotalPlayTime();
_actionManager.onPause(true);
pauseSceneSpecificSounds();
- _gameStateRequested = NancyEngine::kNone;
+ _gameStateRequested = NancyState::kNone;
return false;
}
@@ -202,6 +192,10 @@ void Scene::removeItemFromInventory(uint16 id, bool pickUp) {
_inventoryBox.removeItem(id);
}
+void Scene::setHeldItem(int16 id) {
+ _flags.heldItem = id; g_nancy->_cursorManager->setCursorItemID(id);
+}
+
void Scene::setEventFlag(int16 label, NancyFlag flag) {
if (label > -1) {
_flags.eventFlags[label] = flag;
@@ -509,7 +503,7 @@ void Scene::run() {
_isComingFromMenu = false;
- if (_gameStateRequested != NancyEngine::kNone) {
+ if (_gameStateRequested != NancyState::kNone) {
g_nancy->setState(_gameStateRequested);
return;
@@ -560,7 +554,7 @@ void Scene::run() {
g_nancy->_cursorManager->setCursorType(CursorManager::kHotspotArrow);
if (input.input & NancyInput::kLeftMouseButtonUp) {
- requestStateChange(NancyEngine::kMap);
+ requestStateChange(NancyState::kMap);
}
}
}
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 1ca543ff97..6660b18f55 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -23,8 +23,13 @@
#ifndef NANCY_STATE_SCENE_H
#define NANCY_STATE_SCENE_H
+#include "common/singleton.h"
+
#include "engines/nancy/state/state.h"
+#include "engines/nancy/time.h"
+#include "engines/nancy/commontypes.h"
+
#include "engines/nancy/action/actionmanager.h"
#include "engines/nancy/ui/fullscreenimage.h"
@@ -33,20 +38,6 @@
#include "engines/nancy/ui/inventorybox.h"
#include "engines/nancy/ui/button.h"
-#include "engines/nancy/time.h"
-#include "engines/nancy/commontypes.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/sound.h"
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "common/str.h"
-#include "common/singleton.h"
-
-namespace Graphics {
- struct Surface;
-}
-
namespace Common {
class SeekableReadStream;
class Serializer;
@@ -55,6 +46,9 @@ class Serializer;
namespace Nancy {
class NancyEngine;
+class NancyConsole;
+class CheatDialog;
+struct SceneChangeDescription;
namespace Action {
class SliderPuzzle;
@@ -110,7 +104,7 @@ public:
Scene() :
_state (kInit),
_lastHint(-1),
- _gameStateRequested(NancyEngine::kNone),
+ _gameStateRequested(NancyState::kNone),
_frame(),
_viewport(),
_textbox(_frame),
@@ -136,7 +130,7 @@ public:
void addItemToInventory(uint16 id);
void removeItemFromInventory(uint16 id, bool pickUp = true);
int16 getHeldItem() const { return _flags.heldItem; }
- void setHeldItem(int16 id) { _flags.heldItem = id; g_nancy->_cursorManager->setCursorItemID(id); }
+ void setHeldItem(int16 id);
NancyFlag hasItem(int16 id) const { return _flags.items[id]; }
void setEventFlag(int16 label, NancyFlag flag = kTrue);
@@ -154,7 +148,7 @@ public:
byte getHintsRemaining() const { return _hintsRemaining[_difficulty]; }
void useHint(int hintID, int hintWeight);
- void requestStateChange(NancyEngine::GameState state) { _gameStateRequested = state; }
+ void requestStateChange(NancyState::NancyState state) { _gameStateRequested = state; }
void resetStateToInit() { _state = kInit; }
void resetAndStartTimer() { _timers.timerIsActive = true; _timers.timerTime = 0; }
@@ -251,7 +245,7 @@ private:
uint16 _difficulty;
Common::Array<uint16> _hintsRemaining;
int16 _lastHint;
- NancyEngine::GameState _gameStateRequested;
+ NancyState::NancyState _gameStateRequested;
Common::Rect _mapHotspot;
Common::Array<uint16> _mapAccessSceneIDs;
diff --git a/engines/nancy/state/state.h b/engines/nancy/state/state.h
index a70fcae0cf..489e2c1a49 100644
--- a/engines/nancy/state/state.h
+++ b/engines/nancy/state/state.h
@@ -23,8 +23,6 @@
#ifndef NANCY_STATE_STATE_H
#define NANCY_STATE_STATE_H
-#include "common/types.h"
-
namespace Nancy {
namespace State {
diff --git a/engines/nancy/ui/button.cpp b/engines/nancy/ui/button.cpp
index 4fc7d28fe5..66f1407ca5 100644
--- a/engines/nancy/ui/button.cpp
+++ b/engines/nancy/ui/button.cpp
@@ -22,14 +22,14 @@
#include "engines/nancy/ui/button.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/state/scene.h"
-
-#include "common/stream.h"
+#include "engines/nancy/sound.h"
namespace Nancy {
namespace UI {
@@ -59,7 +59,7 @@ void MenuButton::init() {
}
void MenuButton::onClick() {
- NancySceneState.requestStateChange(NancyEngine::kMainMenu);
+ NancySceneState.requestStateChange(NancyState::kMainMenu);
g_nancy->_sound->playSound(0x18);
setVisible(true);
}
@@ -79,7 +79,7 @@ void HelpButton::init() {
}
void HelpButton::onClick() {
- NancySceneState.requestStateChange(NancyEngine::kHelp);
+ NancySceneState.requestStateChange(NancyState::kHelp);
g_nancy->_sound->playSound(0x18);
setVisible(true);
}
diff --git a/engines/nancy/ui/fullscreenimage.cpp b/engines/nancy/ui/fullscreenimage.cpp
index 050c637454..967a38b95d 100644
--- a/engines/nancy/ui/fullscreenimage.cpp
+++ b/engines/nancy/ui/fullscreenimage.cpp
@@ -24,7 +24,6 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/resource.h"
-#include "engines/nancy/graphics.h"
namespace Nancy {
namespace UI {
diff --git a/engines/nancy/ui/inventorybox.cpp b/engines/nancy/ui/inventorybox.cpp
index badfcafd15..86b9443e06 100644
--- a/engines/nancy/ui/inventorybox.cpp
+++ b/engines/nancy/ui/inventorybox.cpp
@@ -22,16 +22,16 @@
#include "engines/nancy/ui/inventorybox.h"
+#include "engines/nancy/state/scene.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/cursor.h"
-#include "engines/nancy/state/scene.h"
+#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
-#include "common/events.h"
-
namespace Nancy {
namespace UI {
diff --git a/engines/nancy/ui/inventorybox.h b/engines/nancy/ui/inventorybox.h
index e3fd9c9bab..58a0d01193 100644
--- a/engines/nancy/ui/inventorybox.h
+++ b/engines/nancy/ui/inventorybox.h
@@ -23,14 +23,12 @@
#ifndef NANCY_UI_INVENTORYBOX_H
#define NANCY_UI_INVENTORYBOX_H
-#include "engines/nancy/renderobject.h"
+#include "common/array.h"
+#include "common/str.h"
-#include "engines/nancy/ui/scrollbar.h"
#include "engines/nancy/time.h"
-#include "common/array.h"
-#include "common/str.h"
-#include "common/rect.h"
+#include "engines/nancy/ui/scrollbar.h"
namespace Nancy {
diff --git a/engines/nancy/ui/scrollbar.cpp b/engines/nancy/ui/scrollbar.cpp
index 04cf810207..2398b764ec 100644
--- a/engines/nancy/ui/scrollbar.cpp
+++ b/engines/nancy/ui/scrollbar.cpp
@@ -22,15 +22,12 @@
#include "engines/nancy/ui/scrollbar.h"
+#include "common/stream.h"
+
#include "engines/nancy/nancy.h"
-#include "engines/nancy/commontypes.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
-#include "common/stream.h"
-#include "common/random.h"
-#include "common/events.h"
-
namespace Nancy {
namespace UI {
diff --git a/engines/nancy/ui/scrollbar.h b/engines/nancy/ui/scrollbar.h
index 2b6b0cdce9..7919aec04c 100644
--- a/engines/nancy/ui/scrollbar.h
+++ b/engines/nancy/ui/scrollbar.h
@@ -25,8 +25,6 @@
#include "engines/nancy/renderobject.h"
-#include "common/rect.h"
-
namespace Nancy {
struct NancyInput;
diff --git a/engines/nancy/ui/textbox.cpp b/engines/nancy/ui/textbox.cpp
index f560847e57..b848e40f0c 100644
--- a/engines/nancy/ui/textbox.cpp
+++ b/engines/nancy/ui/textbox.cpp
@@ -22,19 +22,16 @@
#include "engines/nancy/ui/textbox.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "common/util.h"
+
#include "engines/nancy/state/scene.h"
+
+#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/input.h"
-#include "common/error.h"
-#include "common/util.h"
-#include "common/events.h"
-#include "common/util.h"
-
namespace Nancy {
namespace UI {
diff --git a/engines/nancy/ui/textbox.h b/engines/nancy/ui/textbox.h
index 47837d0c48..86e20c88bd 100644
--- a/engines/nancy/ui/textbox.h
+++ b/engines/nancy/ui/textbox.h
@@ -23,14 +23,10 @@
#ifndef NANCY_UI_TEXTBOX_H
#define NANCY_UI_TEXTBOX_H
-#include "engines/nancy/renderobject.h"
-
-#include "engines/nancy/ui/scrollbar.h"
-
#include "common/str.h"
#include "common/array.h"
-#include "graphics/managed_surface.h"
+#include "engines/nancy/ui/scrollbar.h"
namespace Nancy {
diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp
index a673744575..d604f88b8e 100644
--- a/engines/nancy/ui/viewport.cpp
+++ b/engines/nancy/ui/viewport.cpp
@@ -28,8 +28,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/util.h"
-
-#include "graphics/transparent_surface.h"
+#include "engines/nancy/input.h"
namespace Nancy {
namespace UI {
diff --git a/engines/nancy/ui/viewport.h b/engines/nancy/ui/viewport.h
index d0661f45b0..033e11c47e 100644
--- a/engines/nancy/ui/viewport.h
+++ b/engines/nancy/ui/viewport.h
@@ -28,8 +28,9 @@
#include "engines/nancy/video.h"
#include "engines/nancy/time.h"
-#include "common/str.h"
-#include "common/rect.h"
+namespace Common {
+class String;
+}
namespace Nancy {
diff --git a/engines/nancy/video.cpp b/engines/nancy/video.cpp
index 41b3d4e14a..9717562a3b 100644
--- a/engines/nancy/video.cpp
+++ b/engines/nancy/video.cpp
@@ -21,20 +21,13 @@
*/
#include "engines/nancy/video.h"
-#include "engines/nancy/decompress.h"
-#include "engines/nancy/graphics.h"
-#include "engines/nancy/nancy.h"
-#include "common/endian.h"
-#include "common/stream.h"
-#include "common/system.h"
-#include "common/textconsole.h"
-#include "common/debug.h"
#include "common/memstream.h"
#include "common/substream.h"
-#include "graphics/surface.h"
-
+#include "engines/nancy/decompress.h"
+#include "engines/nancy/graphics.h"
+#include "engines/nancy/nancy.h"
namespace Nancy {
diff --git a/engines/nancy/video.h b/engines/nancy/video.h
index ce747c351a..f53805cb50 100644
--- a/engines/nancy/video.h
+++ b/engines/nancy/video.h
@@ -23,9 +23,7 @@
#ifndef NANCY_VIDEO_H
#define NANCY_VIDEO_H
-#include "graphics/pixelformat.h"
#include "video/video_decoder.h"
-#include "common/rational.h"
namespace Common {
class ReadStream;
More information about the Scummvm-git-logs
mailing list