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

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

[Wesnoth-cvs-commits] wesnoth/src dialogs.cpp filesystem.cpp filesyst...


From: ott
Subject: [Wesnoth-cvs-commits] wesnoth/src dialogs.cpp filesystem.cpp filesyst...
Date: Sat, 17 Sep 2005 11:06:28 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     ott <address@hidden>    05/09/17 15:06:28

Modified files:
        src            : dialogs.cpp filesystem.cpp filesystem.hpp 
                         multiplayer_create.cpp game.cpp 

Log message:
        codeclean

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/dialogs.cpp.diff?tr1=1.108&tr2=1.109&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.cpp.diff?tr1=1.80&tr2=1.81&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.hpp.diff?tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/multiplayer_create.cpp.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.278&tr2=1.279&r1=text&r2=text

Patches:
Index: wesnoth/src/dialogs.cpp
diff -u wesnoth/src/dialogs.cpp:1.108 wesnoth/src/dialogs.cpp:1.109
--- wesnoth/src/dialogs.cpp:1.108       Wed Sep 14 23:21:01 2005
+++ wesnoth/src/dialogs.cpp     Sat Sep 17 15:06:27 2005
@@ -1,4 +1,4 @@
-/* $Id: dialogs.cpp,v 1.108 2005/09/14 23:21:01 Sirp Exp $ */
+/* $Id: dialogs.cpp,v 1.109 2005/09/17 15:06:27 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -136,14 +136,14 @@
                        SDL_Delay(30);
                }
        }
-
+
        if(choice < options.size()) {
                const std::string& chosen_unit = choice < options.size() ? 
options[choice] : u->second.type().id();
-               ::advance_unit(info,units,loc,chosen_unit);
+               ::advance_unit(info,units,loc,chosen_unit);
        }
 
        u = units.find(loc);
-       if(u != units.end() && choice >= options.size()) {
+       if(u != units.end() && choice >= options.size()) {
                u->second.get_experience(-u->second.experience()); //reset xp 
to 0
                u->second.add_modification("advance",*mod_options[choice - 
options.size()]);
        }
Index: wesnoth/src/filesystem.cpp
diff -u wesnoth/src/filesystem.cpp:1.80 wesnoth/src/filesystem.cpp:1.81
--- wesnoth/src/filesystem.cpp:1.80     Fri Sep 16 12:14:44 2005
+++ wesnoth/src/filesystem.cpp  Sat Sep 17 15:06:28 2005
@@ -1,4 +1,4 @@
-/* $Id: filesystem.cpp,v 1.80 2005/09/16 12:14:44 Sirp Exp $ */
+/* $Id: filesystem.cpp,v 1.81 2005/09/17 15:06:28 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -470,6 +470,7 @@
                std::ifstream *s = new std::ifstream((game_config::path + "/" + 
fname).c_str(),std::ios_base::binary);
                if (s->is_open())
                        return s;
+               LOG_FS << "could not open " << fname << " for reading.\n";
                delete s;
        }
 #endif
@@ -767,11 +768,11 @@
        for(std::vector<std::string>::const_iterator i = paths_.begin(); i != 
paths_.end(); ++i) {
                binary_paths.erase(*i);
        }
-}
-
-void clear_binary_paths_cache()
-{
-       binary_paths_cache.clear();
+}
+
+void clear_binary_paths_cache()
+{
+       binary_paths_cache.clear();
 }
 
 const std::vector<std::string>& get_binary_paths(const std::string& type)
Index: wesnoth/src/filesystem.hpp
diff -u wesnoth/src/filesystem.hpp:1.40 wesnoth/src/filesystem.hpp:1.41
--- wesnoth/src/filesystem.hpp:1.40     Fri Sep 16 12:14:44 2005
+++ wesnoth/src/filesystem.hpp  Sat Sep 17 15:06:28 2005
@@ -1,4 +1,4 @@
-/* $Id: filesystem.hpp,v 1.40 2005/09/16 12:14:44 Sirp Exp $ */
+/* $Id: filesystem.hpp,v 1.41 2005/09/17 15:06:28 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -132,7 +132,7 @@
 
        std::vector<std::string> paths_;
 };
-
+
 void clear_binary_paths_cache();
 
 //function which, given a type of binary, e.g. 'images', 'sounds', etc,
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.278 wesnoth/src/game.cpp:1.279
--- wesnoth/src/game.cpp:1.278  Fri Sep 16 12:14:44 2005
+++ wesnoth/src/game.cpp        Sat Sep 17 15:06:28 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.278 2005/09/16 12:14:44 Sirp Exp $ */
+/* $Id: game.cpp,v 1.279 2005/09/17 15:06:28 ott Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -1015,9 +1015,9 @@
                old_defines_map_.clear();
                refresh_game_cfg();
                use_caching_ = old_cache;
-               ::init_textdomains(game_config_);
-               paths_manager_.set_paths(game_config_);
-
+               ::init_textdomains(game_config_);
+               paths_manager_.set_paths(game_config_);
+
                clear_binary_paths_cache();
 
                gui::show_dialog(disp(),NULL,_("Campaign Installed"),_("The 
campaign has been installed."),gui::OK_ONLY);
Index: wesnoth/src/multiplayer_create.cpp
diff -u wesnoth/src/multiplayer_create.cpp:1.36 
wesnoth/src/multiplayer_create.cpp:1.37
--- wesnoth/src/multiplayer_create.cpp:1.36     Sat Sep 17 00:12:17 2005
+++ wesnoth/src/multiplayer_create.cpp  Sat Sep 17 15:06:28 2005
@@ -1,4 +1,4 @@
-/* $Id: multiplayer_create.cpp,v 1.36 2005/09/17 00:12:17 Sirp Exp $ */
+/* $Id: multiplayer_create.cpp,v 1.37 2005/09/17 15:06:28 ott Exp $ */
 /*
    Copyright (C)
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -12,8 +12,8 @@
 */
 
 #include "global.hpp"
