rpms/xgalaxy/devel xgalaxy-2.0.34-fullscreen.patch, NONE, 1.1 xgalaxy-2.0.34-warn.patch, NONE, 1.1 xgalaxy-2.0.34-xgalaxy.patch, NONE, 1.1 xgalaxy-hyperspace.desktop, NONE, 1.1 xgalaxy.desktop, NONE, 1.1 xgalaxy.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Hans de Goede (jwrdegoede)
fedora-extras-commits at redhat.com
Wed May 31 14:32:29 UTC 2006
- Previous message (by thread): rpms/xgalaxy import.log,1.1,1.2
- Next message (by thread): rpms/workrave/devel .cvsignore, 1.3, 1.4 sources, 1.3, 1.4 workrave.spec, 1.5, 1.6 workrave-1.8.2-cpp-fix.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jwrdegoede
Update of /cvs/extras/rpms/xgalaxy/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2148/devel
Modified Files:
.cvsignore sources
Added Files:
xgalaxy-2.0.34-fullscreen.patch xgalaxy-2.0.34-warn.patch
xgalaxy-2.0.34-xgalaxy.patch xgalaxy-hyperspace.desktop
xgalaxy.desktop xgalaxy.spec
Log Message:
auto-import xgalaxy-2.0.34-2 on branch devel from xgalaxy-2.0.34-2.src.rpm
xgalaxy-2.0.34-fullscreen.patch:
--- NEW FILE xgalaxy-2.0.34-fullscreen.patch ---
--- xgalaga-2.0.34/libsprite/struct.h.fs 1998-04-12 08:03:23.000000000 +0200
+++ xgalaga-2.0.34/libsprite/struct.h 2006-05-22 11:45:35.000000000 +0200
@@ -55,6 +55,8 @@
W_Callback handle_button;
W_Callback handle_expose;
#endif /* 0 */
+ W_Window wm_window;
+ Window fs_window;
};
struct stringList {
--- xgalaga-2.0.34/libsprite/data.c.fs 2006-05-22 11:45:35.000000000 +0200
+++ xgalaga-2.0.34/libsprite/data.c 2006-05-22 11:45:35.000000000 +0200
@@ -158,3 +158,6 @@
int useBuffered = 1;
+#ifdef XF86VIDMODE
+struct xf86vidmode_data XF86VidModeData = { 1, { 0 }, 0, 0 };
+#endif
--- xgalaga-2.0.34/libsprite/Wlib.h.fs 1998-04-12 08:03:22.000000000 +0200
+++ xgalaga-2.0.34/libsprite/Wlib.h 2006-05-22 11:45:35.000000000 +0200
@@ -91,6 +91,22 @@
extern int autoPoint, W_KeyDepth, animPointers, useWorkbench;
extern unsigned long w_socket;
+
+/* For XF86VIDMODE Support */
+#ifdef XF86VIDMODE
+#include <X11/extensions/xf86dga.h>
+#include <X11/extensions/xf86vmode.h>
+
+struct xf86vidmode_data {
+ int vidmode_available;
+ XF86VidModeModeInfo orig_mode;
+ int orig_viewport_x;
+ int orig_viewport_y;
+};
+
+extern struct xf86vidmode_data XF86VidModeData;
+#endif
+
#endif /* AMIGA */
#if 0
--- xgalaga-2.0.34/libsprite/mapwindow.c.fs 1998-04-12 08:03:22.000000000 +0200
+++ xgalaga-2.0.34/libsprite/mapwindow.c 2006-05-22 11:45:35.000000000 +0200
@@ -13,6 +13,8 @@
if(win->type != WIN_BORDER && win->borderwin) {
W_MapWindow(win->borderwin);
}
+ if (win->wm_window)
+ W_MapWindow(win->wm_window);
if (win->mapped)
return;
win->mapped = 1;
@@ -36,6 +38,8 @@
if(win->type != WIN_BORDER && win->borderwin) {
W_UnmapWindow(win->borderwin);
}
+ if (win->wm_window)
+ W_UnmapWindow(win->wm_window);
}
int
@@ -75,17 +79,25 @@
W_Window window;
{
struct window *win;
-
+ W_Window wm_window;
#ifdef DEBUG
printf("Destroying %d\n", window);
#endif
win = W_Void2Window(window);
+ wm_window = win->wm_window;
+
+ if(win->fs_window != None)
+ W_ToggleFullscreen(window);
+
deleteWindow(win);
XDestroyWindow(W_Display, win->window);
if(win->buffer) XFreePixmap(W_Display, win->buffer);
if(win->type != WIN_BORDER && win->borderwin)
W_DestroyWindow(win->borderwin);
free((char *) win);
+
+ if (wm_window)
+ W_DestroyWindow(wm_window);
}
void
--- xgalaga-2.0.34/libsprite/init.c.fs 2006-05-22 11:45:35.000000000 +0200
+++ xgalaga-2.0.34/libsprite/init.c 2006-05-22 11:45:35.000000000 +0200
@@ -356,6 +356,31 @@
XFreeModifiermap(m);
}
+#ifdef XF86VIDMODE
+static void
+xf86_vidmode_init ( void )
+{
+ int i,j;
+ XF86VidModeModeLine *l = (XF86VidModeModeLine *)((char *)
+ &XF86VidModeData.orig_mode + sizeof XF86VidModeData.orig_mode.dotclock);
+
+ if (!XF86VidModeQueryVersion(W_Display, &i, &j))
+ XF86VidModeData.vidmode_available = 0;
+ else if (!XF86VidModeQueryExtension(W_Display, &i, &j))
+ XF86VidModeData.vidmode_available = 0;
+ else if (!XF86VidModeGetModeLine(W_Display, W_Screen,
+ (int *)&XF86VidModeData.orig_mode.dotclock, l))
+ XF86VidModeData.vidmode_available = 0;
+ else if (!XF86VidModeGetViewPort(W_Display, W_Screen,
+ &XF86VidModeData.orig_viewport_x,
+ &XF86VidModeData.orig_viewport_y))
+ XF86VidModeData.vidmode_available = 0;
+
+ if (!XF86VidModeData.vidmode_available)
+ fprintf(stderr, "Warning: XF86VidMode not available\n");
+}
+#endif
+
void
W_Initialize(str)
char *str;
@@ -395,5 +420,9 @@
GetAltMask();
backColor = W_Black;
+
+#ifdef XF86VIDMODE
+ xf86_vidmode_init();
+#endif
}
--- xgalaga-2.0.34/libsprite/makewindow.c.fs 2006-05-22 11:45:35.000000000 +0200
+++ xgalaga-2.0.34/libsprite/makewindow.c 2006-05-22 11:45:35.000000000 +0200
@@ -236,6 +236,10 @@
neww->type = type;
neww->mapped = 0;
neww->insensitive = 0;
+#ifdef XF86VIDMODE
+ neww->wm_window = NULL;
+ neww->fs_window = None;
+#endif
addToHash(neww);
return (neww);
}
@@ -454,6 +458,22 @@
int border;
W_Color color;
{
+ /* When creating a toplevel window create a real toplevel
+ window and a child window of the same dimensions. Then when switching
+ fullscreen we can create a fullscreen window and reparent the child
+ window to the fullscreen window and back again when switching to
+ windowed mode again. */
+ if(parent == NULL)
+ {
+ W_Window wm_window = w_MakeWindow(name, x, y, width, height, 0,
+ cursname, border, color, WIN_GRAPH);
+ struct window *child_window = (struct window *)w_MakeWindow(
+ name, x, y, width, height,
+ wm_window, cursname, border, color,
+ WIN_GRAPH);
+ child_window->wm_window = wm_window;
+ return (W_Window)child_window;
+ }
return w_MakeWindow(name, x, y, width, height, parent,
cursname, border, color, WIN_GRAPH);
}
@@ -498,5 +518,208 @@
XSetWMHints(W_Display, W_Void2Window(win)->window, &hints);
}
+#ifdef XF86VIDMODE
+/* qsort comparison function for sorting the modes */
+static int cmpmodes(const void *va, const void *vb)
+{
+ const XF86VidModeModeInfo *a = *(const XF86VidModeModeInfo **)va;
+ const XF86VidModeModeInfo *b = *(const XF86VidModeModeInfo **)vb;
+ if ( a->hdisplay == b->hdisplay )
+ return b->vdisplay - a->vdisplay;
+ else
+ return b->hdisplay - a->hdisplay;
+}
+#endif
+
+void W_ToggleFullscreen(_win)
+ W_Window _win;
+{
+#ifdef XF86VIDMODE
+ int i;
+ XF86VidModeModeLine mode = { .hdisplay = 0, .privsize = 0 };
+ XF86VidModeModeInfo **modes;
+ int mode_count;
+#endif
+ struct window *win = (struct window *)_win;
+ static int mouse_grabbed = 0;
+ static int keyboard_grabbed = 0;
+
+ /* Check we get a nested toplevel WIN_GRAPH window passed */
+ if (win->wm_window == NULL)
+ return;
+
+ /* If there is no fullscreen window enter fullscreen mode, otherwise exit
+ fullscreen mode */
+ if (win->fs_window == None)
+ {
+ XEvent event;
+ XSetWindowAttributes setattr;
+ /* local width and height vars used for fullscreen window size and for
+ storing the video_mode size which is then used to center the window */
+ int fs_width = DisplayWidth(W_Display, W_Screen);
+ int fs_height = DisplayHeight(W_Display, W_Screen);
+
+ /* Create the fullscreen window */
+ setattr.override_redirect = True;
+ setattr.background_pixel = XBlackPixel(W_Display, W_Screen);
+ setattr.border_pixel = XBlackPixel(W_Display, W_Screen);
+ setattr.event_mask = StructureNotifyMask;
+ setattr.colormap = W_Colormap;
+ win->fs_window = XCreateWindow(W_Display, W_Root,
+ 0, 0, fs_width, fs_height, 0,
+ CopyFromParent, InputOutput,
+ CopyFromParent, CWOverrideRedirect |
+ CWBackPixel | CWColormap | CWBorderPixel |
+ CWEventMask, &setattr);
+
+ /* Map the fullscreen window */
+ XMapRaised(W_Display, win->fs_window);
+ /* wait until we are mapped. (shamelessly borrowed from SDL) */
+ do {
+ XMaskEvent(W_Display, StructureNotifyMask, &event);
+ } while ( (event.type != MapNotify) ||
+ (event.xmap.event != win->fs_window) );
+ /* Make sure we got to the top of the window stack */
+ XRaiseWindow(W_Display, win->fs_window);
+
+ /* Reparent the real window */
+ XReparentWindow(W_Display, win->window, win->fs_window, 0, 0);
+
+ /* Grab the keyboard and mouse. */
+ if (XGrabKeyboard(W_Display, win->window, False, GrabModeAsync,
+ GrabModeAsync, CurrentTime) != GrabSuccess)
+ fprintf(stderr, "Warning can not grab keyboard\n");
+ else
+ keyboard_grabbed = 1;
+
+ if (XGrabPointer(W_Display, win->window, False,
+ PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync, GrabModeAsync, win->window, None,
+ CurrentTime) != GrabSuccess)
+ fprintf(stderr, "Warning can not grab mouse\n");
+ else
+ mouse_grabbed = 1;
+
+#ifdef XF86VIDMODE
+ /* Try to switch video mode. This must be done after the pointer is
+ grabbed, because otherwise it can be outside the window negating the
+ XF86VidModeSetViewPort. */
+ if (XF86VidModeGetModeLine(W_Display, W_Screen, &i, &mode))
+ {
+ fs_width = mode.hdisplay;
+ fs_height = mode.vdisplay;
+ }
+
+ /* Get list of modelines. */
+ if (!XF86VidModeGetAllModeLines(W_Display, W_Screen, &mode_count, &modes))
+ mode_count = 0;
+
+ /* Search for an exact matching video mode. */
+ for (i = 0; i < mode_count; i++) {
+ if ((modes[i]->hdisplay == win->width) &&
+ (modes[i]->vdisplay == win->height))
+ break;
+ }
+
+ /* Search for a non exact match (smallest bigger res). */
+ if (i == mode_count) {
+ int best_width = 0, best_height = 0;
+ qsort(modes, mode_count, sizeof(void *), cmpmodes);
+ for (i = mode_count-1; i > 0; i--) {
+ if ( ! best_width ) {
+ if ( (modes[i]->hdisplay >= win->width) &&
+ (modes[i]->vdisplay >= win->height) ) {
+ best_width = modes[i]->hdisplay;
+ best_height = modes[i]->vdisplay;
+ }
+ } else {
+ if ( (modes[i]->hdisplay != best_width) ||
+ (modes[i]->vdisplay != best_height) ) {
+ i++;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Switch video mode. */
+ if ((i >= 0) &&
+ ((modes[i]->hdisplay != mode.hdisplay) ||
+ (modes[i]->vdisplay != mode.vdisplay)) &&
+ XF86VidModeSwitchToMode(W_Display, W_Screen, modes[i]))
+ {
+ fs_width = modes[i]->hdisplay;
+ fs_height = modes[i]->vdisplay;
+ }
+
+ /* Lock mode switching. */
+ XF86VidModeLockModeSwitch(W_Display, W_Screen, True);
+
+ /* Set viewport. */
+ XF86VidModeSetViewPort(W_Display, W_Screen, 0, 0);
+
+ /* clean up */
+ if (mode.privsize)
+ XFree(mode.private);
+ if (mode_count)
+ {
+ for (i = 0; i < mode_count; i++)
+ if (modes[i]->privsize)
+ XFree(modes[i]->private);
+ XFree(modes);
+ }
+#endif
+
+ /* Center the window (if nescesarry) */
+ if ((fs_width != win->width) || (fs_height != win->height))
+ XMoveWindow(W_Display, win->window, (fs_width - win->width) / 2,
+ (fs_height - win->height) / 2);
+
+ /* And last blank the cursor */
+ W_BlankCursor(_win);
+ }
+ else
+ {
+ struct window *wm_window = (struct window *)win->wm_window;
+
+ if (mouse_grabbed) {
+ XUngrabPointer(W_Display, CurrentTime);
+ mouse_grabbed = 0;
+ }
+ if (keyboard_grabbed) {
+ XUngrabKeyboard(W_Display, CurrentTime);
+ keyboard_grabbed = 0;
+ }
+#ifdef XF86VIDMODE
+ /* Unlock mode switching. */
+ XF86VidModeLockModeSwitch(W_Display, W_Screen, False);
+
+ if (!XF86VidModeGetModeLine(W_Display, W_Screen, &i, &mode) ||
+ (mode.hdisplay != XF86VidModeData.orig_mode.hdisplay) ||
+ (mode.vdisplay != XF86VidModeData.orig_mode.vdisplay))
+ {
+ if (!XF86VidModeSwitchToMode(W_Display, W_Screen,
+ &XF86VidModeData.orig_mode))
+ fprintf(stderr, "XF86VidMode couldnot restore original resolution\n");
+ }
+ if (XF86VidModeData.orig_viewport_x || XF86VidModeData.orig_viewport_y)
+ {
+ if (!XF86VidModeSetViewPort(W_Display, W_Screen,
+ XF86VidModeData.orig_viewport_x,
+ XF86VidModeData.orig_viewport_y))
+ fprintf(stderr, "XF86VidMode couldnot restore original viewport\n");
+ }
+ XSync(W_Display, False);
+#endif
+ /* Reparent the real window! */
+ XReparentWindow(W_Display, win->window, wm_window->window, 0, 0);
+ XUnmapWindow(W_Display, win->fs_window);
+ XDestroyWindow(W_Display, win->fs_window);
+ win->fs_window = None;
+
+ /* And last unblank the cursor */
+ W_RevertCursor(_win);
+ }
+}
--- xgalaga-2.0.34/libsprite/Wproto.h.fs 1998-04-12 08:03:22.000000000 +0200
+++ xgalaga-2.0.34/libsprite/Wproto.h 2006-05-22 11:45:35.000000000 +0200
@@ -63,6 +63,7 @@
W_Window W_MakeTextWindow(char *name, int x, int y, int width, int height, W_Window parent, char *cursname, int border);
W_Window W_MakeScrollingWindow(char *name, int x, int y, int width, int height, W_Window parent, char *cursname, int border);
void W_SetIconWindow(W_Window win, W_Window icon);
+void W_ToggleFullscreen(W_Window win);
/* point.c */
void W_DrawPoint(W_Window window, int x, int y, W_Color color);
void FlushPointCache(Window win, int color);
--- xgalaga-2.0.34/defs.h.fs 2006-05-22 11:45:35.000000000 +0200
+++ xgalaga-2.0.34/defs.h 2006-05-22 11:45:35.000000000 +0200
@@ -26,8 +26,9 @@
#define TORPDELAY 5
-#define WINWIDTH 400
-#define WINHEIGHT 500
+/* Modified slightly to better fit on 800x600 in fullscreen mode */
+#define WINWIDTH 464 /* was 400 */
+#define WINHEIGHT 580 /* was 500 */
#define NUMSTARS 30
--- xgalaga-2.0.34/Wlib.h.fs 1998-04-12 08:03:20.000000000 +0200
+++ xgalaga-2.0.34/Wlib.h 2006-05-22 11:45:35.000000000 +0200
@@ -91,6 +91,22 @@
extern int autoPoint, W_KeyDepth, animPointers, useWorkbench;
extern unsigned long w_socket;
+
+/* For XF86VIDMODE Support */
+#ifdef XF86VIDMODE
+#include <X11/extensions/xf86dga.h>
+#include <X11/extensions/xf86vmode.h>
+
+struct xf86vidmode_data {
+ int vidmode_available;
+ XF86VidModeModeInfo orig_mode;
+ int orig_viewport_x;
+ int orig_viewport_y;
+};
+
+extern struct xf86vidmode_data XF86VidModeData;
+#endif
+
#endif /* AMIGA */
#if 0
--- xgalaga-2.0.34/main.c.fs 2006-05-22 11:45:36.000000000 +0200
+++ xgalaga-2.0.34/main.c 2006-05-22 11:45:35.000000000 +0200
@@ -32,6 +32,7 @@
static int attacking = 0, maxattacking, entering=0;
static int maxetorps = 5, numetorps=0;
static int plflash = 50;
+static int fullscreen = 0;
#ifndef ORIGINAL_XGALAGA
static int shots = 0;
static int hits = 0;
@@ -63,10 +64,14 @@
xgal_exit(int v)
{
/* W_AutoRepeatOn();*/
+ /* Destroy our main window so the fullscreen mode gets unset if we're
+ running fullscreen. (We should really clean up much more here!) */
+ W_DestroyWindow(shellWin);
#ifdef SOUND
kill_sound();
#endif
/* sleep(1);*/ /* Without this, the auto-repeat request fails on my machine... */
+ /* Note if we ever need this autorepeat thingie again, the sleep can and should be replaced by a call to XSync() */
exit(v);
}
@@ -89,6 +94,7 @@
-mouse Use mouse control (same as 'm' at the title screen)\n\
-keyboard Use keyboard control (same as 'k')\n%s\
-level <number> Choose starting level (>= 1)\n\
+-window Start in windowed mode instead of fullscreen\n\
-b turn buffered mode off, use this if it runs\n\
too slowly. Will cause flicker, maybe lots,\n\
maybe only a little.\n\
@@ -105,7 +111,8 @@
p - pauses\n\
q - end this game\n\
b - Toggle buffering (flicker vs. speed.)\n\
-o - Toggle OR mode. Don't use this, it sucks.\n", VERSION,
+o - Toggle OR mode. Don't use this, it sucks.\n\
+alt + enter - Toggle fullscreen - window\n", VERSION,
PRINT_SOUND
);
}
@@ -844,6 +851,14 @@
case 'm':
mouseControl = 2;
break;
+ case '\r'+256:
+ W_ToggleFullscreen(shellWin);
+ fullscreen = !fullscreen;
+ if (fullscreen)
+ W_BlankCursor(baseWin);
+ else
+ W_RevertCursor(baseWin);
+ break;
default:
break;
}
@@ -997,6 +1012,14 @@
maxtorps = MINTORPS;
break;
#endif /* IM_A_BIG_FAT_CHEATER */
+ case '\r'+256:
+ W_ToggleFullscreen(shellWin);
+ fullscreen = !fullscreen;
+ if (fullscreen)
+ W_BlankCursor(baseWin);
+ else
+ W_RevertCursor(baseWin);
+ break;
default:
break;
}
@@ -1214,6 +1237,7 @@
int ac;
char *dpyname = 0;
int mx, my, but;
+ int start_fullscreen = 1;
for(ac = 1; ac < argc; ac++) {
if(*argv[ac] == '-') {
@@ -1245,6 +1269,8 @@
useOR = 0;
} else if (strcmp(argv[ac], "-noclipmask") == 0) {
useClipMask = 0;
+ } else if (strcmp(argv[ac], "-window") == 0) {
+ start_fullscreen = 0;
} else {
print_usage();
exit(0);
@@ -1263,6 +1289,12 @@
W_Buffer(shellWin, 0);
W_MapWindow(shellWin);
W_MapWindow(baseWin);
+ if (start_fullscreen)
+ {
+ W_ToggleFullscreen(shellWin);
+ W_BlankCursor(baseWin);
+ fullscreen = 1;
+ }
/* W_AutoRepeatOff();*/
--- xgalaga-2.0.34/Wproto.h.fs 1998-04-12 08:03:20.000000000 +0200
+++ xgalaga-2.0.34/Wproto.h 2006-05-22 11:45:35.000000000 +0200
@@ -63,6 +63,7 @@
W_Window W_MakeTextWindow(char *name, int x, int y, int width, int height, W_Window parent, char *cursname, int border);
W_Window W_MakeScrollingWindow(char *name, int x, int y, int width, int height, W_Window parent, char *cursname, int border);
void W_SetIconWindow(W_Window win, W_Window icon);
+void W_ToggleFullscreen(W_Window win);
/* point.c */
void W_DrawPoint(W_Window window, int x, int y, W_Color color);
void FlushPointCache(Window win, int color);
xgalaxy-2.0.34-warn.patch:
--- NEW FILE xgalaxy-2.0.34-warn.patch ---
--- xgalaga-2.0.34/libsprite/image.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/libsprite/image.c 2006-05-11 22:28:08.000000000 +0200
@@ -210,7 +210,7 @@
if(image->compiled_in) {
if(image->xbmdata) {
image->clipmask = XCreateBitmapFromData(W_Display, W_Root,
- image->xbmdata, image->width, image->height);
+ (char *)image->xbmdata, image->width, image->height);
ErrorStatus = BitmapSuccess;
} else {
ErrorStatus = !BitmapSuccess;
--- xgalaga-2.0.34/libsprite/line.c.warn 1998-04-12 08:03:22.000000000 +0200
+++ xgalaga-2.0.34/libsprite/line.c 2006-05-11 22:28:08.000000000 +0200
@@ -37,7 +37,7 @@
W_Window window;
{
Window win = W_Void2Window(window)->drawable;
- register i;
+ int i;
for (i = 0; i < NCOLORS; i++) {
if (_lcache_index[i])
FlushLineCache(win, i);
--- xgalaga-2.0.34/libsprite/makewindow.c.warn 1998-04-12 08:03:22.000000000 +0200
+++ xgalaga-2.0.34/libsprite/makewindow.c 2006-05-11 22:28:08.000000000 +0200
@@ -4,20 +4,20 @@
#define tiny_height 3
#define tiny_x_hot 1
#define tiny_y_hot 1
-static unsigned char tiny_bits[] = {
+static char tiny_bits[] = {
0x05, 0x02, 0x05, };
-static unsigned char tinymask_bits[] = {
+static char tinymask_bits[] = {
0x05, 0x02, 0x05, };
#define cross_width 16
#define cross_height 16
#define cross_x_hot 7
#define cross_y_hot 7
-static unsigned char cross_bits[] = {
+static char cross_bits[] = {
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00,
0x10, 0x04, 0x3f, 0x7e, 0x10, 0x04, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00};
-static unsigned char crossmask_bits[] = {
+static char crossmask_bits[] = {
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xd0, 0x05,
0xbf, 0x7e, 0x7f, 0x7f, 0xbf, 0x7e, 0xd0, 0x05, 0xe0, 0x03, 0xc0, 0x01,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00};
--- xgalaga-2.0.34/libsprite/point.c.warn 1998-04-12 08:03:23.000000000 +0200
+++ xgalaga-2.0.34/libsprite/point.c 2006-05-11 22:28:08.000000000 +0200
@@ -49,7 +49,7 @@
W_Window window;
{
Window win = W_Void2Window(window)->drawable;
- register i;
+ int i;
for (i = 0; i < NCOLORS; i++) {
if (_pcache_index[i])
FlushPointCache(win, i);
--- xgalaga-2.0.34/libsprite/scroll.c.warn 1998-04-12 08:03:23.000000000 +0200
+++ xgalaga-2.0.34/libsprite/scroll.c 2006-05-11 22:28:08.000000000 +0200
@@ -9,12 +9,11 @@
char *str;
int len;
{
- struct stringList **strings;
char *newstring;
- int count;
+ char **p = & (win->data);
+ struct stringList **strings = (struct stringList **)p ;
+ int count = 0;
- strings = (struct stringList **) & (win->data);
- count = 0;
while ((*strings) != NULL) {
count++;
strings = &((*strings)->next);
--- xgalaga-2.0.34/frate.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/frate.c 2006-05-11 22:28:08.000000000 +0200
@@ -4,6 +4,7 @@
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
--- xgalaga-2.0.34/highscore.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/highscore.c 2006-05-11 22:28:08.000000000 +0200
@@ -191,13 +191,15 @@
if(write(hsf, &x, sizeof(long)) < sizeof(long))
goto error2;
}
+ close(hsf);
}
- close(hsf);
return;
+#ifndef NO_GLOBAL_SCORES
error:
printf("Error saving high scores file %s\n", SCOREFILE);
return;
+#endif
error2:
printf("Error saving high scores file %s\n", my_file_name);
return;
@@ -457,10 +459,10 @@
}
}
return;
+#ifndef NO_GLOBAL_SCORES
error:
if(i>0)
printf("Error reading high scores file '%s'\n", SCOREFILE);
-#ifndef NO_GLOBAL_SCORES
for(i=0;i<NUM_GLOBAL_SCORES;i++) {
#ifdef NOSCOREHOGS
global_scores[i].uid = 0;
@@ -470,8 +472,8 @@
global_scores[i].level = 0;
}
close(hsf);
-#endif
return;
+#endif
error2:
if(i>0)
printf("Error reading high scores file '%s'\n", my_file_name);
--- xgalaga-2.0.34/main.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/main.c 2006-05-11 22:30:11.000000000 +0200
@@ -32,29 +32,31 @@
static int attacking = 0, maxattacking, entering=0;
static int maxetorps = 5, numetorps=0;
static int plflash = 50;
+#ifndef ORIGINAL_XGALAGA
static int shots = 0;
static int hits = 0;
+#endif
#define convoy_x_pos(i) (convoyx+(20 * (i - 10 * (i/10))))
#define convoy_y_pos(i) (20 + (20*(i/10)))
static int moves[16][2] = {
- 0,-4,
- 1,-4,
- 3,-3,
- 4,-1,
- 4,0,
- 4,1,
- 3,3,
- 1,4,
- 0,4,
- -1,4,
- -3,3,
- -4,1,
- -4,0,
- -4,-1,
- -3,-3,
- -1,-4
+ {0,-4},
+ {1,-4},
+ {3,-3},
+ {4,-1},
+ {4,0},
+ {4,1},
+ {3,3},
+ {1,4},
+ {0,4},
+ {-1,4},
+ {-3,3},
+ {-4,1},
+ {-4,0},
+ {-4,-1},
+ {-3,-3},
+ {-1,-4}
};
void
@@ -817,7 +819,9 @@
int mx, my, but;
{
static int torpok;
- static int shotside = 0, shotsidedirection = 1;
+#ifdef ENABLE_MACHINE_GUN
+ static int shotside = 0;
+#endif
W_Event wev;
static int keys = 0;
@@ -1209,7 +1213,6 @@
{
int ac;
char *dpyname = 0;
- long ut;
int mx, my, but;
for(ac = 1; ac < argc; ac++) {
--- xgalaga-2.0.34/paths.c.warn 1998-04-30 07:11:57.000000000 +0200
+++ xgalaga-2.0.34/paths.c 2006-05-11 22:28:08.000000000 +0200
@@ -1197,8 +1197,6 @@
void new_alien(int level, int anum, struct alien *al)
{
- int l = (level-1) % NUMLEVELS;
-
if(get_shape(anum) >= 0) {
al->alive = 1;
al->dying = 0;
--- xgalaga-2.0.34/proto.h.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/proto.h 2006-05-11 22:28:08.000000000 +0200
@@ -1,3 +1,5 @@
+#include <string.h>
+
/* main.c */
void xgal_exit(int v);
int main(int argc, char **argv);
@@ -58,3 +60,9 @@
int get_duration(int, int);
int get_shape(int);
int read_level(int);
+/* frate.c */
+void init_framerate(void);
+void do_framerate(void);
+/* linux-joystick.c */
+void init_joystick(void);
+void do_joystick(int* x, int* y, int* but);
--- xgalaga-2.0.34/sound.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/sound.c 2006-05-11 22:28:08.000000000 +0200
@@ -54,7 +54,10 @@
/* Create a pipe, set the write end to close when we exec the sound server,
and set both (is the write end necessary?) ends to non-blocking */
- pipe(fd);
+ if (pipe(fd)) {
+ audioOK = 0;
+ return;
+ }
soundfd=fd[1];
if( !(child=fork()) ) {
@@ -88,7 +91,9 @@
char c;
c = k;
- if ((playSounds) && (audioOK)) write (soundfd, &c, sizeof (c));
+ if ((playSounds) && (audioOK))
+ if(write (soundfd, &c, sizeof (c)) != sizeof (c))
+ audioOK = 0;
}
@@ -103,7 +108,9 @@
sound_flags[k] |= 1;
c = (unsigned char)(k);
- if ((playSounds) && (audioOK)) write (soundfd, &c, sizeof (c));
+ if ((playSounds) && (audioOK))
+ if(write (soundfd, &c, sizeof (c)) != sizeof (c))
+ audioOK = 0;
}
@@ -121,7 +128,9 @@
char c;
c = -1;
- if ((playSounds) && (audioOK)) write (soundfd, &c, sizeof (c));
+ if ((playSounds) && (audioOK))
+ if(write (soundfd, &c, sizeof (c)) != sizeof (c))
+ audioOK = 0;
}
#endif /* SOUND */
--- xgalaga-2.0.34/xgal.sndsrv.linux.c.warn 2006-05-11 22:28:08.000000000 +0200
+++ xgalaga-2.0.34/xgal.sndsrv.linux.c 2006-05-11 22:28:08.000000000 +0200
@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/soundcard.h>
-/*#include "linux_pcsp.h" /* /usr/include/linux/pcsp.h */
+/*#include "linux_pcsp.h" /usr/include/linux/pcsp.h */
#include <sys/time.h>
#include <signal.h>
#include <string.h>
@@ -39,7 +39,7 @@
#define NUM_SOUNDS (sizeof(FILENAME)/sizeof(char*))
-signed char *sound_buffer[NUM_SOUNDS];
+char *sound_buffer[NUM_SOUNDS];
int sound_size[NUM_SOUNDS];
int fragsize;
@@ -161,10 +161,12 @@
return(0);
};
lseek(fd,0,SEEK_SET);
- read(fd,sound_buffer[k],size);
+ size = read(fd,sound_buffer[k],size);
close(fd);
- for(i=0;i<size;i++) sound_buffer[k][i]^=0x80;
- memset(sound_buffer[k]+size,0,sound_size[k]*fragsize-size);
+ if (size) {
+ for(i=0;i<size;i++) sound_buffer[k][i]^=0x80;
+ memset(sound_buffer[k]+size,0,sound_size[k]*fragsize-size);
+ }
/*fprintf(stderr,"sound has been loaded, %d bytes\n",size);*/ /*DEBUG*/
return(1);
@@ -239,7 +241,7 @@
*/
memset(final,128,sizeof(final));
};
- write (dsp, final, fragsize);
+ i = write (dsp, final, fragsize);
/*
The sound server is in a tight loop, EXCEPT for this
write which blocks. Any optimizations in the above
@@ -251,7 +253,7 @@
-void main (argc, argv)
+int main (argc, argv)
int argc;
char **argv;
{
@@ -264,4 +266,5 @@
if (dsp<0) exit(1);
do_everything (dsp, is_pcsp);
+ return 0;
}
xgalaxy-2.0.34-xgalaxy.patch:
--- NEW FILE xgalaxy-2.0.34-xgalaxy.patch ---
--- xgalaga-2.0.34/README.xgalaxy 2006-05-22 15:31:00.000000000 +0200
+++ xgalaga-2.0.34/README 2006-05-22 15:30:59.000000000 +0200
@@ -44,9 +44,9 @@
<anything else> print usage and version.
Basic instructions:
- It's Galaga, you know how to play Galaga, stop bothering me.
- (Ship follows the mouse, button fires. Auto-fire by holding it
- down, so no-one accuses me of breaking their mouse!)
+ It's just like Galaxian / Galaga, you know how to play Galaxian/ Galaga,
+ stop bothering me. (Ship follows the mouse, button fires. Auto-fire by
+ holding it down, so no-one accuses me of breaking their mouse!)
Keyboard commands:
@@ -73,7 +73,7 @@
games written quickly and painlessly.
Credits:
- Galaga code:
+ XGalaxy code:
Joe Rumsey (mrogre at mediaone.net)
X interface:
Bill Dyess(dyessww at eng.auburn.edu),
--- xgalaga-2.0.34/xgal.6x.xgalaxy 2006-05-22 15:30:59.000000000 +0200
+++ xgalaga-2.0.34/xgal.6x 2006-05-22 15:30:59.000000000 +0200
@@ -1,6 +1,6 @@
-.TH XGALAGA 6x "23 April 2003" "2.0.34"
+.TH XGALAXY 6 "23 April 2003" "2.0.34"
.SH NAME
-xgalaga \- X11 version of the famous Galaga game
+xgalaga \- X11 Galaga like game
.SH SYNOPSIS
.B xgalaxy
[-scores] [-display display] [-mouse] [-keyboard] [-nosound] [-b]
@@ -11,9 +11,9 @@
[-noclipmask] [-nouseor] [-nostars]
.SH INSTRUCTIONS
.LP
-It's Galaga, you know how to play Galaga, stop bothering me.
-(Ship follows the mouse, button fires. Auto-fire by holding it
-down, so no-one accuses me of breaking their mouse!)
+It's just like Galaxian / Galaga, you know how to play Galaxian/ Galaga,
+stop bothering me. (Ship follows the mouse, button fires. Auto-fire by
+holding it down, so no-one accuses me of breaking their mouse!)
.P
The xgalaxy-hyperspace version features some new weapons and different
gameplay.
@@ -69,7 +69,7 @@
.TP 8
x - use your shields (xgalaxy-hyperspace only)
.SH "SEE ALSO"
-Xgalaga home page
+XGalaxy home page
.RI < http://rumsey.org/xgal.html >
.SH AUTHORS
Joe Rumsey, <\fIjoe at rumsey.org\fP> (Original author)
--- xgalaga-2.0.34/images.c.xgalaxy 2006-05-22 15:31:13.000000000 +0200
+++ xgalaga-2.0.34/images.c 2006-05-22 16:14:13.000000000 +0200
@@ -6786,54 +6786,108 @@
/* XPM */
static char * title_xpm[] = {
/* width height ncolors chars_per_pixel */
-"126 37 7 1",
+"136 37 62 1",
/* colors */
-"` c None",
-"a c #606000",
-"b c #909000",
-"c c #C0B000",
-"d c #F0E000",
-"e c #404040",
-"f c #303030",
+" c None",
+". c #303030",
+"+ c #606000",
+"@ c #909000",
+"# c #C0B000",
+"$ c #F0E000",
+"% c #404040",
+"& c #6E6C00",
+"* c #9A9300",
+"= c #DECE00",
+"- c #AFA600",
+"; c #A29A00",
+"> c #C2B200",
+", c #B7B000",
+"' c #C8BD00",
+") c #DDCD01",
+"! c #DBCD05",
+"~ c #A5A100",
+"{ c #C8B800",
+"] c #E3D300",
+"^ c #C2BA00",
+"/ c #9C9400",
+"( c #C4B400",
+"_ c #C3B300",
+": c #B8B100",
+"< c #D3C600",
+"[ c #B4AA04",
+"} c #9F940E",
+"| c #32322F",
+"1 c #A09D00",
+"2 c #34342E",
+"3 c #A69D03",
+"4 c #C7B700",
+"5 c #949300",
+"6 c #C1B100",
+"7 c #CCC200",
+"8 c #9B9314",
+"9 c #C5B500",
+"0 c #ACA600",
+"a c #EADB00",
+"b c #BFB307",
+"c c #35352E",
+"d c #6A6900",
+"e c #979100",
+"f c #EADA00",
+"g c #989100",
+"h c #B6AE00",
+"i c #A19D00",
+"j c #E9D900",
+"k c #D9CB00",
+"l c #B1AB00",
+"m c #ADA10E",
+"n c #656121",
+"o c #BCB500",
+"p c #7A7800",
+"q c #C0B800",
+"r c #42412B",
+"s c #676600",
+"t c #38372D",
+"u c #8D8700",
+"v c #AAA300",
+"w c #666500",
/* pixels */
-"`````````````````faf`````````````````````````````````````````````````faf``````````````````````````````````````````````````````",
-"````fabf````````fccbf`````````fabbbf````````````````````````````````fccbf`````````````````````````````````````````````````````",
-"```fccdbf``````acddda```````fbccdddbbf`````````````````````````````acddda`````````````````````````````````````````````````````",
-"``abcddda`````aabddda``````fccdbaaccdbf```````````````````````````acdddda`````````````````````````````````````````````````````",
-"`accdddbf````aaacddbf`````acdbaaababddbf`````````````````````````abcdbcda`````````````````````````````````````````````````````",
-"`cccddda`````fabcdda`````acddaffbaaabddbf```````````````````````accdbbcda`````````````````````````````````````````````````````",
-"`ccabdda`````abcddbf````abcdbf``fbaaabdda```````````````````````cbcdabcbf`````````````````````````````````````````````````````",
-"`caacddcf````bbcdbf````abcdbf````fbaacddcf``````````````````````bbcdaaca``````````````````````````````````````````````````````",
-"`fbcabdda```abcdda`````acdbf``````fbccddda`````````````````````accddabca``````````````````````````````````````````````````````",
-"``caacddcf``bbcdbf````abcda````````ccabdbf`````````````````````cccdbacbf``````````````````````````````````````````````````````",
-"``fbcabdda`abcdbf````accdda````````caaaae``````````````````````cccdaaca``````````````````````````````fabbf````````````````````",
-"```caacddcfacdda`````cbcdbf````````fbaaf```````````````````````cccdccbf`````````````````````````````fccdda````````````````````",
-"```fbcabddbcddbf`````bbcda``````````ff```````````````fabbf`````cbcddda````````````````fabbf````````acdddbf```````````fabbf````",
-"````caaabddddbf`````accdda`````````````````````````fbccdbf`````bbcddbf``````````````fbccdbf```````acdddbf``````````fbccdbf````",
-"````fbaaabddbf``````cccdda```````````````````````fbccbaae`````accddda`````````````fbccbaae```````abcdbae`````````fbccbaae`````",
-"`````fbaacdda```````cbcdda``````````````````````fccbaaafaf````cccddbf````````````fccbaaafaf`````abcdbaf`````````fccbaaafaf````",
-"``````facdddcf``````bbcdda````````````````````fbcdbafffcca````cccdda```````````fbcdbafffcca`````bbcbf`````````fbcdbafffcca````",
-"``````acdbcdda`````accddda```````````fabf````fccdbf``acdda````cbcddcf`````````fccdbf``acdda````abcda`````````fccdbf``acdda````",
-"`````abcbbabdcf````cccddda``````````fbcda```acddbf``acddda````acdddda````````acddbf``acddda````acdbf````````acddbf``acddda````",
-"````abcdaaaabcbf```ccabddcf````````aacdda``acddbf``abcddbf```acbcddda```````acddbf``abcddbf```acdda```````fbcddbf``abcddbf````",
-"````acdbebaacdda```caacddda````````acddda`abcdbf``abcbcda```acbbcddda`````fbcddbf``abcbcda```aaacdcf`````fccddbf``abcbcda```ff",
-"```abcbf`fbcabdcf``fbccdddcf``````acdddbfacabda``fbcbbcda``acbbcabddcf```fcbacda``fbcbbcda``acaacdda````acbacda``fbcbbcda``fba",
-"``abcbf```caaabcbf``ccabdddbf````acdddda`caacdcbbccdabcdcbbcbfcaacdddbbbbcbaacdcbbccdabcdcbbcbaccddcf``acbaacdcbbccdabcdcbbcbf",
-"``acbf````fbaaabcbf`caaabdddbbbbbcbcddda`fabcdddddbaacabcddbf`fbcabddddddbfabcdddddbaacabcddbfccabddbbbcbfabcdddddbaacabcddbf`",
-"`abca``````fbaaaaba`fbaaaacdddddbabcddda`acabddddbafcaaaaaae```caaabdddbaeacabddddbafcaaaaaae`caaabddddbfacabddddbafcaaaaaae``",
-"acaaf```````fbaaaa```fbaabaaaaaaaaccddda`caaaaaaae``fbaaaaf````fbaaaaaaaf`caaaaaaae``fbaaaaf``fbaaabddda`caaaaaaae``fbaaaaf```",
-"caaf`````````ffbe`````ffbaaaaaaf`cccddbf`fbaaaaaf````ffff```````fbaaaaf```fbaaaaaf````ffff`````fbaacdddcffbaaaaaf````ffff`````",
-"ff`````````````f````````ffffff```cccdda```fffff``````````````````ffff``````fffff````````````````facbaaccbffffff```````````````",
-"`````````````````````````````````cccdda`````````````````````````````````````````````````````````acbaabcdda````````````````````",
-"`````````````````````````````````cccdda````````````````````````````````````````````````````````acbffbcabda````````````````````",
-"`````````````````````````````````cccdda```````````````````````````````````````````````````````abbf``caacda````````````````````",
-"`````````````````````````````````cccdda``````````````````````````````````````````````````````accbf``fabcda````````````````````",
-"`````````````````````````````````cccdda``````````````````````````````````````````````````````cbabbbbbccdbf````````````````````",
-"`````````````````````````````````cccdbf``````````````````````````````````````````````````````caaabcdddbae`````````````````````",
-"`````````````````````````````````ccaae```````````````````````````````````````````````````````fbaaaaaaaaf``````````````````````",
-"`````````````````````````````````caaf`````````````````````````````````````````````````````````fbaaaaaf````````````````````````",
-"`````````````````````````````````ff````````````````````````````````````````````````````````````fffff``````````````````````````"
-};
+" .+. .+. ",
+" .+ at . .##@. .+@@@. .##@. ",
+" .##$@. +#$$$+ .@##$$$@@. +#$$$+ ",
+" +@#$$$+ ++@$$$+ .##$@++##$@. +#$$$$+ ",
+" +##$$$@. +++#$$@. +#$@+++ at +@$$@. +@#$@#$+ ",
+" ###$$$+ .+@#$$+ +#$$+.. at +++@$$@. +##$@@#$+ ",
+" ##+@$$+ +@#$$@. +@#$@. . at +++@$$+ #@#$+@#@. ",
+" #++#$$#. @@#$@. +@#$@. . at ++#$$#. @@#$++#+ ",
+" .@#+@$$+ +@#$$+ +#$@. .@##$$$+ +##$$+@#+ ",
+" #++#$$#. @@#$@. +@#$+ ##+@$@. ###$@+#@. ",
+" .@#+@$$+ +@#$@. +##$$+ #++++% ###$++#+ .+ .+@@. ",
+" #++#$$#.+#$$+ #@#$@. . at ++. ###$##@. .#$. +$$+ .##$$+ ",
+" .@#+@$$@#$$@. @@#$+ .. .+@@. #@#$$$+ .+@@. +@$$+ ++$$+ +#$$$@. .+@@.",
+" #+++@$$$$@. +##$$+ .@##$@. @@#$$@. .@##$@. ##$$ +@$$ +#$$$@. .@##$@.",
+" . at +++@$$@. ###$$+ .@##@++% +##$$$+ .@##@++% ++$$. @#@. +@#$@+% .@##@++% ",
+" . at ++#$$+ #@#$$+ .##@+++.+. ###$$@. .##@+++.+. @#@$+ +#$+ +@#$@+. .##@+++. ",
+" .+#$$$#. @@#$$+ .@#$@+...##+ ###$$+ .@#$@+...##+ . at +@$++@$@ @@#@. .@#$@+... ",
+" +#$@#$$+ +##$$$+ .+ at . .##$@. +#$$+ #@#$$#. .##$@. +#$$+ #+#$#+#$+ +@#$+ .##$@. ",
+" +@#@@+@$#. ###$$$+ .@#$+ +#$$@. +#$$$+ +#$$$$+ +#$$@. +#$$$+ ++@$$$. +#$@. +#$$@. ",
+" +@#$++++@#@. ##+@$$#. ++#$$+ +#$$@. +@#$$@. +#@#$$$+ +#$$@. +@#$$@. @++@$@ +#$$+ .@#$$@. ",
+" +#$@%@++#$$+ #++#$$$+ +#$$$+ +@#$@. +@#@#$+ +#@@#$$$+ .@#$$@. +@#@#$+ .#$$# +&*#$#. .##$$@. ",
+" +@#@. .@#+@$#. .@##$$$#. +#$$$@.+#+@$+ .@#@@#$+ +#@@#+@$$#. .#@+#$+ .@#@@#$+ +$@$$ +=-;#$$+ +>,')!+ ",
+" +@#@. #+++@#@. ##+@$$$@. +#$$$$+ #++#$#@@##$+@#$#@@#@.#++#$$$@@@@#@++#$#@@##$+@#$#@ ~{+++@@. @]^/(#$$#. +_:<[}| ",
+" +#@. . at +++@#@. #+++@$$$@@@@@#@#$$$+ .+@#$$$$$@++#+@#$$@. .@#+@$$$$$$@.+@#$$$$$@++#+@#$$12 345 .#+$6$$78##+@$$@@@90abc ",
+" +@#+ . at ++++@+ . at ++++#$$$$$@+@#$$$+ +#+@$$$$@+.#++++++% #+++@$$$@+%+#+@$$$$@+.#++++def$ghi. ++@]jk% #+++@$$$$lmn ",
+"+#++. . at ++++ . at ++@++++++++##$$$+ #+++++++% . at ++++. . at +++++++. #+++++++% . at ++++.$$o_ . at +pqr . at +++@$$$s t ",
+"#++. ..@% .. at ++++++. ###$$@. . at +++++. .... . at ++++. . at +++++. .... uvw .+++ . at ++#$$$#.. ",
+".. . ...... ###$$+ ..... .... ..... . . .+#@++##@. ",
+" ###$$+ +#@++@#$$+ ",
+" ###$$+ +#@..@#+@$+ ",
+" ###$$+ +@@. #++#$+ ",
+" ###$$+ +##@. .+@#$+ ",
+" ###$$+ #@+@@@@@##$@. ",
+" ###$@. #+++@#$$$@+% ",
+" ##++% . at ++++++++. ",
+" #++. . at +++++. ",
+" .. ..... "};
/* keep sorted (for bsearch) [BDyess] */
static W_Image imagearray[] = {
--- NEW FILE xgalaxy-hyperspace.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=XGalaxy-Hyperspace
Comment=Modified version of XGalaxy
Exec=xgalaxy-hyperspace
Icon=xgalaxy.png
Terminal=false
StartupNotify=false
Type=Application
Categories=Application;Game;ArcadeGame;
--- NEW FILE xgalaxy.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=XGalaxy
Comment=Galaxian / Galaga like game with powerups
Exec=xgalaxy
Icon=xgalaxy.png
Terminal=false
StartupNotify=false
Type=Application
Categories=Application;Game;ArcadeGame;
--- NEW FILE xgalaxy.spec ---
Name: xgalaxy
Version: 2.0.34
Release: 2%{?dist}
Summary: Galaxian / Galaga like game with powerups
Group: Amusements/Games
License: GPL
URL: http://sourceforge.net/projects/xgalaga/
Source0: http://download.sourceforge.net/xgalaga/xgalaga_%{version}.orig.tar.gz
Source1: %{name}.desktop
Source2: %{name}-hyperspace.desktop
Patch0: http://ftp.debian.org/debian/pool/main/x/xgalaga/xgalaga_2.0.34-34.diff.gz
Patch1: %{name}-2.0.34-warn.patch
Patch2: %{name}-2.0.34-fullscreen.patch
Patch3: %{name}-2.0.34-%{name}.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libXt-devel libXpm-devel libXmu-devel libXxf86vm-devel
BuildRequires: desktop-file-utils ImageMagick
%description
Arcade game for the X Window System inspired by the classic game Galaga.
Xgalaxy is a Galaxian like game with additional features to produce a more
interesting game.
%prep
%setup -q -n xgalaga-%{version}
# many thanks to Debian for all their excellent work on xgalala
%patch0 -p1 -z .deb
%patch1 -p1 -z .warn
%patch2 -p1 -z .fs
%patch3 -p1 -z .%{name}
sed -e 's/Debian/Fedora/g' debian/README.Debian > README.fedora
cat >> README.fedora << EOF
The latest Fedora %{name} package also includes fullscreen support, start
%{name} with -window to get the old windowed behavior. You can switch on the
fly between window and fullscreen mode with alt+enter.
EOF
# Change the name everywhere as upstreams name has already been used for a game
# much like this one in the past, upstreams use of this is a legal gray area.
sed -i 's/xgalaga/xgalaxy/g' `grep -rls xgalaga .`
sed -i 's/XGalaga/XGalaxy/g' `grep -rls XGalaga .`
%build
export CFLAGS="$RPM_OPT_FLAGS -fsigned-char -DXF86VIDMODE"
export LDFLAGS=-lXxf86vm
./configure --libdir=%{_libdir} --exec-prefix=%{_bindir} \
--prefix=%{_datadir}/%{name}
make %{?_smp_mflags}
convert images/player3.xpm %{name}.png
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# move the sound-server binary out of %{_datadir}
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/xgal.sndsrv.linux \
$RPM_BUILD_ROOT%{_bindir}
ln -s ../../bin/xgal.sndsrv.linux \
$RPM_BUILD_ROOT%{_datadir}/%{name}/xgal.sndsrv.linux
# fix useless exec bit
chmod -x $RPM_BUILD_ROOT%{_datadir}/%{name}/*/*
# make install doesn't install the manpage
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6
install -m 644 xgal.6x $RPM_BUILD_ROOT%{_mandir}/man6/%{name}.6
# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
%{SOURCE1}
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
%{SOURCE2}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/22x22/apps
install -p -m 644 %{name}.png \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/22x22/apps
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc CHANGES COPYING README README.fedora
%{_bindir}/%{name}*
%{_bindir}/xgal.sndsrv.linux
%{_datadir}/%{name}
%{_mandir}/man6/%{name}.6.gz
%{_datadir}/applications/fedora-%{name}*.desktop
%{_datadir}/icons/hicolor/22x22/apps/%{name}.png
%changelog
* Mon May 22 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 2.0.34-2
- Change name to xgalaxy because upstreams name has already been used for a
game much like this one in the past, upstreams use of this name thus legally
is a bit dodgy.
- Add missing BR: libXxf86vm-devel
- Stop using %%{__sed} just use sed, to be consistent with the way make, rm,
etc. are called.
- Package the included manpage.
* Thu May 11 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 2.0.34-1
- Initial packaging based on spec file by Michael A. Peters <mpeters at mac.com>
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/xgalaxy/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 31 May 2006 14:31:36 -0000 1.1
+++ .cvsignore 31 May 2006 14:32:28 -0000 1.2
@@ -0,0 +1,2 @@
+xgalaga_2.0.34-34.diff.gz
+xgalaga_2.0.34.orig.tar.gz
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/xgalaxy/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 31 May 2006 14:31:36 -0000 1.1
+++ sources 31 May 2006 14:32:28 -0000 1.2
@@ -0,0 +1,2 @@
+6543cc0b309402109c85fb43ac69423f xgalaga_2.0.34-34.diff.gz
+9f7ee685e9c4741b5f0edc3f91df9510 xgalaga_2.0.34.orig.tar.gz
- Previous message (by thread): rpms/xgalaxy import.log,1.1,1.2
- Next message (by thread): rpms/workrave/devel .cvsignore, 1.3, 1.4 sources, 1.3, 1.4 workrave.spec, 1.5, 1.6 workrave-1.8.2-cpp-fix.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list