Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/story_entities/game_world.h @ 7304

Last change on this file since 7304 was 7304, checked in by bensch, 18 years ago

orxonox/trunk: moved the AudioThread completely to the OggPlayer. This cleans out the unnecesary overFULLNESS from game_world

File size: 3.0 KB
RevLine 
[6352]1/*!
2 * @file game_world.h
3 *  container for all game worlds (singleplayers, multiplayers..)
4 */
5
6#ifndef _GAME_WORLD_H
7#define _GAME_WORLD_H
8
[6402]9
[6352]10#include "story_entity.h"
[6498]11#include "game_world_data.h"
[6352]12
13class Shell;
[6402]14class WorldEntity;
[6352]15
[7131]16/** How many frames time values to keep
17 * The higher the value the smoother the result is...
18 * Don't make it 0 or less :)
19 */
20#define TICK_SMOOTH_VALUE 10
[6402]21
[6352]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 */
27class GameWorld : public StoryEntity
28{
29
30  public:
[6989]31    GameWorld ();
[6352]32    virtual ~GameWorld ();
33
[6512]34    virtual void loadParams(const TiXmlElement* root);
[6352]35
[6370]36    /* functions from story-entity */
37    virtual ErrorMessage init();
[6372]38    virtual ErrorMessage loadData();
[6387]39    virtual ErrorMessage unloadData();
[6352]40
[6387]41    virtual bool start();
42    virtual bool stop();
43    virtual bool pause();
44    virtual bool resume();
45    virtual void run();
[6352]46
[6366]47    /**  this returns the current game time @returns elapsed game time     */
48    inline double getGameTime() { return this->gameTime; }
49    /** sets the game speed @param speed speed of the Game */
[6352]50    inline void setSpeed(float speed) { this->speed = speed; };
[6366]51    /**  returns the track path of this world @returns the track path */
[6352]52
[7004]53    static void togglePNodeVisibility();
54    static void toggleBVVisibility();
[6352]55
[6498]56    inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; }
57
58
[6352]59  protected:
60    /* world - running functions */
[6386]61    virtual void synchronize();
62    virtual void handleInput();
63    virtual void tick(std::list<WorldEntity*> worldEntity, float dt);
64    virtual void tick();
65    virtual void update();
66    virtual void collide();
67    virtual void draw();
68    virtual void display();
[6352]69
70
[6386]71  private:
72    void displayLoadScreen();
73    void releaseLoadScreen();
74
75
[6352]76  protected:
[6407]77    GameWorldData*      dataTank;                     //!< reference to the GameWorld Data Tank
[6845]78    TiXmlElement*       dataXML;                      //!< The XML-Element this World has been loaded with.
[6352]79
[6387]80    bool                showPNodes;                   //!< if the PNodes should be visible.
81    bool                showBV;                       //!< if the Bounding Volumes should be visible.
[6352]82
83    /* world timing */
[7131]84    Uint32              lastFrame;                    //!< last time of frame (in MiliSeconds)
[6402]85    Uint32              cycle;                        //!< The cycle we are in (starts with 0 and rises with every frame)
86    float               dtS;                          //!< The time needed for caluculations in seconds
87    float               speed;                        //!< how fast the game flows
88    double              gameTime;                     //!< this is where the game time is saved
[7131]89    Uint32              frameTimes[TICK_SMOOTH_VALUE];//!< The time used for the last TICK_SMOOTH_VALUE's frames.
[6352]90
[7131]91
[6352]92    /* external modules interfaces */
[6387]93    Shell*              shell;
94};
[6352]95
96#endif /* _GAME_WORLD_H */
Note: See TracBrowser for help on using the repository browser.