mail[Wesnoth-commits] r28932 - in /trunk/src: titlescreen.cpp titlescreen.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 24, 2008 - 14:28:
Author: mordante
Date: Sun Aug 24 14:28:35 2008
New Revision: 28932

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28932&view=rev
Log:
Fix the assumption the TITLE_RESULT starts at 0.

We now do the assumption TUTORIAL is the first item, but that's
documented. The change is needed as prerequisites to change the title
screen to the new widget code. Also change a C-style cast to
static_cast.

Modified:
    trunk/src/titlescreen.cpp
    trunk/src/titlescreen.hpp

Modified: trunk/src/titlescreen.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.cpp?rev=28932&r1=28931&r2=28932&view=diff
==============================================================================
--- trunk/src/titlescreen.cpp (original)
+++ trunk/src/titlescreen.cpp Sun Aug 24 14:28:35 2008
@@ -487,7 +487,7 @@
                events::pump();
                for(size_t b = 0; b != buttons.size(); ++b) {
                        if(buttons[b].pressed()) {
-                               return TITLE_RESULT(b);
+                               return static_cast<TITLE_RESULT>(b + 
TUTORIAL);
                        }
                }
 

Modified: trunk/src/titlescreen.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.hpp?rev=28932&r1=28931&r2=28932&view=diff
==============================================================================
--- trunk/src/titlescreen.hpp (original)
+++ trunk/src/titlescreen.hpp Sun Aug 24 14:28:35 2008
@@ -20,7 +20,11 @@
 
 namespace gui {
 
-/** Values for the menu-items of the main menu. */
+/** 
+ * Values for the menu-items of the main menu. 
+ *
+ * The code assumes TUTORIAL is the first item.
+ */
 enum TITLE_RESULT { TUTORIAL = 0,              /**< Start special campaign 
'tutorial' */
                                        NEW_CAMPAIGN,           /**< Let user 
select a campaign to play */
                                        MULTIPLAYER,            /**< Play 
single scenario against humans or AI */




Related Messages


Powered by MHonArc, Updated Sun Aug 24 15:42:39 2008