Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base')
-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;