[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 | |
---|
[3335] | 13 | class TrackManager; |
---|
[2190] | 14 | class Track; |
---|
[2077] | 15 | class WorldEntity; |
---|
[2636] | 16 | class Camera; |
---|
[3276] | 17 | class PNode; |
---|
[1883] | 18 | |
---|
[2190] | 19 | //! The game environment |
---|
[2636] | 20 | class World : public StoryEntity { |
---|
[1853] | 21 | |
---|
| 22 | public: |
---|
[2636] | 23 | World (char* name); |
---|
| 24 | World (int worldID); |
---|
[3221] | 25 | virtual ~World (); |
---|
[2636] | 26 | |
---|
[3225] | 27 | virtual ErrorMessage init (); |
---|
| 28 | virtual ErrorMessage start (); |
---|
| 29 | virtual ErrorMessage stop (); |
---|
| 30 | virtual ErrorMessage pause (); |
---|
| 31 | virtual ErrorMessage resume (); |
---|
[1917] | 32 | |
---|
[3225] | 33 | virtual void load (); |
---|
| 34 | virtual void destroy (); |
---|
[2636] | 35 | |
---|
[3311] | 36 | //static void vertexCallback (GLfloat* vertex); |
---|
| 37 | |
---|
[3225] | 38 | void timeSlice (Uint32 deltaT); |
---|
[2636] | 39 | void collide (); |
---|
| 40 | void draw (); |
---|
| 41 | void update (); // maps Locations to Placements |
---|
[3342] | 42 | //void calcCameraPos (Location* loc, Placement* plc); |
---|
[2190] | 43 | |
---|
[2636] | 44 | void unload (); |
---|
[3225] | 45 | bool command (Command* cmd); |
---|
[3336] | 46 | virtual void displayLoadScreen(); |
---|
| 47 | virtual void releaseLoadScreen(); |
---|
[2636] | 48 | |
---|
[3225] | 49 | void setTrackLen (Uint32 tracklen); |
---|
| 50 | int getTrackLen (); |
---|
[3216] | 51 | //bool system_command (Command* cmd); |
---|
[3225] | 52 | Camera* getCamera (); |
---|
[2644] | 53 | |
---|
[3225] | 54 | void spawn (WorldEntity* entity); |
---|
[3306] | 55 | void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); |
---|
[2644] | 56 | |
---|
[2822] | 57 | tList<WorldEntity>* entities; |
---|
[2636] | 58 | |
---|
| 59 | // base level data |
---|
[3335] | 60 | TrackManager* trackManager; |
---|
[2636] | 61 | Track* track; |
---|
| 62 | Uint32 tracklen; // number of Tracks the World consist of |
---|
| 63 | Vector* pathnodes; |
---|
| 64 | Camera* localCamera; |
---|
| 65 | |
---|
[3319] | 66 | |
---|
[3327] | 67 | UPointCurve* testCurve; |
---|
[1883] | 68 | private: |
---|
[2636] | 69 | Uint32 lastFrame; //!> last time of frame |
---|
| 70 | bool bQuitOrxonox; //!> quit this application |
---|
| 71 | bool bQuitCurrentGame; //!> quit only the current game and return to menu |
---|
| 72 | bool bPause; |
---|
[1855] | 73 | |
---|
[2636] | 74 | char* worldName; |
---|
| 75 | int debugWorldNr; |
---|
[2731] | 76 | GLuint objectList; |
---|
[3336] | 77 | SDL_Surface *loadImage; |
---|
[2636] | 78 | |
---|
[2640] | 79 | WorldEntity* localPlayer; |
---|
[3276] | 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 (); |
---|
[3338] | 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 */ |
---|