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 images/misc/leader-crow...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth src/display.cpp images/misc/leader-crow...
Date: Wed, 06 Oct 2004 14:59:39 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      04/10/06 18:52:41

Modified files:
        src            : display.cpp 
Added files:
        images/misc    : leader-crown.png 

Log message:
        Now that the leader can be chosen in multiplayer, I feel this is 
appropriate to add some distinctive sign to leaders. This commit provides a 
workable quick but functional suggestion on how to do it. Revert if not 
appropriate.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/images/misc/leader-crown.png?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.264&tr2=1.265&r1=text&r2=text

Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.264 wesnoth/src/display.cpp:1.265
--- wesnoth/src/display.cpp:1.264       Tue Oct  5 21:28:12 2004
+++ wesnoth/src/display.cpp     Wed Oct  6 18:52:41 2004
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.264 2004/10/05 21:28:12 silene Exp $ */
+/* $Id: display.cpp,v 1.265 2004/10/06 18:52:41 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1237,13 +1237,21 @@
        if(u.experience() > 0 && u.can_advance()) {
                const double filled = 
double(u.experience())/double(u.max_experience());
                const int level = maximum<int>(u.type().level(),1);
-               const SDL_Color normal_colour = {02,153,255,0}, 
near_advance_colour = {255,255,255,0};
+               const SDL_Color normal_colour = {2,153,255,0}, 
near_advance_colour = {255,255,255,0};
                const bool near_advance = u.max_experience() - u.experience() 
<= game_config::kill_experience*level;
                const SDL_Color colour = near_advance ? near_advance_colour : 
normal_colour;
 
                
draw_bar("misc/bar-energy-enemy.png",xpos+5,ypos,u.max_experience()/(level*2),filled,colour,bar_alpha);
        }
 
+       if (u.can_recruit()) {
+               surface 
crown(image::get_image("misc/leader-crown.png",image::SCALED,image::NO_ADJUST_COLOUR));
+               if(!crown.null()) {
+                       SDL_Rect r = {0, 0, crown->w, crown->h};
+                       blit_surface(xpos,ypos,crown,&r);
+               }
+       }
+
        const std::vector<std::string>& overlays = it->second.overlays();
        for(std::vector<std::string>::const_iterator ov = overlays.begin(); ov 
!= overlays.end(); ++ov) {
                const surface img(image::get_image(*ov));




reply via email to

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