diff options
| author | Stijn Buys <ingar@osirion.org> | 2008-10-06 18:22:00 +0000 | 
|---|---|---|
| committer | Stijn Buys <ingar@osirion.org> | 2008-10-06 18:22:00 +0000 | 
| commit | 343b0b4298e2d084d5544d3d40a8b7dcb586ce8e (patch) | |
| tree | df7943f6bdfbe49d2493a9f405713c340f25ea7c /src/game/intro | |
| parent | b8a6949fcc62e0bc59fc6a1ee8adba1df92b9b09 (diff) | |
use new inifile API
Diffstat (limited to 'src/game/intro')
| -rw-r--r-- | src/game/intro/intro.cc | 47 | 
1 files changed, 28 insertions, 19 deletions
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;  		}  	}  | 
