[Tux4kids-commits] r1322 - in branches/commonification/tuxmath/trunk: . src

Bolesław Kulbabiński bolekk-guest at alioth.debian.org
Sat Aug 1 18:54:38 UTC 2009


Author: bolekk-guest
Date: 2009-08-01 18:54:38 +0000 (Sat, 01 Aug 2009)
New Revision: 1322

Modified:
   branches/commonification/tuxmath/trunk/
   branches/commonification/tuxmath/trunk/src/SDL_extras.c
   branches/commonification/tuxmath/trunk/src/SDL_extras.h
   branches/commonification/tuxmath/trunk/src/globals.h
   branches/commonification/tuxmath/trunk/src/menu.c
   branches/commonification/tuxmath/trunk/src/menu.h
   branches/commonification/tuxmath/trunk/src/setup.c
   branches/commonification/tuxmath/trunk/src/tuxmath.h
Log:
window/full screen size globals moved to SDL_extras.c


Property changes on: branches/commonification/tuxmath/trunk
___________________________________________________________________
Modified: svn:ignore
   - *~
*.o
CMakeFiles
Makefile
Makefile.in
autom4te.cache
configure
config.h
config.h.in
config.log
config.status
autoscan.log
aclocal.m4
tuxmath.spec
tuxmath_preview.spec
stamp-h1

   + *~
*.o
CMakeFiles
Makefile
Makefile.in
autom4te.cache
configure
config.h
config.h.in
config.log
config.status
autoscan.log
aclocal.m4
tuxmath.spec
tuxmath_preview.spec
stamp-h1
t4kcommon


Modified: branches/commonification/tuxmath/trunk/src/SDL_extras.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/SDL_extras.c	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/SDL_extras.c	2009-08-01 18:54:38 UTC (rev 1322)
@@ -19,6 +19,16 @@
 
 
 #ifndef HAVE_LIBT4KCOMMON
+
+/* window size */
+int win_res_x = 640;
+int win_res_y = 480;
+
+/* full screen size (set in initialize_SDL() ) */
+int fs_res_x = 0;
+int fs_res_y = 0;
+
+
 /* DrawButton() creates a translucent button with rounded ends
    and draws it on the screen.
    All colors and alpha values are supported.*/
@@ -148,7 +158,6 @@
   SDL_UnlockSurface(s);
 }
 
-#endif //HAVE_LIBT4KCOMMON
 
 /**********************
  Flip:
@@ -1101,3 +1110,4 @@
 }
 #endif
 
+#endif //HAVE_LIBT4KCOMMON

Modified: branches/commonification/tuxmath/trunk/src/SDL_extras.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/SDL_extras.h	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/SDL_extras.h	2009-08-01 18:54:38 UTC (rev 1322)
@@ -15,9 +15,7 @@
 
 #include "SDL.h"
 
-#ifdef HAVE_LIBT4KCOMMON
-# include "t4kcommon/tux4kids-common.h"
-#else
+#ifndef HAVE_LIBT4KCOMMON
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
 # define rmask 0xff000000
 # define gmask 0x00ff0000
@@ -29,10 +27,8 @@
 # define bmask 0x00ff0000
 # define amask 0xff000000
 #endif
-#endif
 
 /* Non-text graphics functions: */
-#ifndef HAVE_LIBT4KCOMMON
 void            DrawButton(SDL_Rect* target_rect, int radius, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 SDL_Surface*    CreateButton(int w, int h, int radius, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
 void            RoundCorners(SDL_Surface* s, Uint16 radius);

Modified: branches/commonification/tuxmath/trunk/src/globals.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/globals.h	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/globals.h	2009-08-01 18:54:38 UTC (rev 1322)
@@ -27,7 +27,9 @@
 
 #include "config.h"
 
+#ifndef HAVE_LIBT4KCOMMON
 typedef enum { false, true } bool;
+#endif // HAVE_LIBT4KCOMMON
 
 #define min(a,b) (((a) < (b)) ? (a) : (b))
 #define max(a,b) (((a) > (b)) ? (a) : (b))

Modified: branches/commonification/tuxmath/trunk/src/menu.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/menu.c	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/menu.c	2009-08-01 18:54:38 UTC (rev 1322)
@@ -33,6 +33,7 @@
 #include <string.h>
 
 
+#ifndef HAVE_LIBT4KCOMMON
 
 /* create string array of activities' names */
 #define X(name) #name
@@ -1476,3 +1477,4 @@
   DEBUGMSG(debug_menu, "leaving UnloadMenus()\n");
 }
 
+#endif //HAVE_LIBT4KCOMMON

Modified: branches/commonification/tuxmath/trunk/src/menu.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/menu.h	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/menu.h	2009-08-01 18:54:38 UTC (rev 1322)
@@ -15,6 +15,8 @@
 #ifndef MENU_H
 #define MENU_H
 
+#ifndef HAVE_LIBT4KCOMMON
+
 #include "SDL.h"
 #include "globals.h"
 #include "loaders.h"
@@ -99,5 +101,6 @@
 void RunMainMenu(void);
 void UnloadMenus(void);
 
+#endif // HAVE_LIBT4KCOMMON
 #endif // MENU_H
 

Modified: branches/commonification/tuxmath/trunk/src/setup.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/setup.c	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/setup.c	2009-08-01 18:54:38 UTC (rev 1322)
@@ -58,14 +58,6 @@
 /* Global data used in setup.c:              */
 /* (These are now 'extern'd in "tuxmath.h") */
 
-/* window size */
-int win_res_x = 640;
-int win_res_y = 480;
-
-/* full screen size (set in initialize_SDL() ) */
-int fs_res_x = 0;
-int fs_res_y = 0;
-
 SDL_Surface* screen;
 SDL_Surface* images[NUM_IMAGES];
 sprite* sprites[NUM_SPRITES];
@@ -120,7 +112,7 @@
   handle_command_args(argc, argv);
 
 #ifdef HAVE_LIBT4KCOMMON
-  SetDebugMode(debug_status);
+  InitT4KCommon(debug_status);
 #endif
   /* SDL setup in own function:*/
   initialize_SDL();

Modified: branches/commonification/tuxmath/trunk/src/tuxmath.h
===================================================================
--- branches/commonification/tuxmath/trunk/src/tuxmath.h	2009-08-01 18:49:29 UTC (rev 1321)
+++ branches/commonification/tuxmath/trunk/src/tuxmath.h	2009-08-01 18:54:38 UTC (rev 1322)
@@ -24,6 +24,10 @@
 
 #include "config.h"
 
+#ifdef HAVE_LIBT4KCOMMON
+#include <t4kcommon/tux4kids-common.h>
+#endif
+
 // Translation stuff (now works for Mac and Win too!): 
 #include "gettext.h"
 #include <locale.h>
@@ -43,6 +47,7 @@
 //#define NOSOUND
 #include "globals.h"
 
+#ifndef HAVE_LIBT4KCOMMON
 #define MAX_SPRITE_FRAMES   30
 
 typedef struct {
@@ -52,6 +57,7 @@
   int cur;
 } sprite;
 
+#endif //HAVE_LIBT4KCOMMON
 /* Global data gets 'externed' here: */
 
 /* declared in setup.c */




More information about the Tux4kids-commits mailing list