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 | |
---|
10 | #include "stdincl.h" |
---|
11 | #include "story_entity.h" |
---|
12 | #include "skybox.h" |
---|
13 | class Material; |
---|
14 | |
---|
15 | |
---|
16 | class TrackManager; |
---|
17 | class Track; |
---|
18 | class WorldEntity; |
---|
19 | class Camera; |
---|
20 | class PNode; |
---|
21 | class GLMenuImageScreen; |
---|
22 | |
---|
23 | //! The game environment |
---|
24 | class World : public StoryEntity { |
---|
25 | |
---|
26 | public: |
---|
27 | World (char* name); |
---|
28 | World (int worldID); |
---|
29 | virtual ~World (); |
---|
30 | |
---|
31 | virtual ErrorMessage init (); |
---|
32 | virtual ErrorMessage start (); |
---|
33 | virtual ErrorMessage stop (); |
---|
34 | virtual ErrorMessage pause (); |
---|
35 | virtual ErrorMessage resume (); |
---|
36 | |
---|
37 | virtual void load (); |
---|
38 | virtual void destroy (); |
---|
39 | |
---|
40 | //static void vertexCallback (GLfloat* vertex); |
---|
41 | |
---|
42 | void timeSlice (Uint32 deltaT); |
---|
43 | void collide (); |
---|
44 | void draw (); |
---|
45 | void update (); // maps Locations to Placements |
---|
46 | //void calcCameraPos (Location* loc, Placement* plc); |
---|
47 | |
---|
48 | void unload (); |
---|
49 | bool command (Command* cmd); |
---|
50 | virtual void displayLoadScreen(); |
---|
51 | virtual void releaseLoadScreen(); |
---|
52 | |
---|
53 | void setTrackLen (Uint32 tracklen); |
---|
54 | int getTrackLen (); |
---|
55 | //bool system_command (Command* cmd); |
---|
56 | Camera* getCamera (); |
---|
57 | |
---|
58 | void spawn (WorldEntity* entity); |
---|
59 | void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir); |
---|
60 | |
---|
61 | tList<WorldEntity>* entities; |
---|
62 | |
---|
63 | |
---|
64 | // base level data |
---|
65 | |
---|
66 | TrackManager* trackManager; |
---|
67 | Track* track; |
---|
68 | Uint32 tracklen; // number of Tracks the World consist of |
---|
69 | Vector* pathnodes; |
---|
70 | Camera* localCamera; |
---|
71 | |
---|
72 | |
---|
73 | UPointCurve* testCurve; |
---|
74 | private: |
---|
75 | Uint32 lastFrame; //!> last time of frame |
---|
76 | bool bQuitOrxonox; //!> quit this application |
---|
77 | bool bQuitCurrentGame; //!> quit only the current game and return to menu |
---|
78 | bool bPause; |
---|
79 | |
---|
80 | GLMenuImageScreen* glmis; |
---|
81 | |
---|
82 | char* worldName; |
---|
83 | int debugWorldNr; |
---|
84 | GLuint objectList; |
---|
85 | SDL_Surface *loadImage; |
---|
86 | |
---|
87 | WorldEntity* localPlayer; |
---|
88 | Skybox* skybox; |
---|
89 | |
---|
90 | PNode* nullParent; |
---|
91 | |
---|
92 | void mainLoop (); |
---|
93 | void synchronize (); |
---|
94 | void handleInput (); |
---|
95 | void timeSlice (); |
---|
96 | void collision (); |
---|
97 | void display (); |
---|
98 | void debug (); |
---|
99 | |
---|
100 | void swap (unsigned char &a, unsigned char &b); /* \todo: this function doesn't belong here, this should be part of a image class*/ |
---|
101 | }; |
---|
102 | |
---|
103 | #endif /* _WORLD_H */ |
---|