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