Author: ilor
Date: Mon Sep 22 22:56:45 2008
New Revision: 29652

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29652&view=rev
Log:
allow control of credits scroll speed with up and down arrows

Modified:
    trunk/src/about.cpp

Modified: trunk/src/about.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/about.cpp?rev=29652&r1=29651&r2=29652&view=diff
==============================================================================
--- trunk/src/about.cpp (original)
+++ trunk/src/about.cpp Mon Sep 22 22:56:45 2008
@@ -253,6 +253,7 @@
        bool recalculate_textbox = true;
 
        int image_count=0;
+       int scroll_speed = 4;           // scroll_speed*50 = speed of scroll in 
pixel per second
        do {
                last_escape = key[SDLK_ESCAPE] != 0;
 
@@ -298,10 +299,9 @@
                } while(y<map_rect.y + map_rect.h - bottom_margin);
 
                // performs the actual scrolling
-               const int scroll_speed = 4;             // scroll_speed*50 = 
speed of scroll in pixel per second
 
                offset += scroll_speed;
-               if(offset>=first_line_height) {
+               if (offset>=first_line_height) {
                        offset -= first_line_height;
                        is_new_line = true;
                        startline++;
@@ -318,6 +318,13 @@
                
SDL_BlitSurface(map_image,&lower_src,video.getSurface(),&lower_dest);
 
                // handle events
+               if (key[SDLK_UP] && scroll_speed < 20) {
+                       ++scroll_speed;
+               }
+               if (key[SDLK_DOWN] && scroll_speed > 0) {
+                       --scroll_speed;
+               }
+               
                events::pump();
                events::raise_process_event();
                events::raise_draw_event();


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to