ScummVM API documentation
game.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ALCACHOFA_GAME_H
23 #define ALCACHOFA_GAME_H
24 
25 #include "alcachofa/script.h"
26 
27 #include "common/textconsole.h"
28 #include "common/file.h"
29 
30 namespace Alcachofa {
31 
32 class ObjectBase;
33 class PointObject;
34 class Character;
35 class Door;
36 class Room;
37 class Process;
38 struct ScriptInstruction;
39 class GlobalUI;
40 
47 class Game {
48  typedef void (*Message)(const char *s, ...);
49 public:
50  Game();
51  virtual ~Game() {}
52 
53  virtual void onLoadedGameFiles();
54  virtual Common::Point getResolution() = 0;
55  virtual Common::Point getThumbnailResolution() = 0;
56  virtual const char *const *getMapFiles() = 0;
57  virtual GameFileReference getScriptFileRef() = 0;
58  virtual Common::Span<const ScriptOp> getScriptOpMap() = 0;
59  virtual Common::Span<const ScriptKernelTask> getScriptKernelTaskMap() = 0;
60  virtual void updateScriptVariables() = 0;
61  virtual void drawScreenStates();
62  virtual const char *getDialogFileName() = 0;
63  virtual const char *getObjectFileName() = 0;
64  virtual char getTextFileKey() = 0;
65  virtual Common::Point getSubtitlePos() = 0;
66  virtual const char *getMenuRoom() = 0;
67  virtual const char *getInitScriptName() = 0;
68  virtual int32 getKernelTaskArgCount(int32 kernelTaskI); // only necessary for V1
69  virtual Common::Path getVideoPath(int32 videoId) = 0;
70  virtual Common::String getSoundPath(const char *filename) = 0;
71  virtual Common::String getMusicPath(int32 trackId) = 0;
72  virtual int32 getCharacterJingle(MainCharacterKind kind) = 0;
73  virtual bool shouldFilterTexturesByDefault() = 0;
74  virtual bool shouldClipCamera() = 0;
75  virtual bool isAllowedToInteract() = 0;
76  virtual bool isAllowedToOpenMenu() = 0;
77  virtual bool shouldScriptLockInteraction() = 0;
78  virtual bool shouldChangeCharacterUseGameLock() = 0;
79  virtual bool shouldAvoidCollisions() = 0;
80  virtual Common::Point getMainCharacterSize() = 0;
81 
82  virtual bool doesRoomHaveBackground(const Room *room);
83  virtual void unknownRoomObject(const Common::String &type);
84  virtual void unknownRoomType(const Common::String &type);
85  virtual void unknownDoorTargetRoom(const Common::String &name);
86  virtual void unknownDoorTargetDoor(const Common::String &room, const Common::String &door);
87 
88  virtual void invalidDialogLine(uint index);
89  virtual void tooManyDialogLines(uint lineCount, uint maxLineCount);
90  virtual void tooManyDrawRequests(int order);
91 
92  virtual bool shouldCharacterTrigger(const Character *character, const char *action);
93  virtual bool shouldTriggerDoor(const Door *door);
94  virtual bool hasMortadeloVoice(const Character *character);
95  virtual void onUserChangedCharacter();
96 
97  virtual void unknownCamSetInactiveAttribute(int attribute);
98  virtual void unknownFadeType(int fadeType);
99  virtual void unknownSerializedObject(const char *object, const char *owner, const char *room);
100  virtual void unknownPickupItem(const char *name);
101  virtual void unknownDropItem(const char *name);
102  virtual void unknownVariable(const char *name);
103  virtual void unknownInstruction(const ScriptInstruction &instruction);
104  virtual void unknownAnimateObject(const char *name);
105  virtual void unknownScriptCharacter(const char *action, const char *name);
106  virtual PointObject *unknownGoPutTarget(const Process &process, const char *action, const char *name);
107  virtual void unknownChangeCharacterRoom(const char *name);
108  virtual void unknownAnimateCharacterObject(const char *name);
109  virtual Character *unknownSayTextCharacter(const char *name, int32 dialogId);
110  virtual void unknownAnimateTalkingObject(const char *name);
111  virtual void unknownClearInventoryTarget(int characterKind);
112  virtual PointObject *unknownCamLerpTarget(const char *action, const char *name);
113  virtual void unknownKernelTask(int task);
114  virtual void unknownScriptProcedure(const Common::String &procedure);
115  virtual void unknownMenuAction(int32 actionId);
116 
117  virtual void missingAnimation(const Common::String &fileName);
118  virtual void missingSound(const Common::String &fileName);
119  virtual void invalidSNDFormat(uint format, uint channels, uint freq, uint bps);
120  virtual void notEnoughRoomDataRead(const char *path, int64 filePos, int64 objectEnd);
121  virtual void notEnoughObjectDataRead(const char *room, int64 filePos, int64 objectEnd);
122  virtual bool isKnownBadVideo(int32 videoId);
123  virtual void invalidVideo(int32 videoId, const char *context);
124 
125  static Game *create();
126  static Game *createForMovieAdventureSpecial(); // V3
127  static Game *createForMovieAdventureOriginal(); // V1
128  static Game *createForTerror(); // V1
129  static Game *createForVaqueros(); // V1
130  static Game *createForSecta(); // V2
131 
132  const Message _message;
133 };
134 
135 }
136 
137 #endif // ALCACHOFA_GAME_H
Definition: alcachofa.h:45
Definition: str.h:59
virtual Common::String getSoundPath(const char *filename)=0
Without file-extension.
Definition: scheduler.h:164
virtual PointObject * unknownGoPutTarget(const Process &process, const char *action, const char *name)
May return an alternative target to use.
Definition: path.h:52
virtual bool isAllowedToOpenMenu()=0
only the game-specific condition
Definition: objects.h:463
virtual Common::String getMusicPath(int32 trackId)=0
Without file-extension.
References a game file either as path or as embedded byte range.
Definition: common.h:197
Provides functionality specific to a game title / engine version. Also includes all exemptions to inc...
Definition: game.h:47
Definition: rect.h:144
Definition: objects.h:443
Definition: objects.h:66
Definition: rooms.h:31
virtual const char *const * getMapFiles()=0
Returns a nullptr-terminated list.
Definition: script.h:147
Definition: span.h:691