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 Common::String reencodePath(const Common::String &path);
63  virtual const char *getDialogFileName() = 0;
64  virtual const char *getObjectFileName() = 0;
65  virtual char getTextFileKey() = 0;
66  virtual Common::Point getSubtitlePos() = 0;
67  virtual Common::Point getObjectNameOffset() = 0;
68  virtual const char *getMenuRoom() = 0;
69  virtual const char *getInitScriptName() = 0;
70  virtual int32 getKernelTaskArgCount(int32 kernelTaskI); // only necessary for V1
71  virtual Common::Path getVideoPath(int32 videoId) = 0;
72  virtual Common::String getSoundPath(const char *filename) = 0;
73  virtual Common::String getMusicPath(int32 trackId) = 0;
74  virtual int32 getCharacterJingle(MainCharacterKind kind) = 0;
75  virtual bool shouldMusicLoop();
76  virtual bool shouldFilterTexturesByDefault() = 0;
77  virtual bool shouldClipCamera() = 0;
78  virtual bool isAllowedToInteract() = 0;
79  virtual bool isAllowedToOpenMenu() = 0;
80  virtual bool shouldScriptLockInteraction() = 0;
81  virtual bool shouldChangeCharacterUseGameLock() = 0;
82  virtual bool shouldAvoidCollisions() = 0;
83  virtual Common::Point getMainCharacterSize() = 0;
84 
85  virtual bool doesRoomHaveBackground(const Room *room);
86  virtual void unknownRoomObject(const Common::String &type);
87  virtual void unknownRoomType(const Common::String &type);
88  virtual void unknownDoorTargetRoom(const Common::String &name);
89  virtual void unknownDoorTargetDoor(const Common::String &room, const Common::String &door);
90 
91  virtual void invalidDialogLine(uint index);
92  virtual void tooManyDialogLines(uint lineCount, uint maxLineCount);
93  virtual void tooManyDrawRequests(int order);
94 
95  virtual bool shouldCharacterTrigger(const Character *character, const char *action);
96  virtual bool shouldTriggerDoor(const Door *door);
97  virtual bool hasMortadeloVoice(const Character *character);
98  virtual void onUserChangedCharacter();
99 
100  virtual void unknownCamSetInactiveAttribute(int attribute);
101  virtual void unknownFadeType(int fadeType);
102  virtual void unknownSerializedObject(const char *object, const char *owner, const char *room);
103  virtual void unknownPickupItem(const char *name);
104  virtual void unknownDropItem(const char *name);
105  virtual void unknownVariable(const char *name);
106  virtual void unknownInstruction(const ScriptInstruction &instruction);
107  virtual void unknownAnimateObject(const char *name);
108  virtual void unknownScriptCharacter(const char *action, const char *name);
109  virtual PointObject *unknownGoPutTarget(const Process &process, const char *action, const char *name);
110  virtual void unknownChangeCharacterRoom(const char *name);
111  virtual void unknownAnimateCharacterObject(const char *name);
112  virtual Character *unknownSayTextCharacter(const char *name, int32 dialogId);
113  virtual void unknownAnimateTalkingObject(const char *name);
114  virtual void unknownClearInventoryTarget(int characterKind);
115  virtual PointObject *unknownCamLerpTarget(const char *action, const char *name);
116  virtual void unknownKernelTask(int task);
117  virtual void unknownScriptProcedure(const Common::String &procedure);
118  virtual void unknownMenuAction(int32 actionId);
119 
120  virtual void missingAnimation(const Common::String &fileName);
121  virtual void missingSound(const Common::String &fileName);
122  virtual void invalidSNDFormat(uint format, uint channels, uint freq, uint bps);
123  virtual void notEnoughRoomDataRead(const char *path, int64 filePos, int64 objectEnd);
124  virtual void notEnoughObjectDataRead(const char *room, int64 filePos, int64 objectEnd);
125  virtual bool isKnownBadVideo(int32 videoId);
126  virtual void invalidVideo(int32 videoId, const char *context);
127 
128  static Game *create();
129  static Game *createForMovieAdventureSpecial(); // V3
130  static Game *createForMovieAdventureOriginal(); // V1
131  static Game *createForTerror(); // V1
132  static Game *createForVaqueros(); // V1
133  static Game *createForSecta(); // V2
134  static Game *createForMoscu(); // V2
135  static Game *createForEscarabajo(); // V2
136 
137  const Message _message;
138 };
139 
140 }
141 
142 #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:492
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:472
Definition: objects.h:66
Definition: rooms.h:31
virtual const char *const * getMapFiles()=0
Returns a nullptr-terminated list.
Definition: script.h:146
Definition: span.h:691