22 #ifndef ALCACHOFA_ROOMS_H 23 #define ALCACHOFA_ROOMS_H 25 #include "alcachofa/objects.h" 33 static constexpr
const char *kClassName =
"CHabitacion";
37 inline World &world() {
return *_world; }
38 inline uint8 mapIndex()
const {
return _mapIndex; }
41 return _activeFloorI < 0 ? nullptr : &_floors[_activeFloorI];
44 return _activeFloorI < 0 ? 49 : activeFloor()->orderAt(query);
47 return _activeFloorI < 0 ? 1 : activeFloor()->depthAt(query);
49 inline uint8 characterAlphaTint()
const {
return _characterAlphaTint; }
51 inline bool fixedCameraOnEntering()
const {
return _fixedCameraOnEntering; }
52 inline int musicID()
const {
return _musicId; }
55 inline ObjectIterator beginObjects()
const {
return _objects.begin(); }
56 inline ObjectIterator endObjects()
const {
return _objects.end(); }
58 template<
class TObjectType>
59 TObjectType &getRequiredObjectByName(
const char *name)
const {
60 TObjectType *obj =
dynamic_cast<TObjectType *
>(getObjectByName(name));
61 scumm_assert(obj !=
nullptr);
67 virtual bool updateInput();
68 virtual void loadResources();
69 virtual void freeResources();
71 ObjectBase *getObjectByName(
const char *name)
const;
72 void toggleActiveFloor();
73 void debugPrint(
bool withObjects)
const;
80 void initBackground();
82 void updateRoomBounds();
83 void updateInteraction();
93 bool _fixedCameraOnEntering =
false;
94 int8 _activeFloorI = -1;
96 int16 _backgroundScale = kBaseScale;
99 _characterAlphaTint = 0,
108 static constexpr
const char *kClassName =
"CHabitacionConSuelo";
114 static constexpr
const char *kClassName =
"CHabitacionMenuOpciones";
117 bool updateInput()
override;
118 void loadResources()
override;
120 void clearLastSelectedObject();
129 static constexpr
const char *kClassName =
"CHabitacionConectar";
135 static constexpr
const char *kClassName =
"CHabitacionEsperar";
141 static constexpr
const char *kClassName =
"CInventario";
145 bool updateInput()
override;
148 void updateItemsByActiveCharacter();
149 void drawAsOverlay(int32 scrollY);
154 Item *getHoveredItem();
159 enum class GlobalAnimationKind {
166 MortadeloDisabledIcon,
168 InventoryDisabledIcon,
173 constexpr
char kNoXORKey = 0;
174 constexpr
char kEmbeddedXORKey = -128;
184 inline RoomIterator beginRooms()
const {
return _rooms.begin(); }
185 inline RoomIterator endRooms()
const {
return _rooms.end(); }
186 inline Room &globalRoom()
const { assert(_globalRoom !=
nullptr);
return *_globalRoom; }
187 inline Inventory &inventory()
const { assert(_inventory !=
nullptr);
return *_inventory; }
188 inline MainCharacter &filemon()
const { assert(_filemon !=
nullptr);
return *_filemon; }
189 inline MainCharacter &mortadelo()
const { assert(_mortadelo !=
nullptr);
return *_mortadelo; }
191 inline const Common::String &initScriptName()
const {
return _initScriptName; }
192 inline uint8 loadedMapCount()
const {
return _loadedMapCount; }
194 inline bool somebodyUsing(
ObjectBase *
object)
const {
195 return filemon().currentlyUsing() ==
object ||
196 mortadelo().currentlyUsing() == object;
199 MainCharacter &getMainCharacterByKind(MainCharacterKind kind)
const;
200 MainCharacter &getOtherMainCharacterByKind(MainCharacterKind kind)
const;
201 Room *getRoomByName(
const char *name)
const;
202 ObjectBase *getObjectByName(
const char *name)
const;
203 ObjectBase *getObjectByName(MainCharacterKind character,
const char *name)
const;
204 ObjectBase *getObjectByNameFromAnyRoom(
const char *name)
const;
207 const char *getDialogLine(int32 dialogId)
const;
209 void toggleObject(MainCharacterKind character,
const char *objName,
bool isEnabled);
216 bool loadWorldFileV3(
const char *path);
217 bool loadWorldFileV2(
const char *path);
218 bool loadWorldFileV1(
const char *path);
220 void loadLocalizedNames();
221 void loadDialogLines();
224 struct StringEqualTo {
225 bool operator()(
const char *a,
const char *b)
const {
return strcmp(a, b) == 0; }
233 Room *_globalRoom =
nullptr;
236 uint8 _loadedMapCount = 0;
239 StringEqualTo> _localizedNames;
242 bool _isLoading =
true;
247 #endif // ALCACHOFA_ROOMS_H Definition: objects.h:425
Definition: alcachofa.h:45
Definition: objects.h:124
Path finding is based on the Shape class with the invariant that every polygon is a convex polygon wi...
Definition: shape.h:159
Definition: serializer.h:80
const T * const_iterator
Definition: array.h:55
Definition: atari-cursor.h:35
References a game file either as path or as embedded byte range.
Definition: common.h:197
Definition: objects.h:601
Definition: hash-str.h:74
uint8 _characterAlphaPremultiplier
for some reason in percent instead of 0-255
Definition: rooms.h:100