[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src game.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src game.cpp |
Date: |
Sun, 19 Sep 2004 06:06:12 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/09/19 10:00:07
Modified files:
src : game.cpp
Log message:
Do NOT use temporary instances to initialize long-lived references
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.135&tr2=1.136&r1=text&r2=text
Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.135 wesnoth/src/game.cpp:1.136
--- wesnoth/src/game.cpp:1.135 Sun Sep 19 05:48:18 2004
+++ wesnoth/src/game.cpp Sun Sep 19 10:00:07 2004
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.135 2004/09/19 05:48:18 Sirp Exp $ */
+/* $Id: game.cpp,v 1.136 2004/09/19 10:00:07 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -373,7 +373,7 @@
};
game_controller::game_controller(int argc, char** argv, bool use_sound)
- : argc_(argc), argv_(argv), arg_(1),
+ : argc_(argc), arg_(1), argv_(argv),
sound_manager_(use_sound), test_mode_(false), multiplayer_mode_(false),
no_gui_(false), use_caching_(true), force_bpp_(-1), disp_(NULL),
loaded_game_show_replay_(false)
@@ -442,9 +442,13 @@
display& game_controller::disp()
{
if(disp_.get() == NULL) {
- display::unit_map u_map;
- config dummy_cfg("");
- disp_.assign(new
display(u_map,video_,gamemap(dummy_cfg,"1"),gamestatus(dummy_cfg,0),
std::vector<team>(),dummy_cfg,dummy_cfg,dummy_cfg));
+ static display::unit_map dummy_umap;
+ static config dummy_cfg("");
+ static gamemap dummy_map(dummy_cfg, "1");
+ static gamestatus dummy_status(dummy_cfg, 0);
+ static std::vector<team> dummy_teams;
+ disp_.assign(new display(dummy_umap, video_, dummy_map,
dummy_status,
+ dummy_teams, dummy_cfg, dummy_cfg, dummy_cfg));
}
return *disp_.get();
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Yann Dirson, 2004/09/02
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/08
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/12
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/12
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Guillaume Melquiond, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Guillaume Melquiond, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Philippe Plantier, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp,
Guillaume Melquiond <=
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Yann Dirson, 2004/09/19