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>2012-10-13 10:51:48 +0000
committerStijn Buys <ingar@osirion.org>2012-10-13 10:51:48 +0000
commit0d58c4f8ab1d174c808c77bf94342c91f6e0c443 (patch)
tree9f32d388ca32dba337739494db2687aa5b2a8225 /src/game
parenta41a544a498baf2235348b2edb76781f442651d6 (diff)
Draw zone colors and background texture on the galactic map.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/faction.cc2
-rw-r--r--src/game/base/game.cc16
2 files changed, 15 insertions, 3 deletions
diff --git a/src/game/base/faction.cc b/src/game/base/faction.cc
index 3466265..323a199 100644
--- a/src/game/base/faction.cc
+++ b/src/game/base/faction.cc
@@ -82,7 +82,7 @@ bool Faction::init()
} else if (inifile.got_key_color("color", colorvalue)) {
faction->set_color(colorvalue);
-
+
} else if (inifile.got_key_color("colorsecond", colorvalue)) {
faction->set_color_second(colorvalue);
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 8c82968..dd720f0 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -1085,8 +1085,6 @@ bool Game::load_world()
if (inifile.got_key_label("zone", label)) {
zone = new core::Zone(label);
- // set default ambient light color
- zone->set_ambient_color(0.1f, 0.1f, 0.1f);
core::Zone::add(zone);
} else {
inifile.unknown_key();
@@ -1124,6 +1122,10 @@ bool Game::load_zone(core::Zone *zone)
using math::Vector3f;
using math::Color;
+ // set zone defaults
+ zone->set_color(0.5f);
+ zone->set_ambient_color(0.1f);
+
std::string inifilename("ini/zones/");
inifilename.append(zone->label());
@@ -1274,6 +1276,16 @@ bool Game::load_zone(core::Zone *zone)
} else if (zoneini.got_key_string("sky", strval)) {
zone->set_sky(strval);
continue;
+ } else if (zoneini.got_key_color("color", color)) {
+ zone->set_color(color);
+ continue;
+ } else if (zoneini.got_key_label("faction", strval)) {
+ Faction *faction = Faction::find(strval);
+ if (!faction) {
+ zoneini.unknown_error("unknown faction '" + strval + "'");
+ } else {
+ zone->set_color(faction->color());
+ }
} else if (zoneini.got_key_color("ambient", color)) {
zone->set_ambient_color(color);
continue;