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

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

[Wesnoth-cvs-commits] wesnoth/src/widgets button.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src/widgets button.cpp
Date: Mon, 28 Mar 2005 03:27:02 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/03/28 08:27:02

Modified files:
        src/widgets    : button.cpp 

Log message:
        Remove loading of active-pressed images for buttons, since they are not 
used.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/widgets/button.cpp.diff?tr1=1.61&tr2=1.62&r1=text&r2=text

Patches:
Index: wesnoth/src/widgets/button.cpp
diff -u wesnoth/src/widgets/button.cpp:1.61 wesnoth/src/widgets/button.cpp:1.62
--- wesnoth/src/widgets/button.cpp:1.61 Fri Mar 18 21:21:48 2005
+++ wesnoth/src/widgets/button.cpp      Mon Mar 28 08:27:01 2005
@@ -1,4 +1,4 @@
-/* $Id: button.cpp,v 1.61 2005/03/18 21:21:48 ydirson Exp $ */
+/* $Id: button.cpp,v 1.62 2005/03/28 08:27:01 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -47,24 +47,23 @@
        surface 
button_image(image::get_image(button_image_file,image::UNSCALED));
        surface pressed_image(image::get_image("buttons/" + button_image_name + 
"-pressed.png", image::UNSCALED));
        surface active_image(image::get_image("buttons/" + button_image_name + 
"-active.png", image::UNSCALED));
-       surface pressed_active_image(image::get_image("buttons/" + 
button_image_name + "-active-pressed.png", image::UNSCALED));
+       surface pressed_active_image;
 
-       if(pressed_image == NULL) {
-               
pressed_image.assign(image::get_image(button_image_file,image::UNSCALED));
-       }
+       if (pressed_image.null())
+               pressed_image.assign(button_image);
 
-       if(active_image == NULL) {
-               
active_image.assign(image::get_image(button_image_file,image::UNSCALED));
-       }
+       if (active_image.null())
+               active_image.assign(button_image);
 
-       if(pressed_active_image == NULL) {
-               
pressed_active_image.assign(image::get_image(button_image_file,image::UNSCALED));
+       if (type == TYPE_CHECK) {
+               pressed_active_image.assign(image::get_image("buttons/" + 
button_image_name + "-active-pressed.png",
+                                                            image::UNSCALED));
+               if (pressed_active_image.null())
+                       pressed_active_image.assign(pressed_image);
        }
 
-       if(button_image == NULL) {
-               std::cerr << "could not find button image: '" << 
button_image_file << "'\n";
+       if (button_image.null())
                throw error();
-       }
 
        textRect_.x = 0;
        textRect_.y = 0;
@@ -92,14 +91,13 @@
                
image_.assign(scale_surface(button_image,location().w,location().h));
                
pressedImage_.assign(scale_surface(pressed_image,location().w,location().h));
                
activeImage_.assign(scale_surface(active_image,location().w,location().h));
-               
pressedActiveImage_.assign(scale_surface(pressed_active_image,location().w,location().h));
-
        } else {
                set_width(checkbox_horizontal_padding + textRect_.w + 
button_image->w);
                
image_.assign(scale_surface(button_image,button_image->w,button_image->h));
                
pressedImage_.assign(scale_surface(pressed_image,button_image->w,button_image->h));
                
activeImage_.assign(scale_surface(active_image,button_image->w,button_image->h));
-               
pressedActiveImage_.assign(scale_surface(pressed_active_image,button_image->w,button_image->h));
+               if (type == TYPE_CHECK)
+                       
pressedActiveImage_.assign(scale_surface(pressed_active_image, button_image->w, 
button_image->h));
        }
 }
 




reply via email to

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