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