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

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

[Wesnoth-cvs-commits] wesnoth/src theme.cpp


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src theme.cpp
Date: Wed, 03 Aug 2005 18:19:38 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/08/03 22:19:38

Modified files:
        src            : theme.cpp 

Log message:
        Some clean up

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/theme.cpp.diff?tr1=1.43&tr2=1.44&r1=text&r2=text

Patches:
Index: wesnoth/src/theme.cpp
diff -u wesnoth/src/theme.cpp:1.43 wesnoth/src/theme.cpp:1.44
--- wesnoth/src/theme.cpp:1.43  Wed Aug  3 21:56:48 2005
+++ wesnoth/src/theme.cpp       Wed Aug  3 22:19:38 2005
@@ -1,4 +1,4 @@
-/* $Id: theme.cpp,v 1.43 2005/08/03 21:56:48 j_daniel Exp $ */
+/* $Id: theme.cpp,v 1.44 2005/08/03 22:19:38 j_daniel Exp $ */
 /*
    Copyright (C) 2003-5 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -147,13 +147,7 @@
        void expand_partialresolution(config& dst_cfg, const config& top_cfg)
        {
                std::vector<config> res_cfgs_;
-               // add all the resolutions
-               const config::child_list& res_list = 
top_cfg.get_children("resolution");
-               for(config::child_list::const_iterator i = res_list.begin(); i 
!= res_list.end(); ++i) {
-                       res_cfgs_.push_back(**i);
-               }
-
-               // now resolve all the partialresolutions
+               // resolve all the partialresolutions
                const config::child_list& parts_list = 
top_cfg.get_children("partialresolution");
                for(config::child_list::const_iterator i = parts_list.begin(); 
i != parts_list.end(); ++i) {
                        // follow the inheritance hierarchy and push all the 
nodes on the stack
@@ -168,7 +162,7 @@
                                parent_id = &((*parent)["inherits"]);
                        }
 
-                       // add the parent and apply all the modification of the 
children
+                       // add the parent resolution and apply all the 
modifications of its children
                        res_cfgs_.push_back(*parent);
                        while(!parent_stack.empty()) {
                                //override attributes
@@ -208,21 +202,25 @@
                                parent_stack.pop_back();
                        }
                }
+               // add all the resolutions
+               const config::child_list& res_list = 
top_cfg.get_children("resolution");
+               for(config::child_list::const_iterator i = res_list.begin(); i 
!= res_list.end(); ++i) {
+                       dst_cfg.add_child("resolution", (**i));
+               }
+               // add all the resolved resolutions
                for(std::vector<config>::const_iterator i = res_cfgs_.begin(); 
i != res_cfgs_.end(); ++i) {
                        dst_cfg.add_child("resolution", (*i));
                }
                return;
        }
 
-       void do_resolve_rects(const config& cfg, config& resolved_config,
-                             const config& topcfg, config* resol_cfg = NULL) {
+       void do_resolve_rects(const config& cfg, config& resolved_config, 
config* resol_cfg = NULL) {
 
                // recursively resolve children
                for(config::all_children_iterator i = cfg.ordered_begin(); i != 
cfg.ordered_end(); ++i) {
                        const std::pair<const std::string*,const config*>& 
value = *i;
                        config& childcfg = 
resolved_config.add_child(*value.first);
-                       do_resolve_rects(*value.second, childcfg, topcfg,
-                                        (*value.first =="resolution") ? 
&childcfg : resol_cfg);
+                       do_resolve_rects(*value.second, childcfg, (*value.first 
=="resolution") ? &childcfg : resol_cfg);
                }
 
                // copy all key/values
@@ -437,7 +435,7 @@
 theme::theme(const config& cfg, const SDL_Rect& screen) {
        config tmp;
        expand_partialresolution(tmp, cfg);
-       do_resolve_rects(tmp, cfg_, tmp);
+       do_resolve_rects(tmp, cfg_);
        set_resolution(screen);
 }
 




reply via email to

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