Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2636 in orxonox.OLD for orxonox/trunk/src/world.h


Ignore:
Timestamp:
Oct 25, 2004, 12:48:39 AM (20 years ago)
Author:
patrick
Message:
  • Added a GameLoader to the game. This enables orxonox to load a campaign consisting of multimple worlds and cinematics etc. However, cinematics are not yet implemented.

In the game you can jump from one level to the other by pressing x. Currently there are only two very simple levels defined. (DEBUG_LEVEL_0, DEBUG_LEVEL_1).

  • Added Error Handling structs to signal the error source and code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world.h

    r2551 r2636  
    88
    99#include "stdincl.h"
     10#include "story_entity.h"
     11
     12
    1013
    1114class Track;
    1215class WorldEntity;
     16class Camera;
    1317
    1418//! The game environment
    15 class World {
     19class World : public StoryEntity {
    1620
    1721 public:
    18   World ();
     22  World (char* name);
     23  World (int worldID);
    1924  ~World ();
    2025
    21         template<typename T>
    22           T* spawn(Location* loc, WorldEntity* owner);  // template to be able to spawn any derivation of WorldEntity
    23         template<typename T>
    24           T* spawn(Placement* plc, WorldEntity* owner);
     26  template<typename T>
     27    T* spawn(Location* loc, WorldEntity* owner);        // template to be able to spawn any derivation of WorldEntity
     28  template<typename T>
     29    T* spawn(Placement* plc, WorldEntity* owner);
     30 
     31  virtual Error init();
     32  virtual Error start();
     33  virtual Error stop();
     34  virtual Error pause();
     35  virtual Error resume();
    2536
    26         void time_slice (Uint32 deltaT);
    27         void collide ();
    28         void draw ();
    29         void update (); // maps Locations to Placements
    30         void calc_camera_pos (Location* loc, Placement* plc);
     37  virtual void load();
     38
     39  void time_slice (Uint32 deltaT);
     40  void collide ();
     41  void draw ();
     42  void update ();       // maps Locations to Placements
     43  void calc_camera_pos (Location* loc, Placement* plc);
    3144       
    32         void unload ();
    33        
    34         void load_debug_level ();
    35        
     45  void unload ();
     46 
     47  void setTrackLen(Uint32 tracklen);
     48  int getTrackLen();
     49  bool system_command (Command* cmd);
     50  Camera* getCamera();
     51  //private:
     52 
     53  List<WorldEntity>* entities;
     54 
     55  // base level data
     56  Track* track;
     57  Uint32 tracklen;   // number of Tracks the World consist of
     58  Vector* pathnodes;
     59  Camera* localCamera; 
     60
    3661 private:
    37  
    38         List<WorldEntity>* entities;
    39        
    40                 // base level data
    41         Track* track;
    42         Uint32 tracklen;   // number of Tracks the World consist of
    43         Vector* pathnodes;
     62  Uint32 lastFrame; //!> last time of frame
     63  bool bQuitOrxonox; //!> quit this application
     64  bool bQuitCurrentGame; //!> quit only the current game and return to menu
     65  bool bPause;
    4466
     67  char* worldName;
     68  int debugWorldNr;
     69
     70  void mainLoop();
     71  void synchronize();
     72  void handle_input();
     73  void time_slice();
     74  void collision();
     75  void display();
    4576};
    4677
     
    6394        if( loc == NULL)
    6495        {
    65                 zeroloc.dist = 0;
    66                 zeroloc.part = 0;
     96          zeroloc.dist = 0;
     97          zeroloc.part = 0;
    6798                zeroloc.pos = Vector();
    6899                zeroloc.rot = Quaternion();
Note: See TracChangeset for help on using the changeset viewer.