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