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 
46 class Game {
47  typedef void (*Message)(const char *s, ...);
48 public:
49  Game();
50  virtual ~Game() {}
51 
52  virtual void onLoadedGameFiles();
53  virtual Common::Point getResolution() = 0;
54  virtual const char *const *getMapFiles() = 0;
55  virtual Common::Span<const ScriptOp> getScriptOpMap() = 0;
56  virtual Common::Span<const ScriptKernelTask> getScriptKernelTaskMap() = 0;
57  virtual void updateScriptVariables() = 0;
58  virtual bool shouldClipCamera() = 0;
59  virtual void drawScreenStates();
60 
61  virtual bool doesRoomHaveBackground(const Room *room);
62  virtual void unknownRoomObject(const Common::String &type);
63  virtual void unknownRoomType(const Common::String &type);
64  virtual void unknownDoorTargetRoom(const Common::String &name);
65  virtual void unknownDoorTargetDoor(const Common::String &room, const Common::String &door);
66 
67  virtual void invalidDialogLine(uint index);
68  virtual void tooManyDialogLines(uint lineCount, uint maxLineCount);
69  virtual void tooManyDrawRequests(int order);
70 
71  virtual bool shouldCharacterTrigger(const Character *character, const char *action);
72  virtual bool shouldTriggerDoor(const Door *door);
73  virtual bool hasMortadeloVoice(const Character *character);
74  virtual void onUserChangedCharacter();
75 
76  virtual void unknownCamSetInactiveAttribute(int attribute);
77  virtual void unknownFadeType(int fadeType);
78  virtual void unknownSerializedObject(const char *object, const char *owner, const char *room);
79  virtual void unknownPickupItem(const char *name);
80  virtual void unknownDropItem(const char *name);
81  virtual void unknownVariable(const char *name);
82  virtual void unknownInstruction(const ScriptInstruction &instruction);
83  virtual void unknownAnimateObject(const char *name);
84  virtual void unknownScriptCharacter(const char *action, const char *name);
85  virtual PointObject *unknownGoPutTarget(const Process &process, const char *action, const char *name);
86  virtual void unknownChangeCharacterRoom(const char *name);
87  virtual void unknownAnimateCharacterObject(const char *name);
88  virtual void unknownSayTextCharacter(const char *name, int32 dialogId);
89  virtual void unknownAnimateTalkingObject(const char *name);
90  virtual void unknownClearInventoryTarget(int characterKind);
91  virtual void unknownCamLerpTarget(const char *action, const char *name);
92  virtual void unknownKernelTask(int task);
93  virtual void unknownScriptProcedure(const Common::String &procedure);
94 
95  virtual void missingAnimation(const Common::String &fileName);
96  virtual void missingSound(const Common::String &fileName);
97  virtual void invalidSNDFormat(uint format, uint channels, uint freq, uint bps);
98  virtual void notEnoughRoomDataRead(const char *path, int64 filePos, int64 objectEnd);
99  virtual void notEnoughObjectDataRead(const char *room, int64 filePos, int64 objectEnd);
100  virtual bool isKnownBadVideo(int32 videoId);
101  virtual void invalidVideo(int32 videoId, const char *context);
102 
103  static Game *createForMovieAdventure();
104 
105  const Message _message;
106 };
107 
108 }
109 
110 #endif // ALCACHOFA_GAME_H
Definition: alcachofa.h:45
Definition: str.h:59
Definition: scheduler.h:164
virtual PointObject * unknownGoPutTarget(const Process &process, const char *action, const char *name)
May return an alternative target to use.
Definition: objects.h:419
Provides functionality specific to a game title. Also includes all exemptions to inconsistencies in t...
Definition: game.h:46
Definition: rect.h:144
Definition: objects.h:399
Definition: objects.h:65
Definition: rooms.h:31
virtual const char *const * getMapFiles()=0
Returns a nullptr-terminated list.
Definition: script.h:146
Definition: span.h:691