aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent/teenagent.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/teenagent/teenagent.h')
-rw-r--r--engines/teenagent/teenagent.h106
1 files changed, 81 insertions, 25 deletions
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 737f07ba85..d6a2c0d3c6 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -23,12 +23,15 @@
#define TEENAGENT_ENGINE_H
#include "engines/engine.h"
-#include "teenagent/pack.h"
-#include "teenagent/resources.h"
-#include "teenagent/inventory.h"
+
#include "audio/audiostream.h"
#include "audio/mixer.h"
+
#include "common/random.h"
+#include "common/rect.h"
+#include "common/array.h"
+
+#include "teenagent/dialog.h"
struct ADGameDescription;
@@ -43,14 +46,34 @@ struct ADGameDescription;
namespace TeenAgent {
struct Object;
+struct UseHotspot;
class Scene;
class MusicPlayer;
+class Dialog;
class Console;
+class Resources;
+class Inventory;
+
+// Engine Debug Flags
+enum {
+ kDebugActor = (1 << 0),
+ kDebugAnimation = (1 << 1),
+ kDebugCallbacks = (1 << 2),
+ kDebugDialog = (1 << 3),
+ kDebugFont = (1 << 4),
+ kDebugInventory = (1 << 5),
+ kDebugMusic = (1 << 6),
+ kDebugObject = (1 << 7),
+ kDebugPack = (1 << 8),
+ kDebugScene = (1 << 9),
+ kDebugSurface = (1 << 10)
+};
+
+const uint16 kScreenWidth = 320;
+const uint16 kScreenHeight = 200;
class TeenAgentEngine : public Engine {
public:
- enum Action { kActionNone, kActionExamine, kActionUse };
-
TeenAgentEngine(OSystem *system, const ADGameDescription *gd);
~TeenAgentEngine();
@@ -58,15 +81,16 @@ public:
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc);
virtual bool canLoadGameStateCurrently() { return true; }
- virtual bool canSaveGameStateCurrently() { return !scene_busy; }
+ virtual bool canSaveGameStateCurrently() { return !_sceneBusy; }
virtual bool hasFeature(EngineFeature f) const;
void init();
- void deinit();
+
+ enum Action { kActionNone, kActionExamine, kActionUse };
void examine(const Common::Point &point, Object *object);
void use(Object *object);
- inline void cancel() { action = kActionNone; }
+ inline void cancel() { _action = kActionNone; }
bool processCallback(uint16 addr);
inline Scene *getScene() { return scene; }
@@ -76,15 +100,15 @@ public:
bool showMetropolis();
int skipEvents() const;
- static Common::String parseMessage(uint16 addr);
+ Common::String parseMessage(uint16 addr);
//event driven:
- void displayMessage(uint16 addr, byte color = 0xd1, uint16 position = 0);
- void displayMessage(const Common::String &str, byte color = 0xd1, uint16 position = 0);
- void displayAsyncMessage(uint16 addr, uint16 position, uint16 first_frame, uint16 last_frame, byte color = 0xd1);
- void displayAsyncMessageInSlot(uint16 addr, byte slot, uint16 first_frame, uint16 last_frame, byte color = 0xd1);
+ void displayMessage(uint16 addr, byte color = textColorMark, uint16 x = 0, uint16 y = 0);
+ void displayMessage(const Common::String &str, byte color = textColorMark, uint16 x = 0, uint16 y = 0);
+ void displayAsyncMessage(uint16 addr, uint16 x, uint16 y, uint16 firstFrame, uint16 lastFrame, byte color = textColorMark);
+ void displayAsyncMessageInSlot(uint16 addr, byte slot, uint16 firstFrame, uint16 lastFrame, byte color = textColorMark);
void displayCredits(uint16 addr, uint16 timer = 0);
- void displayCutsceneMessage(uint16 addr, uint16 position);
+ void displayCutsceneMessage(uint16 addr, uint16 x, uint16 y);
void moveTo(const Common::Point &dst, byte o, bool warp = false);
void moveTo(uint16 x, uint16 y, byte o, bool warp = false);
void moveTo(Object *obj);
@@ -94,18 +118,18 @@ public:
void loadScene(byte id, const Common::Point &pos, byte o = 0);
void loadScene(byte id, uint16 x, uint16 y, byte o = 0);
void enableOn(bool enable = true);
- void setOns(byte id, byte value, byte scene_id = 0);
- void setLan(byte id, byte value, byte scene_id = 0);
+ void setOns(byte id, byte value, byte sceneId = 0);
+ void setLan(byte id, byte value, byte sceneId = 0);
void setFlag(uint16 addr, byte value);
byte getFlag(uint16 addr);
void reloadLan();
void rejectMessage();
void playMusic(byte id); //schedules play
- void playSound(byte id, byte skip_frames);
+ void playSound(byte id, byte skipFrames);
void playSoundNow(byte id);
- void enableObject(byte id, byte scene_id = 0);
- void disableObject(byte id, byte scene_id = 0);
+ void enableObject(byte id, byte sceneId = 0);
+ void disableObject(byte id, byte sceneId = 0);
void hideActor();
void showActor();
void waitAnimation();
@@ -119,9 +143,11 @@ public:
Common::RandomSource _rnd;
+ Resources *res;
Scene *scene;
Inventory *inventory;
MusicPlayer *music;
+ Dialog *dialog;
Console *console;
void setMusic(byte id);
@@ -130,17 +156,47 @@ private:
void processObject();
bool trySelectedObject();
- bool scene_busy;
- Action action;
- Object *dst_object;
+ bool _sceneBusy;
+ Action _action;
+ Object *_dstObject;
Audio::AudioStream *_musicStream;
Audio::SoundHandle _musicHandle, _soundHandle;
const ADGameDescription *_gameDescription;
- uint _mark_delay, _game_delay;
-
- Common::Array<Common::Array<UseHotspot> > use_hotspots;
+ uint _markDelay, _gameDelay;
+
+ Common::Array<Common::Array<UseHotspot> > _useHotspots;
+
+ void fnIntro();
+ void fnPoleClimbFail();
+ void fnGotAnchor();
+ void fnGetOutOfLake();
+ void fnGuardDrinking();
+ void fnEgoDefaultPosition();
+ void fnEnterCave();
+ void fnEgoScaredBySpider();
+ void fnMoveToLadderAndLeaveCellar();
+ void fnLeaveCellar();
+ void fnPutRockInHole();
+ void fnEgoBottomRightTurn();
+ bool fnCheckingDrawers();
+ void fnDrawerOpenMessage();
+ bool fnRobotSafeAlreadyUnlockedCheck();
+ void fnRobotSafeUnlockCheck();
+ bool fnMansionIntrusionAttempt();
+ void fnSecondMansionIntrusion();
+ void fnThirdMansionIntrusion();
+ void fnFourthMansionIntrusion();
+ void fnFifthMansionIntrusion();
+ void fnSixthMansionIntrusion();
+ void fnTooDark();
+ bool fnIsCookGone();
+ void fnEgoSuspiciousPosition();
+ void fnGivingFlowerToOldLady();
+ void fnGiveAnotherFlowerToOldLady();
+ void fnGivingFlowerToAnne();
+ void fnGiveAnotherFlowerToAnne();
};
} // End of namespace TeenAgent