wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src display.cpp filesystem.cpp game.cpp...


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src display.cpp filesystem.cpp game.cpp...
Date: Wed, 06 Oct 2004 21:54:39 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    04/10/07 01:47:34

Modified files:
        src            : display.cpp filesystem.cpp game.cpp 
                         language.cpp multiplayer.cpp 
                         multiplayer_connect.cpp pathfind.cpp 
                         sdl_utils.cpp sdl_utils.hpp wesconfig.h 

Log message:
        made compile on Windows

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.265&tr2=1.266&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.cpp.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.141&tr2=1.142&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/language.cpp.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer.cpp.diff?tr1=1.120&tr2=1.121&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_connect.cpp.diff?tr1=1.77&tr2=1.78&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/pathfind.cpp.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_utils.cpp.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sdl_utils.hpp.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/wesconfig.h.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.265 wesnoth/src/display.cpp:1.266
--- wesnoth/src/display.cpp:1.265       Wed Oct  6 18:52:41 2004
+++ wesnoth/src/display.cpp     Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.265 2004/10/06 18:52:41 gruikya Exp $ */
+/* $Id: display.cpp,v 1.266 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -56,7 +56,7 @@
 
 display::display(unit_map& units, CVideo& video, const gamemap& map,
                const gamestatus& status, const std::vector<team>& t,
-               const config& theme_cfg, const config& config, const config& 
level) :
+               const config& theme_cfg, const config& cfg, const config& 
level) :
        screen_(video), xpos_(0), ypos_(0),
        zoom_(DefaultZoom), map_(map), units_(units),
        minimap_(NULL), redrawMinimap_(false),
@@ -67,7 +67,7 @@
        currentTeam_(0), activeTeam_(0), hideEnergy_(false),
        deadAmount_(0.0), advancingAmount_(0.0), updatesLocked_(0),
        turbo_(false), grid_(false), sidebarScaling_(1.0),
-       theme_(theme_cfg,screen_area()), builder_(config, level, map),
+       theme_(theme_cfg,screen_area()), builder_(cfg, level, map),
        first_turn_(true), in_game_(false), map_labels_(*this,map),
        tod_hex_mask1(NULL), tod_hex_mask2(NULL), diagnostic_label_(0),
        help_string_(0)
Index: wesnoth/src/filesystem.cpp
diff -u wesnoth/src/filesystem.cpp:1.45 wesnoth/src/filesystem.cpp:1.46
--- wesnoth/src/filesystem.cpp:1.45     Sat Sep 18 21:42:13 2004
+++ wesnoth/src/filesystem.cpp  Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: filesystem.cpp,v 1.45 2004/09/18 21:42:13 Sirp Exp $ */
+/* $Id: filesystem.cpp,v 1.46 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -184,7 +184,10 @@
 }
 
 std::string get_intl_dir()
-{
+{
+#ifdef _WIN32
+       return get_cwd() + "/po";
+#endif
 
 #ifdef __APPLE__
        return get_cwd() + "/messages";
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.141 wesnoth/src/game.cpp:1.142
--- wesnoth/src/game.cpp:1.141  Mon Oct  4 00:19:16 2004
+++ wesnoth/src/game.cpp        Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.141 2004/10/04 00:19:16 Sirp Exp $ */
+/* $Id: game.cpp,v 1.142 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -417,9 +417,11 @@
                        break; //parse the rest of the arguments when we set up 
the game
                } else if(val == "--test" || val == "-t") {
                        test_mode_ = true;
-               } else if(val == "--debug" || val == "-d") {
+               } else if(val == "--debug" || val == "-d") 
{http://www.wesnoth.org/forum/profile.php?mode=viewprofile&u=195
                        game_config::debug = true;
                } else if (val.substr(0, 6) == "--log-") {
+               } else if(val == "--nosound") {
+                       //handled elsewhere
                } else if(val[0] == '-') {
                        std::cerr << "unknown option: " << val << "\n";
                        throw config::error("unknown option");
@@ -465,8 +467,8 @@
                video_.make_fake();
                return true;
        }
-
-    image::set_wm_icon();
+
+    image::set_wm_icon();
 
        int video_flags = preferences::fullscreen() ? FULL_SCREEN : 0;
 
@@ -1391,11 +1393,25 @@
        }
 
        srand(time(NULL));
-
-       game_controller game(argc,argv,use_sound);
-       bool res = game.init_video();
-       if(res == false) {
+
+       game_controller game(argc,argv,use_sound);
+
+       bool res = game.init_config();
+       if(res == false) {
+               std::cerr << "could not initialize game config\n";
+               return 0;
+       }
+       
+       res = game.init_video();
+       if(res == false) {
+               std::cerr << "could not initialize display\n";
                return 0;
+       }
+
+       res = game.init_language();
+       if(res == false) {
+               std::cerr << "could not initialize the language\n";
+               return 0;
        }
 
        const cursor::manager cursor_manager;
@@ -1403,11 +1419,6 @@
        SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
 #endif
 
-       res = game.init_language() && game.init_config();
-       if(res == false) {
-               return 0;
-       }
-
        for(;;) {
                statistics::fresh_stats();
 
Index: wesnoth/src/language.cpp
diff -u wesnoth/src/language.cpp:1.52 wesnoth/src/language.cpp:1.53
--- wesnoth/src/language.cpp:1.52       Sun Oct  3 13:04:07 2004
+++ wesnoth/src/language.cpp    Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: language.cpp,v 1.52 2004/10/03 13:04:07 cedricd Exp $ */
+/* $Id: language.cpp,v 1.53 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -122,6 +122,11 @@
                std::cerr << "setenv LC_ALL failed: " << strerror(errno);
 #endif 
 
+#ifdef _WIN32
+       const std::string env = std::string("LANG=") + locale;
+       putenv(env.c_str());
+#endif
+
        char* res = setlocale (category, locale);
        if (res == NULL)
                std::cerr << "WARNING: setlocale() failed for "
Index: wesnoth/src/multiplayer.cpp
diff -u wesnoth/src/multiplayer.cpp:1.120 wesnoth/src/multiplayer.cpp:1.121
--- wesnoth/src/multiplayer.cpp:1.120   Sat Sep 25 19:46:33 2004
+++ wesnoth/src/multiplayer.cpp Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer.cpp,v 1.120 2004/09/25 19:46:33 ydirson Exp $ */
+/* $Id: multiplayer.cpp,v 1.121 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -64,11 +64,11 @@
 {
        std::cerr << "setup dialog ctor\n";
 
-        for(std::map<std::string, player_info>::iterator 
i=state_.players.begin();
-            i!=state_.players.end(); ++i) {
-          i->second.available_units.clear();
-          i->second.can_recruit.clear();
-        }
+       for(std::map<std::string, player_info>::iterator i = 
state_.players.begin();
+           i != state_.players.end(); ++i) {
+               i->second.available_units.clear();
+               i->second.can_recruit.clear();
+       }
        state_.variables.clear();
 
        //build the list of scenarios to play
@@ -77,8 +77,8 @@
        std::vector<std::string> options = user_maps_;
 
        const config::child_list& levels = cfg.get_children("multiplayer");
-       for(config::child_list::const_iterator i = levels.begin(); i != 
levels.end(); ++i){
-               options.push_back((**i)["name"]);
+       for(config::child_list::const_iterator j = levels.begin(); j != 
levels.end(); ++j){
+               options.push_back((**j)["name"]);
        }
 
        //add the 'load game' option
Index: wesnoth/src/multiplayer_connect.cpp
diff -u wesnoth/src/multiplayer_connect.cpp:1.77 
wesnoth/src/multiplayer_connect.cpp:1.78
--- wesnoth/src/multiplayer_connect.cpp:1.77    Tue Oct  5 19:23:22 2004
+++ wesnoth/src/multiplayer_connect.cpp Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_connect.cpp,v 1.77 2004/10/05 19:23:22 gruikya Exp $ */
+/* $Id: multiplayer_connect.cpp,v 1.78 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -112,11 +112,11 @@
                level_ptr = &scenario_data;
 
                //make all sides untaken
-               for(config::child_itors i = level_ptr->child_range("side"); 
i.first != i.second; ++i.first) {
-                       (**i.first)["taken"] = "";
+               for(config::child_itors j = level_ptr->child_range("side"); 
j.first != j.second; ++j.first) {
+                       (**j.first)["taken"] = "";
 
                        //tell clients not to change their race
-                       (**i.first)["allow_changes"] = "no";
+                       (**j.first)["allow_changes"] = "no";
                }
 
                recorder = replay(state_->replay_data);
Index: wesnoth/src/pathfind.cpp
diff -u wesnoth/src/pathfind.cpp:1.42 wesnoth/src/pathfind.cpp:1.43
--- wesnoth/src/pathfind.cpp:1.42       Thu Sep  2 15:41:09 2004
+++ wesnoth/src/pathfind.cpp    Thu Oct  7 01:47:33 2004
@@ -1,4 +1,4 @@
-/* $Id: pathfind.cpp,v 1.42 2004/09/02 15:41:09 ydirson Exp $ */
+/* $Id: pathfind.cpp,v 1.43 2004/10/07 01:47:33 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -107,7 +107,7 @@
 
        for(;;) {
                location_set::const_iterator it = not_visited.begin(), it_end = 
not_visited.end();
-               visited.insert(it, it_end);
+               std::copy(it,it_end,std::inserter(visited,visited.end()));
                for(; it != it_end; ++it) {
                        gamemap::location adj[6];
                        get_adjacent_tiles(*it, adj);
@@ -123,7 +123,7 @@
                not_visited.swap(must_visit);
                must_visit.clear();
        }
-       res.insert(visited.begin(), visited.end());
+       
std::copy(visited.begin(),visited.end(),std::inserter(visited,visited.end()));
 }
 
 bool enemy_zoc(const gamemap& map, const gamestatus& status, 
Index: wesnoth/src/sdl_utils.cpp
diff -u wesnoth/src/sdl_utils.cpp:1.58 wesnoth/src/sdl_utils.cpp:1.59
--- wesnoth/src/sdl_utils.cpp:1.58      Tue Oct  5 21:50:48 2004
+++ wesnoth/src/sdl_utils.cpp   Thu Oct  7 01:47:34 2004
@@ -1,4 +1,4 @@
-/* $Id: sdl_utils.cpp,v 1.58 2004/10/05 21:50:48 gruikya Exp $ */
+/* $Id: sdl_utils.cpp,v 1.59 2004/10/07 01:47:34 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -81,11 +81,11 @@
        surface const result = display_format_alpha(surf);
        if(result == surf) {
                std::cerr << "resulting surface is the same as the source!!!\n";
+       } else if(result == NULL) {
+               return surf;
        }
 
-       if(result != NULL) {
-               SDL_SetAlpha(result,SDL_SRCALPHA|SDL_RLEACCEL,SDL_ALPHA_OPAQUE);
-       }
+       SDL_SetAlpha(result,SDL_SRCALPHA|SDL_RLEACCEL,SDL_ALPHA_OPAQUE);
 
        return result;
 }
Index: wesnoth/src/sdl_utils.hpp
diff -u wesnoth/src/sdl_utils.hpp:1.45 wesnoth/src/sdl_utils.hpp:1.46
--- wesnoth/src/sdl_utils.hpp:1.45      Tue Oct  5 22:08:38 2004
+++ wesnoth/src/sdl_utils.hpp   Thu Oct  7 01:47:34 2004
@@ -1,4 +1,4 @@
-/* $Id: sdl_utils.hpp,v 1.45 2004/10/05 22:08:38 gruikya Exp $ */
+/* $Id: sdl_utils.hpp,v 1.46 2004/10/07 01:47:34 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -119,7 +119,7 @@
 bool operator==(const SDL_Rect& a, const SDL_Rect& b);
 bool operator!=(const SDL_Rect& a, const SDL_Rect& b);
 
-struct config; // no need to include config.hpp
+class config; // no need to include config.hpp
 
 struct pixel_data
 {
Index: wesnoth/src/wesconfig.h
diff -u wesnoth/src/wesconfig.h:1.6 wesnoth/src/wesconfig.h:1.7
--- wesnoth/src/wesconfig.h:1.6 Tue Oct  5 20:43:31 2004
+++ wesnoth/src/wesconfig.h     Thu Oct  7 01:47:34 2004
@@ -7,7 +7,7 @@
 # define VERSION "0.8.6-CVS"
 # define WESNOTH_DEFAULT_SERVER "devsrv.wesnoth.org:14999"
 # define PACKAGE "wesnoth"
-# define LOCALEDIR "messages"
+# define LOCALEDIR "po"
 #endif
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]