From 3ad930b43ba47fd2cd8abe41d04bbecddd1d037e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 6 Jan 2012 18:28:28 +0000 Subject: Read the "ambient" key from zone ini files. --- src/game/base/game.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 2d8ddf5..9800eb8 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -1068,6 +1068,8 @@ 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(); @@ -1119,6 +1121,8 @@ bool Game::load_zone(core::Zone *zone) con_print << "^BLoading zone " << zone->label() << "..." << std::endl; size_t count = 0; + + math::Color color; core::Entity *entity = 0; core::Inventory *inventory = 0; @@ -1254,6 +1258,9 @@ 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("ambient", color)) { + zone->set_ambient_color(color); + continue; } else { zoneini.unknown_key(); } -- cgit v1.2.3