--- a/src/Engine.cc Tue Jan 20 23:30:18 2009 +0200
+++ b/src/Engine.cc Wed Jan 21 00:21:42 2009 +0200
@@ -30,12 +30,12 @@
return *game_state;
}
-GameState& Engine::setupGame (void) {
+void Engine::setupGame (const TerrainConfig &config) {
// proxy off to setupGame(Terrain *)
- return setupGame(new Terrain(TERRAIN_WIDTH, TERRAIN_HEIGHT, TERRAIN_RANDOM_SEED));
+ setupGame(new Terrain(config));
}
-void Engine::setupGraphics (const GraphicsConfiguration &config) {
+void Engine::setupGraphics (const GraphicsConfig &config) {
// store config
graphics_config = &config;
@@ -55,9 +55,8 @@
void Engine::setupNetworkServer (const std::string &listen_port) {
NetworkEndpoint listen_addr(listen_port);
- // setup default game
- setupGame();
-
+ assert(terrain && game_state);
+
// create the server
net_server = new NetworkServer(*game_state, listen_addr);
}
@@ -71,8 +70,7 @@
}
void Engine::setupSinglePlayer (void) {
- // setup default game
- setupGame();
+ assert(terrain && game_state);
// create player directly
LocalPlayer* lp = new SinglePlayer(*game_state);