25 #ifndef FREESCAPE_AREA_H 26 #define FREESCAPE_AREA_H 29 #include "math/vector3d.h" 31 #include "freescape/language/instruction.h" 32 #include "freescape/objects/object.h" 33 #include "freescape/objects/group.h" 42 Area(uint16 areaID, uint16 areaFlags, ObjectMap *objectsByID, ObjectMap *entrancesByID,
bool isCastle);
46 Object *objectWithID(uint16 objectID);
47 Object *entranceWithID(uint16 objectID);
50 void changeObjectID(uint16 objectID, uint16 newObjectID);
51 ObjectArray getSensors();
54 ObjectMap *getObjectsByID() {
return _objectsByID; }
55 ObjectMap *getEntrancesByID() {
return _entrancesByID; }
56 uint16 getAreaFlags();
58 void remapColor(
int index,
int color);
59 void unremapColor(
int index);
60 void draw(
Renderer *gfx, uint32 animationTicks, Math::Vector3d camera, Math::Vector3d direction,
bool insideWait);
61 void drawGroup(
Renderer *gfx,
Group *group,
bool runAnimation);
64 Object *checkCollisionRay(
const Math::Ray &ray,
int raySize);
65 bool checkInSight(
const Math::Ray &ray,
float maxDistance);
66 Math::Vector3d separateFromWall(
const Math::Vector3d &position);
67 ObjectArray checkCollisions(
const Math::AABB &boundingBox);
68 bool checkIfPlayerWasCrushed(
const Math::AABB &boundingBox);
69 Math::Vector3d resolveCollisions(Math::Vector3d
const &lastPosition, Math::Vector3d
const &newPosition,
int playerHeight);
70 void addObjectFromArea(int16
id,
Area *global);
71 void addGroupFromArea(int16
id,
Area *global);
72 void addObject(
Object *obj);
74 void addStructure(
Area *global);
75 void removeObject(int16
id);
77 void resetAreaGroups();
79 bool hasActiveGroups();
90 uint32 _gasPocketRadius;
98 uint8 _usualBackgroundColor;
99 uint8 _underFireBackgroundColor;
102 uint8 _extraColor[4];
109 Math::Vector3d _lastCameraPosition;
110 ObjectArray _sortedObjects;
114 ObjectMap *_objectsByID;
115 ObjectMap *_entrancesByID;
116 ObjectArray _drawableObjects;
117 ObjectMap _addedObjects;
118 Object *objectWithIDFromMap(ObjectMap *map, uint16 objectID);
123 #endif // FREESCAPE_AREA_H