[2190] | 1 | /*! |
---|
| 2 | \file world.h |
---|
| 3 | \brief Holds and manages all game data |
---|
| 4 | */ |
---|
[1853] | 5 | |
---|
[3224] | 6 | #ifndef _WORLD_H |
---|
| 7 | #define _WORLD_H |
---|
[1853] | 8 | |
---|
[2190] | 9 | #include "stdincl.h" |
---|
[2636] | 10 | #include "story_entity.h" |
---|
[2190] | 11 | |
---|
[2636] | 12 | |
---|
[3365] | 13 | class TrackManager; |
---|
[2077] | 14 | class WorldEntity; |
---|
[2636] | 15 | class Camera; |
---|
[3365] | 16 | class PNode; |
---|
| 17 | class GLMenuImageScreen; |
---|
[3430] | 18 | class Skysphere; |
---|
[1883] | 19 | |
---|
[2190] | 20 | //! The game environment |
---|
[2636] | 21 | class World : public StoryEntity { |
---|
[1853] | 22 | |
---|
| 23 | public: |
---|
[2636] | 24 | World (char* name); |
---|
| 25 | World (int worldID); |
---|
[3221] | 26 | virtual ~World (); |
---|
[2636] | 27 | |
---|
[3225] | 28 | virtual ErrorMessage init (); |
---|
| 29 | virtual ErrorMessage start (); |
---|
| 30 | virtual ErrorMessage stop (); |
---|
| 31 | virtual ErrorMessage pause (); |
---|
| 32 | virtual ErrorMessage resume (); |
---|
[1917] | 33 | |
---|
[3225] | 34 | virtual void load (); |
---|
| 35 | virtual void destroy (); |
---|
[2636] | 36 | |
---|
[3365] | 37 | //static void vertexCallback (GLfloat* vertex); |
---|
| 38 | |
---|
[3225] | 39 | void timeSlice (Uint32 deltaT); |
---|
[2636] | 40 | void collide (); |
---|
| 41 | void draw (); |
---|
| 42 | void update (); // maps Locations to Placements |
---|
[3365] | 43 | //void calcCameraPos (Location* loc, Placement* plc); |
---|
[2190] | 44 | |
---|
[2636] | 45 | void unload (); |
---|
[3225] | 46 | bool command (Command* cmd); |
---|
[3365] | 47 | virtual void displayLoadScreen(); |
---|
| 48 | virtual void releaseLoadScreen(); |
---|
[2636] | 49 | |
---|
[3216] | 50 | //bool system_command (Command* cmd); |
---|
[3225] | 51 | Camera* getCamera (); |
---|
[2644] | 52 | |
---|
[3225] | 53 | void spawn (WorldEntity* entity); |
---|
[3365] | 54 | void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); |
---|
[2644] | 55 | |
---|
[2822] | 56 | tList<WorldEntity>* entities; |
---|
[2636] | 57 | |
---|
| 58 | // base level data |
---|
[3365] | 59 | TrackManager* trackManager; |
---|
[2636] | 60 | Vector* pathnodes; |
---|
| 61 | Camera* localCamera; |
---|
| 62 | |
---|
[3365] | 63 | |
---|
| 64 | UPointCurve* testCurve; |
---|
[1883] | 65 | private: |
---|
[2636] | 66 | Uint32 lastFrame; //!> last time of frame |
---|
| 67 | bool bQuitOrxonox; //!> quit this application |
---|
| 68 | bool bQuitCurrentGame; //!> quit only the current game and return to menu |
---|
| 69 | bool bPause; |
---|
[1855] | 70 | |
---|
[3365] | 71 | GLMenuImageScreen* glmis; |
---|
| 72 | |
---|
[2636] | 73 | char* worldName; |
---|
| 74 | int debugWorldNr; |
---|
[2731] | 75 | GLuint objectList; |
---|
[3365] | 76 | SDL_Surface *loadImage; |
---|
[3430] | 77 | Skysphere* skySphere; |
---|
[2636] | 78 | |
---|
[2640] | 79 | WorldEntity* localPlayer; |
---|
[3365] | 80 | |
---|
| 81 | PNode* nullParent; |
---|
| 82 | |
---|
[3225] | 83 | void mainLoop (); |
---|
| 84 | void synchronize (); |
---|
[3226] | 85 | void handleInput (); |
---|
[3225] | 86 | void timeSlice (); |
---|
| 87 | void collision (); |
---|
| 88 | void display (); |
---|
| 89 | void debug (); |
---|
[3365] | 90 | |
---|
| 91 | void swap (unsigned char &a, unsigned char &b); /* \todo: this function doesn't belong here, this should be part of a image class*/ |
---|
[2190] | 92 | }; |
---|
[1883] | 93 | |
---|
[3224] | 94 | #endif /* _WORLD_H */ |
---|