perl-cross: bump to version 1.1.4
[buildroot-gz.git] / package / rubix / 0002-misc-fixes.patch
blob3ce6dad220618d3a6fb6ba1dde07839f00a7e921
1 diff -Nrup rubix-1.0.5/fillpoly.c rubix-1.0.5-avr32/fillpoly.c
2 --- rubix-1.0.5/fillpoly.c 2003-10-12 15:41:43.000000000 -0400
3 +++ rubix-1.0.5-avr32/fillpoly.c 2008-02-29 12:39:51.000000000 -0500
4 @@ -435,7 +435,7 @@ void fill_lines(device *d, int thecol)
5 );
6 #endif
8 - } else if (d->depth==16) { /* here 16bpp */
9 + } else if ((d->depth==16) | (d->depth==15)) { /* here 16bpp */
10 register int i;
11 #ifndef PC_ARCHI
12 register int j;
13 diff -Nrup rubix-1.0.5/line.c rubix-1.0.5-avr32/line.c
14 --- rubix-1.0.5/line.c 2003-10-12 14:15:19.000000000 -0400
15 +++ rubix-1.0.5-avr32/line.c 2008-02-29 12:39:51.000000000 -0500
16 @@ -1317,7 +1317,7 @@ void drawline(device *d, line *l)
17 #endif
18 if (d->depth==8)
19 drawline8(d, l);
20 - else if (d->depth==16)
21 + else if ((d->depth==16) | (d->depth==15))
22 drawline16(d, l);
23 else if (d->depth==24)
24 drawline24(d, l);
25 diff -Nrup rubix-1.0.5/Makefile rubix-1.0.5-avr32/Makefile
26 --- rubix-1.0.5/Makefile 2003-12-04 14:27:58.000000000 -0500
27 +++ rubix-1.0.5-avr32/Makefile 2008-02-29 12:58:30.000000000 -0500
28 @@ -11,21 +11,17 @@
29 # Customize to fit your needs (especially if it does not work for now).
31 LANGUAGE=ENGLISH
32 -GAMESDIR=/usr/games
34 #architecture=-DPC_ARCHI
36 # For Solaris
37 #EXTRALIBS=-lsocket
39 -CC=gcc
40 CFLAGS=-Wall -O3 -fomit-frame-pointer -ffast-math \
41 -DGAMESDIR="\"$(GAMESDIR)\"" \
42 -D$(LANGUAGE) $(architecture)
44 #CFLAGS=-Wall -g -ffast-math -Iplayer $(architecture)
45 -XINC=-I/usr/X11R6/include
46 -XLIB=-L/usr/X11R6/lib -lX11
48 #the following should not be changed.
50 @@ -37,7 +33,7 @@ rubix : $(OBJ)
52 install :
53 mkdir -p $(GAMESDIR)
54 - install -c -s rubix $(GAMESDIR)
55 + install -c rubix $(GAMESDIR)
57 clean :
58 rm -f *.o *~ core *.bak *.dat gmon.out
59 diff -Nrup rubix-1.0.5/screen.c rubix-1.0.5-avr32/screen.c
60 --- rubix-1.0.5/screen.c 2004-04-26 04:26:05.000000000 -0400
61 +++ rubix-1.0.5-avr32/screen.c 2008-02-29 12:39:51.000000000 -0500
62 @@ -80,11 +80,17 @@ void error_statement(SCREEN *s)
64 int reset_data_buffers(SCREEN *s)
66 + int temp;
68 if (s->im)
69 XDestroyImage(s->im);
70 + if (s->depth == 15) {
71 + temp=16;
72 + } else {
73 + temp=s->depth;
74 + }
76 - s->buffer=(char *)malloc(((SCREEN_X+7)/8)*SCREEN_Y*s->depth);
77 + s->buffer=(char *)malloc(((SCREEN_X+7)/8)*SCREEN_Y*temp);
79 if (!s->buffer) {
80 error_statement(s);
81 @@ -106,7 +112,7 @@ int reset_data_buffers(SCREEN *s)
83 /* Sed - december 2003 - no it has to be 8 */
84 s->im=XCreateImage(s->d, DefaultVisual(s->d, DefaultScreen(s->d)),
85 - s->depth==32?24:s->depth, ZPixmap,
86 + s->depth, ZPixmap,
87 0, s->buffer, SCREEN_X, SCREEN_Y, 8, 0);
89 if (!s->im) {
90 @@ -139,8 +145,8 @@ int init_screen(SCREEN *s)
92 s->depth=DefaultDepth(s->d, DefaultScreen(s->d));
94 - if (s->depth!=8 && s->depth!=16 && s->depth!=24) {
95 - fprintf(stderr, "screen depth not supported (only 8, 16 and 24bpp (which means 32bpp too) handled\n");
96 + if (s->depth!=8 && s->depth!=15 && s->depth!=16 && s->depth!=24) {
97 + fprintf(stderr, "screen depth not supported (only 8, 15, 16 and 24bpp (which means 32bpp too) handled\n");
98 XCloseDisplay(s->d);
99 s->d=(Display *)0;
100 return -1;
101 @@ -182,10 +188,10 @@ int init_screen(SCREEN *s)
103 /* let's create and map our window */
104 s->w=XCreateWindow(s->d, DefaultRootWindow(s->d), 0, 0,
105 - SCREEN_X, SCREEN_Y, 3, s->depth==32?24:s->depth,
106 + SCREEN_X, SCREEN_Y, 3, s->depth,
107 CopyFromParent, CopyFromParent, 0, NULL);
108 s->h=XCreateWindow(s->d, DefaultRootWindow(s->d), 0, 0,
109 - HELP_X, HELP_Y, 3, s->depth==32?24:s->depth,
110 + HELP_X, HELP_Y, 3, s->depth,
111 CopyFromParent, CopyFromParent, 0, NULL);
113 xch.res_name = "rubix";
114 @@ -946,13 +952,18 @@ void close_screen(SCREEN *s)
115 void clear_screen(SCREEN *s)
117 /* fill s->im with pixel[10], avoid XPutPixel which is rather slow... */
118 - int i, w, dw;
119 + int i, w, dw, temp;
120 + if (s->depth == 15) {
121 + temp = 16;
122 + } else {
123 + temp = s->depth;
125 w = (SCREEN_X+7)/8;
126 - dw = s->depth/8;
127 + dw = temp/8;
128 XPutPixel(s->im, 0, 0, pixel[10]);
129 for (i=1; i<8*w; i++)
130 memcpy(s->buffer + i*dw, s->buffer, dw);
131 - w = w * s->depth;
132 + w = w * temp;
133 for (i=1; i<SCREEN_Y; i++)
134 memcpy(s->buffer + i*w, s->buffer, w);