Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-10 18:48:23 +0000
committerStijn Buys <ingar@osirion.org>2008-08-10 18:48:23 +0000
commit9c56ebfdba5fe33476f8d382da6d72e5b81ab4b8 (patch)
tree3dfee7a93cd591df8ef3a0aef811067ef6451df7 /src/game
parentae96accdd3c38d3f96b0725020e7a390c53b86d5 (diff)
added racetrack to the game module, added Odin's new structures to the assets documentation
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Makefile.am6
-rw-r--r--src/game/game.cc57
2 files changed, 61 insertions, 2 deletions
diff --git a/src/game/Makefile.am b/src/game/Makefile.am
index 17bd6d3..efa051f 100644
--- a/src/game/Makefile.am
+++ b/src/game/Makefile.am
@@ -2,7 +2,9 @@ INCLUDES = -I$(top_srcdir)/src
METASOURCES = AUTO
libgame_la_LDFLAGS = -avoid-version
-libgame_la_SOURCES = game.cc navpoint.cc planet.cc ship.cc shipmodel.cc star.cc
+libgame_la_SOURCES = game.cc navpoint.cc planet.cc racetrack.cc ship.cc \
+ shipmodel.cc star.cc
noinst_LTLIBRARIES = libgame.la
-noinst_HEADERS = game.h navpoint.h planet.h ship.h shipmodel.h star.h
+noinst_HEADERS = game.h navpoint.h planet.h racetrack.h ship.h shipmodel.h \
+ star.h
diff --git a/src/game/game.cc b/src/game/game.cc
index f35670a..ca06c81 100644
--- a/src/game/game.cc
+++ b/src/game/game.cc
@@ -13,6 +13,7 @@
#include "game/game.h"
#include "game/navpoint.h"
#include "game/planet.h"
+#include "game/racetrack.h"
#include "game/ship.h"
#include "game/star.h"
#include "math/mathlib.h"
@@ -313,6 +314,8 @@ bool Game::load_zone(core::Zone *zone)
Planet *planet = 0;
Star *star = 0;
NavPoint *navpoint = 0;
+ RaceTrack *racetrack = 0;
+ CheckPoint *checkpoint = 0;
core::Entity *entity = 0;
float direction;
@@ -404,6 +407,50 @@ bool Game::load_zone(core::Zone *zone)
con_warn << zoneini.name() << " unknown key '" << zoneini.key() << "' at line " << zoneini.line() << std::endl;
}
+ } else if (zoneini.section().compare("racetrack") == 0) {
+ if (zoneini.got_key_string("label", strval)) {
+ aux::to_label(strval);
+ racetrack->entity_label.assign(strval);
+ continue;
+ } else if (zoneini.got_key_string("name", racetrack->entity_name)) {
+ continue;
+ } else if (zoneini.got_key_vector3f("location", racetrack->entity_location )) {
+ continue;
+ } else if (zoneini.got_key_color("color", racetrack->entity_color)) {
+ continue;
+ } else if (zoneini.got_key_angle("direction", direction)) {
+ racetrack->axis().change_direction(direction);
+ continue;
+ } else if (zoneini.got_key_angle("pitch", pitch)) {
+ racetrack->axis().change_pitch(pitch);
+ continue;
+ } else if (zoneini.got_key_string("model", racetrack->entity_modelname)) {
+ continue;
+ } else {
+ con_warn << zoneini.name() << " unknown key '" << zoneini.key() << "' at line " << zoneini.line() << std::endl;
+ }
+
+ } else if (zoneini.section().compare("checkpoint") == 0) {
+ if (zoneini.got_key_string("label", strval)) {
+ aux::to_label(strval);
+ checkpoint->entity_label.assign(strval);
+ continue;
+ } else if (zoneini.got_key_string("name", checkpoint->entity_name)) {
+ continue;
+ } else if (zoneini.got_key_vector3f("location", checkpoint->entity_location )) {
+ continue;
+ } else if (zoneini.got_key_angle("direction", direction)) {
+ checkpoint->axis().change_direction(direction);
+ continue;
+ } else if (zoneini.got_key_angle("pitch", pitch)) {
+ checkpoint->axis().change_pitch(pitch);
+ continue;
+ } else if (zoneini.got_key_string("model", checkpoint->entity_modelname)) {
+ continue;
+ } else {
+ con_warn << zoneini.name() << " unknown key '" << zoneini.key() << "' at line " << zoneini.line() << std::endl;
+ }
+
} else if (zoneini.section().compare("entity") == 0) {
std::string shapename;
if (zoneini.got_key_string("shape", shapename)) {
@@ -460,6 +507,16 @@ bool Game::load_zone(core::Zone *zone)
navpoint = new NavPoint();
navpoint->set_zone(zone);
count ++;
+
+ } else if(zoneini.got_section("racetrack")) {
+ racetrack = new RaceTrack();
+ racetrack->set_zone(zone);
+
+ } else if(zoneini.got_section("checkpoint")) {
+ checkpoint = new CheckPoint(racetrack);
+ if (!racetrack) {
+ con_warn << zoneini.name() << " checkpoint without racetrack at line " << zoneini.line() << std::endl;
+ }
} else if (zoneini.got_section("planet")) {
planet = new Planet();