LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mirrormagic-2.0.2.patch of Package mirrormagic (Project home:nemysis:branches:games)

diff -ruB mirrormagic-2.0.2.orig/src/editor.c mirrormagic-2.0.2/src/editor.c
--- mirrormagic-2.0.2.orig/src/editor.c	2001-01-14 17:14:33.000000000 +0100
+++ mirrormagic-2.0.2/src/editor.c	2015-10-15 23:17:26.315930518 +0200
@@ -2751,7 +2751,7 @@
 	break;
       }
 
-      if (!LevelContainsPlayer)
+      if (!LevelContainsPlayer())
 	Request("No Level without Gregor Mc Duffin please !", REQ_CONFIRM);
       else
       {
@@ -2766,7 +2766,7 @@
       break;
 
     case GADGET_ID_TEST:
-      if (!LevelContainsPlayer)
+      if (!LevelContainsPlayer())
 	Request("No Level without Gregor Mc Duffin please !", REQ_CONFIRM);
       else
       {
diff -ruB mirrormagic-2.0.2.orig/src/events.c mirrormagic-2.0.2/src/events.c
--- mirrormagic-2.0.2.orig/src/events.c	2001-01-14 17:14:33.000000000 +0100
+++ mirrormagic-2.0.2/src/events.c	2015-10-15 22:45:03.867600317 +0200
@@ -135,6 +135,13 @@
       HandleClientMessageEvent((ClientMessageEvent *) event);
       break;
 
+#ifdef TARGET_SDL // hack SDL returns this when toggling fullscreen
+    case EVENT_FULLSCREENTOGGLE:
+      if (game_status == SETUP) // redraw the setup screen to update fs status
+        DrawSetupScreen();
+      break;
+#endif
+
     default:
       break;
   }
diff -ruB mirrormagic-2.0.2.orig/src/files.c mirrormagic-2.0.2/src/files.c
--- mirrormagic-2.0.2.orig/src/files.c	2002-03-18 04:09:16.000000000 +0100
+++ mirrormagic-2.0.2/src/files.c	2015-10-15 22:47:18.416938843 +0200
@@ -183,7 +183,11 @@
 static char *getScoreDir(char *level_subdir)
 {
   static char *score_dir = NULL;
+#ifdef USE_USERDATADIR_FOR_COMMONDATA
+  char *data_dir = getUserDataDir();
+#else
   char *data_dir = options.rw_base_directory;
+#endif
   char *score_subdir = SCORES_DIRECTORY;
 
   if (score_dir)
diff -ruB mirrormagic-2.0.2.orig/src/libgame/gadgets.c mirrormagic-2.0.2/src/libgame/gadgets.c
--- mirrormagic-2.0.2.orig/src/libgame/gadgets.c	2003-06-07 17:49:48.000000000 +0200
+++ mirrormagic-2.0.2/src/libgame/gadgets.c	2015-10-15 22:51:07.469494168 +0200
@@ -18,6 +18,12 @@
 #include "text.h"
 #include "misc.h"
 
+/* check for 64bit */
+#ifdef _LP64
+#ifndef L64
+#define L64 1
+#endif
+#endif
 
 /* values for DrawGadget() */
 #define DG_UNPRESSED		0
@@ -301,11 +307,19 @@
 	break;
 
       case GDI_TYPE:
+#ifdef L64
+	gi->type = va_arg(ap, int);
+#else
 	gi->type = va_arg(ap, unsigned long);
+#endif
 	break;
 
       case GDI_STATE:
+#ifdef L64
+	gi->state = va_arg(ap, int);
+#else
 	gi->state = va_arg(ap, unsigned long);
+#endif
 	break;
 
       case GDI_CHECKED:
diff -ruB mirrormagic-2.0.2.orig/src/libgame/sdl.c mirrormagic-2.0.2/src/libgame/sdl.c
--- mirrormagic-2.0.2.orig/src/libgame/sdl.c	2002-03-19 04:10:37.000000000 +0100
+++ mirrormagic-2.0.2/src/libgame/sdl.c	2015-10-15 22:53:38.357846146 +0200
@@ -14,7 +14,7 @@
 #include "system.h"
 #include "sound.h"
 #include "misc.h"
-
+#include "../main.h"
 
 #if defined(TARGET_SDL)
 
@@ -930,6 +930,20 @@
       ((ButtonEvent *)event)->y = 0;
   }
 #endif
+  if (event->type == EVENT_KEYPRESS)
+  {
+    /* make alt + enter toggle fullscreen */
+    if ( (((KeyEvent *)event)->keysym.sym == KSYM_Return) &&
+         (((KeyEvent *)event)->keysym.mod == KMOD_LALT) )
+    {
+      if(SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()))
+      {
+        video.fullscreen_enabled = !video.fullscreen_enabled;
+        setup.fullscreen = video.fullscreen_enabled;
+      }
+      event->type = EVENT_FULLSCREENTOGGLE;
+    }
+  }
 }
 
 #endif /* TARGET_SDL */
diff -ruB mirrormagic-2.0.2.orig/src/libgame/sdl.h mirrormagic-2.0.2/src/libgame/sdl.h
--- mirrormagic-2.0.2.orig/src/libgame/sdl.h	2002-03-19 03:40:33.000000000 +0100
+++ mirrormagic-2.0.2/src/libgame/sdl.h	2015-10-15 22:58:53.561547898 +0200
@@ -87,6 +87,7 @@
 #define EVENT_CLIENTMESSAGE	SDL_QUIT
 #define EVENT_MAPNOTIFY		SDL_USEREVENT + 4
 #define EVENT_UNMAPNOTIFY	SDL_USEREVENT + 5
+#define EVENT_FULLSCREENTOGGLE	SDL_USEREVENT + 6
 
 #define KSYM_UNDEFINED		SDLK_UNKNOWN
 
diff -ruB mirrormagic-2.0.2.orig/src/main.h mirrormagic-2.0.2/src/main.h
--- mirrormagic-2.0.2.orig/src/main.h	2003-06-07 18:04:37.000000000 +0200
+++ mirrormagic-2.0.2/src/main.h	2015-10-15 22:59:56.760683373 +0200
@@ -459,7 +459,6 @@
 #endif
 extern struct HiScore		highscore[];
 extern struct TapeInfo		tape;
-extern struct JoystickInfo	joystick[];
 extern struct SetupInfo		setup;
 extern struct GameInfo		game;
 extern struct LaserInfo		laser;
diff -ruB mirrormagic-2.0.2.orig/src/tools.c mirrormagic-2.0.2/src/tools.c
--- mirrormagic-2.0.2.orig/src/tools.c	2002-03-19 03:53:26.000000000 +0100
+++ mirrormagic-2.0.2/src/tools.c	2015-10-15 23:00:47.602798343 +0200
@@ -1202,7 +1202,7 @@
       ty--; 
       continue; 
     }
-    sprintf(txt, text); 
+    sprintf(txt, "%s", text);
     txt[tl] = 0;
     DrawTextExt(drawto,
 		DX + 51 - (tl * 14)/2, DY + 8 + ty * 16,