aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/startrek.h
diff options
context:
space:
mode:
authorMatthew Stewart2018-05-11 02:17:57 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commitd375429abef0109a483970975b053292efa4bd6e (patch)
tree448bd50bc330010834b3e1f655903bf1b2d7e93e /engines/startrek/startrek.h
parentfde5f22f9783c557c74d0267d8118c1a0c6d498e (diff)
downloadscummvm-rg350-d375429abef0109a483970975b053292efa4bd6e.tar.gz
scummvm-rg350-d375429abef0109a483970975b053292efa4bd6e.tar.bz2
scummvm-rg350-d375429abef0109a483970975b053292efa4bd6e.zip
STARTREK: Objects and animations.
Testing them with the transporter room.
Diffstat (limited to 'engines/startrek/startrek.h')
-rw-r--r--engines/startrek/startrek.h61
1 files changed, 53 insertions, 8 deletions
diff --git a/engines/startrek/startrek.h b/engines/startrek/startrek.h
index 5e81f77a26..6cb175c689 100644
--- a/engines/startrek/startrek.h
+++ b/engines/startrek/startrek.h
@@ -36,6 +36,7 @@
#include "startrek/filestream.h"
#include "startrek/graphics.h"
+#include "startrek/object.h"
#include "startrek/room.h"
#include "startrek/sound.h"
@@ -58,10 +59,25 @@ enum StarTrekGameFeatures {
};
enum kDebugLevels {
- kDebugSound = 1 << 0
+ kDebugSound = 1 << 0,
+ kDebugGraphics = 1 << 1
};
+enum GameMode {
+ GAMEMODE_START = 0,
+ GAMEMODE_BRIDGE,
+ GAMEMODE_AWAYMISSION,
+ GAMEMODE_BEAMDOWN,
+ GAMEMODE_BEAMUP
+};
+
+enum TextDisplayMode {
+ TEXTDISPLAY_WAIT = 0, // Wait for input before closing text
+ TEXTDISPLAY_SUBTITLES, // Automatically continue when speech is done
+ TEXTDISPLAY_NONE // No text displayed
+};
+
enum TrekEventType {
TREKEVENT_TICK = 0, // DOS clock changes (see updateClockTicks)
TREKEVENT_LBUTTONDOWN = 1,
@@ -72,12 +88,6 @@ enum TrekEventType {
TREKEVENT_KEYDOWN = 6
};
-enum TextDisplayMode {
- TEXTDISPLAY_WAIT = 0, // Wait for input before closing text
- TEXTDISPLAY_SUBTITLES, // Automatically continue when speech is done
- TEXTDISPLAY_NONE // No text displayed
-};
-
struct TrekEvent {
TrekEventType type;
Common::KeyState kbd;
@@ -85,6 +95,8 @@ struct TrekEvent {
uint32 tick;
};
+const int MAX_OBJECTS = 0x20;
+
struct StarTrekGameDescription;
class Graphics;
class Sound;
@@ -93,6 +105,11 @@ class StarTrekEngine : public ::Engine {
protected:
Common::Error run();
+private:
+ // Game modes
+ Common::Error runGameMode(int mode);
+ void runTransportSequence(const Common::String &name);
+
public:
StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gamedesc);
virtual ~StarTrekEngine();
@@ -105,6 +122,18 @@ public:
void playSpeech(const Common::String &filename);
void stopPlayingSpeech();
+ // Objects
+ void initObjects();
+ int loadAnimationForObject(int objectIndex, const Common::String &animName, uint16 x, uint16 y, uint16 arg8);
+ void updateObjectAnimations();
+ void removeObjectFromScreen(int objectIndex);
+ void objectFunc1();
+ void drawObjectToScreen(Object *object, const Common::String &animName, uint16 field5e, uint16 field60, uint16 arg8, bool addSprite);
+ void releaseAnim(Object *object);
+
+ SharedPtr<Bitmap> loadAnimationFrame(const Common::String &filename, uint16 arg2);
+ Common::String getCrewmanAnimFilename(int objectIndex, const Common::String &basename);
+
// Events
public:
void initializeEventsAndMouse();
@@ -138,14 +167,30 @@ public:
Common::Language getLanguage();
// Resource related functions
- SharedPtr<FileStream> openFile(Common::String filename, int fileIndex=0);
+ SharedPtr<FileStream> loadFile(Common::String filename, int fileIndex=0);
// Movie related functions
void playMovie(Common::String filename);
void playMovieMac(Common::String filename);
+public:
+ int _gameMode;
+ int _lastGameMode;
+ bool _redshirtDead;
+ Common::String _missionToLoad;
+
+ Object _objectList[MAX_OBJECTS];
+ Object * const _kirkObject;
+ Object * const _spockObject;
+ Object * const _mccoyObject;
+ Object * const _redshirtObject;
+
+ SharedPtr<FileStream> _objectBanFiles[MAX_OBJECTS / 2];
+ uint16 _objectBanVar2[MAX_OBJECTS / 2]; // TODO: initialize?
+
uint32 _clockTicks;
+ uint32 _frameIndex;
bool _musicEnabled;
bool _sfxEnabled;