| [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; |
|---|
| [3456] | 20 | class FontSet; |
|---|
| [1883] | 21 | |
|---|
| [3449] | 22 | //! The game world |
|---|
| 23 | /** |
|---|
| 24 | this class initializes everything that should be displayed inside of the current level. |
|---|
| 25 | it is the main driving factor during gameplay. |
|---|
| 26 | */ |
|---|
| [2636] | 27 | class World : public StoryEntity { |
|---|
| [1853] | 28 | |
|---|
| 29 | public: |
|---|
| [2636] | 30 | World (char* name); |
|---|
| 31 | World (int worldID); |
|---|
| [3221] | 32 | virtual ~World (); |
|---|
| [3459] | 33 | |
|---|
| 34 | |
|---|
| 35 | /* classes from story-entity */ |
|---|
| 36 | virtual ErrorMessage load (); |
|---|
| [3225] | 37 | virtual ErrorMessage init (); |
|---|
| 38 | virtual ErrorMessage start (); |
|---|
| 39 | virtual ErrorMessage stop (); |
|---|
| 40 | virtual ErrorMessage pause (); |
|---|
| 41 | virtual ErrorMessage resume (); |
|---|
| [3459] | 42 | virtual ErrorMessage destroy (); |
|---|
| [1917] | 43 | |
|---|
| [3459] | 44 | virtual void displayLoadScreen(); |
|---|
| 45 | virtual void releaseLoadScreen(); |
|---|
| [2636] | 46 | |
|---|
| [3365] | 47 | |
|---|
| [3459] | 48 | /* main functions for world-looping */ |
|---|
| 49 | |
|---|
| [2636] | 50 | void draw (); |
|---|
| 51 | void update (); // maps Locations to Placements |
|---|
| [3365] | 52 | //void calcCameraPos (Location* loc, Placement* plc); |
|---|
| [2190] | 53 | |
|---|
| [3225] | 54 | bool command (Command* cmd); |
|---|
| [3459] | 55 | |
|---|
| [2636] | 56 | |
|---|
| [3216] | 57 | //bool system_command (Command* cmd); |
|---|
| [3225] | 58 | Camera* getCamera (); |
|---|
| [2644] | 59 | |
|---|
| [3225] | 60 | void spawn (WorldEntity* entity); |
|---|
| [3365] | 61 | void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); |
|---|
| [2644] | 62 | |
|---|
| [3449] | 63 | tList<WorldEntity>* entities;//!< A template List of all entities. Every moving thing should be included here, and world automatically updates them. |
|---|
| [2636] | 64 | |
|---|
| 65 | // base level data |
|---|
| [3449] | 66 | TrackManager* trackManager; //!< The reference of the TrackManager that handles the course through the Level. |
|---|
| 67 | Camera* localCamera; //!< The current Camera |
|---|
| [2636] | 68 | |
|---|
| [3365] | 69 | |
|---|
| [1883] | 70 | private: |
|---|
| [3449] | 71 | Uint32 lastFrame; //!< last time of frame |
|---|
| 72 | bool bQuitOrxonox; //!< quit this application |
|---|
| 73 | bool bQuitCurrentGame; //!< quit only the current game and return to menu |
|---|
| 74 | bool bPause; //!< pause mode |
|---|
| [1855] | 75 | |
|---|
| [3456] | 76 | FontSet* testFont; //!< A test Font. \todo fix this, so it is for real. |
|---|
| [3449] | 77 | GLMenuImageScreen* glmis; //!< The Level-Loader Display |
|---|
| [3365] | 78 | |
|---|
| [3449] | 79 | char* worldName; //!< The name of this World |
|---|
| 80 | int debugWorldNr; //!< The Debug Nr. needed, if something goes wrong |
|---|
| 81 | GLuint objectList; //!< temporary: \todo this will be ereased soon |
|---|
| 82 | Skysphere* skySphere; //!< The Environmental Heaven of orxonox \todo insert this to environment insted |
|---|
| 83 | Light* light; //!< The Lights of the Level |
|---|
| [2636] | 84 | |
|---|
| [3449] | 85 | WorldEntity* localPlayer; //!< The Player, you fly through the level. |
|---|
| [3365] | 86 | |
|---|
| [3449] | 87 | PNode* nullParent; //!< The zero-point, that everything has as its parent. |
|---|
| [3365] | 88 | |
|---|
| [3225] | 89 | void mainLoop (); |
|---|
| 90 | void synchronize (); |
|---|
| [3226] | 91 | void handleInput (); |
|---|
| [3225] | 92 | void timeSlice (); |
|---|
| [3459] | 93 | void collide (); |
|---|
| [3225] | 94 | void display (); |
|---|
| 95 | void debug (); |
|---|
| [3365] | 96 | |
|---|
| 97 | void swap (unsigned char &a, unsigned char &b); /* \todo: this function doesn't belong here, this should be part of a image class*/ |
|---|
| [2190] | 98 | }; |
|---|
| [1883] | 99 | |
|---|
| [3224] | 100 | #endif /* _WORLD_H */ |
|---|