diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-25 15:06:09 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-25 15:06:09 +0000 |
commit | 36e52bc178b2ba25ecc1b3fc13e03f2aee1e8efa (patch) | |
tree | cae74734b43253360e716cb0ad91aba29fa9757e /src/game | |
parent | 210a3278e709b3cbbf2fdd6ef21a2150485b9d97 (diff) |
planet updates
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/Makefile.am | 4 | ||||
-rw-r--r-- | src/game/game.cc | 23 | ||||
-rw-r--r-- | src/game/game.h | 4 | ||||
-rw-r--r-- | src/game/star.cc | 1 |
4 files changed, 24 insertions, 8 deletions
diff --git a/src/game/Makefile.am b/src/game/Makefile.am index e9f8d0b..394e209 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -2,7 +2,7 @@ INCLUDES = -I$(top_srcdir)/src METASOURCES = AUTO libgame_la_LDFLAGS = -avoid-version -libgame_la_SOURCES = game.cc ship.cc shipmodel.cc star.cc +libgame_la_SOURCES = game.cc planet.cc ship.cc shipmodel.cc star.cc noinst_LTLIBRARIES = libgame.la -noinst_HEADERS = game.h ship.h shipmodel.h star.h +noinst_HEADERS = game.h planet.h ship.h shipmodel.h star.h diff --git a/src/game/game.cc b/src/game/game.cc index 4a77d7d..15ae029 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -11,6 +11,7 @@ #include "filesystem/filesystem.h" #include "filesystem/inifile.h" #include "game/game.h" +#include "game/planet.h" #include "game/ship.h" #include "game/star.h" #include "math/mathlib.h" @@ -156,6 +157,7 @@ void Game::init() return; } + Planet *planet = 0; Star *star = 0; core::Entity *entity = 0; @@ -168,12 +170,26 @@ void Game::init() if (worldini.section().compare("star") == 0) { if (worldini.got_key_string("name", star->entity_name)) continue; - else if (worldini.got_key_string("model", star->entity_modelname)) - continue; else if (worldini.got_key_vector3f("location", star->entity_location )) continue; else if (worldini.got_key_color("color", star->entity_color)) continue; + else if (worldini.got_key_angle("radius", star->entity_radius)) + continue; + else + con_warn << worldini.name() << " unknown key '" << worldini.key() << "' at line " << worldini.line() << std::endl; + + } else if (worldini.section().compare("planet") == 0) { + if (worldini.got_key_string("name", planet->entity_name)) + continue; + else if (worldini.got_key_string("texture", planet->entity_texture)) + continue; + else if (worldini.got_key_vector3f("location", planet->entity_location )) + continue; + else if (worldini.got_key_color("color", planet->entity_color)) + continue; + else if (worldini.got_key_angle("radius", planet->entity_radius)) + continue; else con_warn << worldini.name() << " unknown key '" << worldini.key() << "' at line " << worldini.line() << std::endl; @@ -219,6 +235,9 @@ void Game::init() } else if (worldini.got_section("star")) { star = new Star(); + } else if (worldini.got_section("planet")) { + planet = new Planet(); + } else if (worldini.got_section("entity")) { entity = new core::Entity(); entity->entity_flags += core::Entity::Static; diff --git a/src/game/game.h b/src/game/game.h index 811de84..89889a0 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -26,9 +26,7 @@ namespace game // entity type constants const unsigned int ship_enttype = 256; const unsigned int star_enttype = 257; -const unsigned int cube_enttype = 258; -const unsigned int sphere_enttype = 259; -const unsigned int axis_enttype = 260; +const unsigned int planet_enttype = 258; class Game : public core::Module { public: diff --git a/src/game/star.cc b/src/game/star.cc index 0a12593..367054f 100644 --- a/src/game/star.cc +++ b/src/game/star.cc @@ -12,7 +12,6 @@ namespace game { Star::Star() : core::EntityGlobe(core::Entity::Static | core::Entity::Solid | core::Entity::Bright) { - entity_shape = core::Entity::Sphere; // a star is a sphere entity_color = math::Color(1,1,1,1); // white entity_radius = 48; // 48 game units |