From 343b0b4298e2d084d5544d3d40a8b7dcb586ce8e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 6 Oct 2008 18:22:00 +0000 Subject: use new inifile API --- src/game/intro/intro.cc | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'src/game/intro') diff --git a/src/game/intro/intro.cc b/src/game/intro/intro.cc index 4ad183f..4eb9a10 100644 --- a/src/game/intro/intro.cc +++ b/src/game/intro/intro.cc @@ -61,14 +61,33 @@ bool Intro::load_world() bool b; while (ini.getline()) { - if (ini.got_key()) { - if (ini.section().compare("intro") == 0) { + if (ini.got_section()) { + if (ini.got_section("intro")) { + continue; + + } else if (ini.got_section("convoy")) { + continue; + + } else if (ini.got_section("globe")) { + globe = new core::EntityGlobe(); + globe->set_zone(intro_zone); + + } else { + ini.unknown_section(); + } + } else if (ini.got_key()) { + + if (ini.in_section("intro")) { if (ini.got_key_string("sky", strval)) { intro_zone->set_sky(strval); continue; + + } else if (ini.got_key()) { + ini.unkown_key(); } - } else if (ini.section().compare("convoy") == 0) { + + } else if (ini.in_section("convoy")) { if (ini.got_key_color("color", color)) { intro_convoy->set_color(color); @@ -77,9 +96,12 @@ bool Intro::load_world() } else if (ini.got_key_string("ship", strval)) { intro_convoy->add(strval); + + } else if (ini.got_key()) { + ini.unkown_key(); } - } else if (ini.section().compare("globe") == 0) { + } else if (ini.in_section("globe")) { if (core::Parser::got_entity_key(ini, globe)) { continue; } else if (ini.got_key_string("texture", globe->entity_texture)) { @@ -88,23 +110,10 @@ bool Intro::load_world() continue; } else if (ini.got_key_bool("bright", b)) { if (b) { globe->entity_flags |= core::Entity::Bright; } - } else { - con_warn << ini.name() << " unknown key '" << ini.key() << "' at line " << ini.line() << std::endl; + } else if (ini.got_key()) { + ini.unkown_key(); } } - - } else if (ini.got_section("intro")) { - continue; - - } else if (ini.got_section("convoy")) { - continue; - - } else if (ini.got_section("globe")) { - globe = new core::EntityGlobe(); - globe->set_zone(intro_zone); - - } else if (ini.got_section()) { - con_warn << ini.name() << " unknown section '" << ini.section() << "' at line " << ini.line() << std::endl; } } -- cgit v1.2.3