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(); }
60 virtual bool updateInput();
61 virtual void loadResources();
62 virtual void freeResources();
64 ObjectBase *getObjectByName(
const char *name)
const;
65 void toggleActiveFloor();
66 void debugPrint(
bool withObjects)
const;
73 void initBackground();
75 void updateRoomBounds();
76 void updateInteraction();
86 bool _fixedCameraOnEntering =
false;
87 int8 _activeFloorI = -1;
89 int16 _backgroundScale = kBaseScale;
92 _characterAlphaTint = 0,
101 static constexpr
const char *kClassName =
"CHabitacionConSuelo";
107 static constexpr
const char *kClassName =
"CHabitacionMenuOpciones";
110 bool updateInput()
override;
111 void loadResources()
override;
113 void clearLastSelectedObject();
114 inline SlideButton *¤tSlideButton() {
return _currentSlideButton; }
124 static constexpr
const char *kClassName =
"CHabitacionConectar";
130 static constexpr
const char *kClassName =
"CHabitacionEsperar";
136 static constexpr
const char *kClassName =
"CInventario";
140 bool updateInput()
override;
143 void updateItemsByActiveCharacter();
144 void drawAsOverlay(int32 scrollY);
149 Item *getHoveredItem();
154 enum class GlobalAnimationKind {
161 MortadeloDisabledIcon,
163 InventoryDisabledIcon,
168 constexpr
char kNoXORKey = 0;
169 constexpr
char kEmbeddedXORKey = -128;
179 inline RoomIterator beginRooms()
const {
return _rooms.begin(); }
180 inline RoomIterator endRooms()
const {
return _rooms.end(); }
181 inline Room &globalRoom()
const { assert(_globalRoom !=
nullptr);
return *_globalRoom; }
182 inline Inventory &inventory()
const { assert(_inventory !=
nullptr);
return *_inventory; }
183 inline MainCharacter &filemon()
const { assert(_filemon !=
nullptr);
return *_filemon; }
184 inline MainCharacter &mortadelo()
const { assert(_mortadelo !=
nullptr);
return *_mortadelo; }
186 inline const Common::String &initScriptName()
const {
return _initScriptName; }
187 inline uint8 loadedMapCount()
const {
return _loadedMapCount; }
189 inline bool somebodyUsing(
ObjectBase *
object)
const {
190 return filemon().currentlyUsing() ==
object ||
191 mortadelo().currentlyUsing() == object;
194 MainCharacter &getMainCharacterByKind(MainCharacterKind kind)
const;
195 MainCharacter &getOtherMainCharacterByKind(MainCharacterKind kind)
const;
196 Room *getRoomByName(
const char *name)
const;
197 ObjectBase *getObjectByName(
const char *name)
const;
198 ObjectBase *getObjectByName(MainCharacterKind character,
const char *name)
const;
199 ObjectBase *getObjectByNameFromAnyRoom(
const char *name)
const;
202 const char *getDialogLine(int32 dialogId)
const;
204 void toggleObject(MainCharacterKind character,
const char *objName,
bool isEnabled);
211 bool loadWorldFileV3(
const char *path);
212 bool loadWorldFileV2(
const char *path);
213 bool loadWorldFileV1(
const char *path);
215 void loadLocalizedNames();
216 void loadDialogLines();
219 struct StringEqualTo {
220 bool operator()(
const char *a,
const char *b)
const {
return strcmp(a, b) == 0; }
231 uint8 _loadedMapCount = 0;
234 StringEqualTo> _localizedNames;
237 bool _isLoading =
true;
242 #endif // ALCACHOFA_ROOMS_H Definition: objects.h:396
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:79
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:572
Definition: hash-str.h:74
uint8 _characterAlphaPremultiplier
for some reason in percent instead of 0-255
Definition: rooms.h:93