-
-#include <memory>
+
+#include <memory>
 
 #include "display.hpp"
 #include "gettext.hpp"
@@ -21,7 +21,7 @@
 #include "show_dialog.hpp"
 #include "map_create.hpp"
 #include "multiplayer_create.hpp"
-#include "filesystem.hpp"
+#include "filesystem.hpp"
 #include "log.hpp"
 #include "preferences.hpp"
 #include "video.hpp"
@@ -302,17 +302,17 @@
                generator_settings_.hide(generator_ == NULL);
                regenerate_map_.hide(generator_ == NULL);
 
-               const std::string& map_data = 
parameters_.scenario_data["map_data"];
-
-               std::auto_ptr<gamemap> map(NULL);
-               try {
-                       map.reset(new gamemap(game_config(), map_data));
-               } catch(gamemap::incorrect_format_exception& e) {
-                       LOG_STREAM(err,general) << "map could not be loaded: " 
<< e.msg_ << "\n";
-                       tooltips::clear_tooltips(minimap_rect_);
-                       tooltips::add_tooltip(minimap_rect_,e.msg_);
-               }
-
+               const std::string& map_data = 
parameters_.scenario_data["map_data"];
+
+               std::auto_ptr<gamemap> map(NULL);
+               try {
+                       map.reset(new gamemap(game_config(), map_data));
+               } catch(gamemap::incorrect_format_exception& e) {
+                       LOG_STREAM(err,general) << "map could not be loaded: " 
<< e.msg_ << "\n";
+                       tooltips::clear_tooltips(minimap_rect_);
+                       tooltips::add_tooltip(minimap_rect_,e.msg_);
+               }
+
                launch_game_.enable(map.get() != NULL);
 
                //if there are less sides in the configuration than there are 
starting
@@ -333,22 +333,22 @@
                         parameters_.scenario_data.remove_child("side",
                                          
parameters_.scenario_data.get_children("side").size()-1);
                }
-
+
                if(map.get() != NULL) {
                        const surface 
mini(image::getMinimap(minimap_rect_.w,minimap_rect_.h,*map,0));
                        if(mini != NULL) {
                                SDL_Rect rect = minimap_rect_;
                                SDL_BlitSurface(mini, NULL, 
video().getSurface(), &rect);
                                update_rect(rect);
-                       }
-               }
+                       }
+               }
 
                const int nsides = 
parameters_.scenario_data.get_children("side").size();
-               std::stringstream players;
+               std::stringstream players;
                if(map.get() != NULL) {
-                       players << _("Players: ") << nsides;
-               } else {
-                       players << _("Error");
+                       players << _("Players: ") << nsides;
+               } else {
+                       players << _("Error");
                }
                num_players_label_.set_text(players.str());
 
@@ -397,8 +397,8 @@
        } else {
                minimap_restorer_.assign(new surface_restorer(&video(), 
minimap_rect_));
 
-               const std::string& map_data = 
parameters_.scenario_data["map_data"];
-
+               const std::string& map_data = 
parameters_.scenario_data["map_data"];
+
                try {
                        gamemap map(game_config(), map_data);
                        const surface 
mini(image::getMinimap(minimap_rect_.w,minimap_rect_.h,map,0));
@@ -406,10 +406,10 @@
                                SDL_Rect rect = minimap_rect_;
                                SDL_BlitSurface(mini, NULL, 
video().getSurface(), &rect);
                                update_rect(rect);
-                       }
-               } catch(gamemap::incorrect_format_exception& e) {
-                       LOG_STREAM(err,general) << "map could not be loaded: " 
<< e.msg_ << "\n";
-               }
+                       }
+               } catch(gamemap::incorrect_format_exception& e) {
+                       LOG_STREAM(err,general) << "map could not be loaded: " 
<< e.msg_ << "\n";
+               }
 
        }
 }




reply via email to

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