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 preferences.cpp prefere...


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src display.cpp preferences.cpp prefere...
Date: Mon, 07 Mar 2005 21:52:45 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    05/03/08 02:52:45

Modified files:
        src            : display.cpp preferences.cpp preferences.hpp 

Log message:
        committed patch to add an option to choose whether the sun moves 
left-to-right or right-to-left

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/display.cpp.diff?tr1=1.291&tr2=1.292&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.cpp.diff?tr1=1.137&tr2=1.138&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.hpp.diff?tr1=1.49&tr2=1.50&r1=text&r2=text

Patches:
Index: wesnoth/src/display.cpp
diff -u wesnoth/src/display.cpp:1.291 wesnoth/src/display.cpp:1.292
--- wesnoth/src/display.cpp:1.291       Thu Mar  3 22:43:25 2005
+++ wesnoth/src/display.cpp     Tue Mar  8 02:52:45 2005
@@ -1,4 +1,4 @@
-/* $Id: display.cpp,v 1.291 2005/03/03 22:43:25 ydirson Exp $ */
+/* $Id: display.cpp,v 1.292 2005/03/08 02:52:45 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -875,11 +875,15 @@
                                } else if(i->image.empty() == false) {
                                        // Draw an image element
                                        surface 
img(image::get_image(i->image,image::UNSCALED));
+
+                                       if(report_num == reports::TIME_OF_DAY 
&& img != NULL && preferences::flip_time()) {
+                                               img = flip_surface(img);
+                                       }
 
                                        if(img == NULL) {
                                                ERR_DP << "could not find image 
for report: '" << i->image << "'\n";
                                                continue;
-                                       }
+                                       }
 
                                        area.x = x;
                                        area.y = y;
Index: wesnoth/src/preferences.cpp
diff -u wesnoth/src/preferences.cpp:1.137 wesnoth/src/preferences.cpp:1.138
--- wesnoth/src/preferences.cpp:1.137   Sat Mar  5 10:54:25 2005
+++ wesnoth/src/preferences.cpp Tue Mar  8 02:52:45 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.cpp,v 1.137 2005/03/05 10:54:25 silene Exp $ */
+/* $Id: preferences.cpp,v 1.138 2005/03/08 02:52:45 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -708,6 +708,16 @@
        haloes = value;
        prefs["show_haloes"] = value ? "yes" : "no";
 }
+
+bool flip_time()
+{
+       return prefs["flip_time"] == "yes";
+}
+
+void set_flip_time(bool value)
+{
+       prefs["flip_time"] = value ? "yes" : "no";
+}
 
 bool show_fps()
 {
@@ -786,7 +796,8 @@
        gui::button fullscreen_button_, turbo_button_, show_ai_moves_button_,
                    show_grid_button_, show_floating_labels_button_, 
turn_dialog_button_,
                    turn_bell_button_, show_team_colours_button_, 
show_colour_cursors_button_,
-                   show_haloing_button_, video_mode_button_, hotkeys_button_, 
gamma_button_;
+                   show_haloing_button_, video_mode_button_, hotkeys_button_, 
gamma_button_,
+                               flip_time_button_;
        gui::label music_label_, sound_label_, scroll_label_, gamma_label_;
        unsigned slider_label_width_;
 
@@ -810,7 +821,8 @@
          show_haloing_button_(disp, _("Show Haloing Effects"), 
gui::button::TYPE_CHECK),
          video_mode_button_(disp, _("Video Mode")),
          hotkeys_button_(disp, _("Hotkeys")),
-         gamma_button_(disp, _("Adjust Gamma"), gui::button::TYPE_CHECK),
+         gamma_button_(disp, _("Adjust Gamma"), gui::button::TYPE_CHECK),
+         flip_time_button_(disp, _("Reverse Time Graphics"), 
gui::button::TYPE_CHECK),
          music_label_(disp, _("Music Volume:")), sound_label_(disp, _("SFX 
Volume:")),
          scroll_label_(disp, _("Scroll Speed:")), gamma_label_(disp, 
_("Gamma:")),
          slider_label_width_(0), tab_(GENERAL_TAB)
@@ -870,6 +882,9 @@
 
        show_team_colours_button_.set_check(show_side_colours());
        show_team_colours_button_.set_help_string(_("Show a colored circle 
around the base of each unit to show which side it is on"));
+
+       flip_time_button_.set_check(flip_time());
+       flip_time_button_.set_help_string(_("Choose whether the sun moves 
left-to-right or right-to-left"));
 
        show_colour_cursors_button_.set_check(use_colour_cursors());
        show_colour_cursors_button_.set_help_string(_("Use colored mouse 
cursors (may be slower)"));
@@ -906,7 +921,8 @@
        gamma_label_.set_location(rect.x, ypos);
        SDL_Rect gamma_rect = { rect.x + slider_label_width_, ypos,
                                rect.w - slider_label_width_ - border, 0 };
-       gamma_slider_.set_location(gamma_rect);
+       gamma_slider_.set_location(gamma_rect);
+       ypos += 50; flip_time_button_.set_location(rect.x,ypos);
        ypos += 50; show_floating_labels_button_.set_location(rect.x, ypos);
        ypos += 50; show_colour_cursors_button_.set_location(rect.x, ypos);
        ypos += 50; show_haloing_button_.set_location(rect.x, ypos);
@@ -961,7 +977,9 @@
                bool hide_gamma = !adjust_gamma();
                gamma_slider_.hide(hide_gamma);
                gamma_label_.hide(hide_gamma);
-       }
+       }
+       if (flip_time_button_.pressed())
+               set_flip_time(flip_time_button_.checked());
        set_sound_volume(sound_slider_.value());
        set_music_volume(music_slider_.value());
        set_scroll_speed(scroll_slider_.value());
@@ -993,7 +1011,8 @@
        show_colour_cursors_button_.hide(hide_display);
        show_haloing_button_.hide(hide_display);
        fullscreen_button_.hide(hide_display);
-       video_mode_button_.hide(hide_display);
+       video_mode_button_.hide(hide_display);
+       flip_time_button_.hide(hide_display);
 
        bool hide_sound = tab_ != SOUND_TAB;
        music_label_.hide(hide_sound);
Index: wesnoth/src/preferences.hpp
diff -u wesnoth/src/preferences.hpp:1.49 wesnoth/src/preferences.hpp:1.50
--- wesnoth/src/preferences.hpp:1.49    Sun Feb 27 18:15:21 2005
+++ wesnoth/src/preferences.hpp Tue Mar  8 02:52:45 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.hpp,v 1.49 2005/02/27 18:15:21 ydirson Exp $ */
+/* $Id: preferences.hpp,v 1.50 2005/03/08 02:52:45 Sirp Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -148,6 +148,9 @@
 
        bool show_fps();
        void set_show_fps(bool value);
+
+       bool flip_time();
+       void set_flip_time(bool value);
 
        bool compress_saves();
 




reply via email to

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