# because the GIF loading routines are still a bit beta.
# If you use the Xpm library, convert the GIF files to Xpm
# files (and the mask files ('*Maske.gif') to xbm files).
-XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
+
+# XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK) \
$(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy)
{
- int oldJX,oldJY, newJX = JX+dx,newJY = JY+dy;
+ int newJX = JX+dx, newJY = JY+dy;
int element;
int can_move;
if (can_move != MF_MOVING)
return(can_move);
- oldJX = JX;
- oldJY = JY;
+ lastJX = JX;
+ lastJY = JY;
JX = newJX;
JY = newJY;
-
- lastJX = oldJX;
- lastJY = oldJY;
-
PlayerMovPos = (dx > 0 || dy > 0 ? -1 : 1) * 3*TILEX/4;
ScrollFigure(-1);
- if (Store[oldJX][oldJY])
- {
- DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY]));
- DrawGraphicThruMask(SCROLLX(oldJX),SCROLLY(oldJY),
- el2gfx(Feld[oldJX][oldJY]));
- }
- else if (Feld[oldJX][oldJY]==EL_DYNAMIT)
- DrawDynamite(oldJX,oldJY);
- else
- DrawLevelField(oldJX,oldJY);
-
return(MF_MOVING);
}
if (moved & MF_MOVING)
{
- int old_scroll_x=scroll_x, old_scroll_y=scroll_y;
+ int old_scroll_x = scroll_x, old_scroll_y = scroll_y;
int offset = (scroll_delay_on ? 3 : 0);
if ((scroll_x < JX-MIDPOSX-offset || scroll_x > JX-MIDPOSX+offset) &&
- JX>=MIDPOSX-1-offset && JX<=lev_fieldx-(MIDPOSX-offset))
+ JX >= MIDPOSX-1-offset && JX <= lev_fieldx-(MIDPOSX-offset))
scroll_x = JX-MIDPOSX + (scroll_x < JX-MIDPOSX ? -offset : offset);
if ((scroll_y < JY-MIDPOSY-offset || scroll_y > JY-MIDPOSY+offset) &&
- JY>=MIDPOSY-1-offset && JY<=lev_fieldy-(MIDPOSY-offset))
+ JY >= MIDPOSY-1-offset && JY <= lev_fieldy-(MIDPOSY-offset))
scroll_y = JY-MIDPOSY + (scroll_y < JY-MIDPOSY ? -offset : offset);
- if (scroll_x!=old_scroll_x || scroll_y!=old_scroll_y)
- ScrollLevel(old_scroll_x-scroll_x,old_scroll_y-scroll_y);
+ if (scroll_x != old_scroll_x || scroll_y != old_scroll_y)
+ ScrollLevel(old_scroll_x - scroll_x, old_scroll_y - scroll_y);
}
if (!(moved & MF_MOVING) && !PlayerPushing)
DrawPlayerField();
+ if (Store[lastJX][lastJY])
+ {
+ DrawGraphic(SCROLLX(lastJX),SCROLLY(lastJY),
+ el2gfx(Store[lastJX][lastJY]));
+ DrawGraphicThruMask(SCROLLX(lastJX),SCROLLY(lastJY),
+ el2gfx(Feld[lastJX][lastJY]));
+ }
+ else if (Feld[lastJX][lastJY]==EL_DYNAMIT)
+ DrawDynamite(lastJX,lastJY);
+ else
+ DrawLevelField(lastJX,lastJY);
+
return;
}
else if (!FrameReached(&actual_frame_counter,1))
#include "gfxloader.h"
+
+
+
+
+
+extern Window window;
+extern void Delay(long);
+
+
+
+
+
+
#ifdef DEBUG
/*
#define DEBUG_GIF
int Read_GIF_to_Bitmap(Display *display, char *filename, Pixmap *pixmap)
{
+ printf("Read_GIF_to_Bitmap\n");
+
+
+
+
return(Read_GIF_to_Pixmap_or_Bitmap(display, filename,
pixmap, READ_GIF_TO_BITMAP));
}
int Read_GIF_to_Pixmap(Display *display, char *filename, Pixmap *pixmap)
{
+ printf("Read_GIF_to_Pixmap\n");
+
+
+
+
return(Read_GIF_to_Pixmap_or_Bitmap(display, filename,
pixmap, READ_GIF_TO_PIXMAP));
}
gcv.background = WhitePixel(display,screen);
gc = XCreateGC(display, root, GCForeground | GCBackground, &gcv);
XPutImage(display,new_pixmap,gc,image,0,0,0,0,width,height);
+
+
+
+
+
+
+ Delay(1000000);
+
+ XPutImage(display,window,gc,image,0,0,0,0,width,height);
+
+ Delay(3000000);
+
+
+
+
+
XFreeGC(display, gc);
}
int screen = DefaultScreen(display);
int depth = DefaultDepth(display, screen);
+
+
+
+
+
+ printf("ConvertXImageDepth:\n");
+ printf("(*image)->depth == %d\n",
+ (*image)->depth);
+ printf("DefaultDepth(display, screen) == %d\n",
+ DefaultDepth(display, screen));
+
+
+
+
if ((*image)->depth != depth)
{
XImage *old_image, *new_image;
+ /*
Visual *visual = DefaultVisual(display,screen);
+ */
int width = (*image)->width;
int height = (*image)->height;
register int dwx, dwy;
byte *data;
+
+
+
+
+ printf("ConvertXImageDepth: ---------> CONVERTING...\n");
+
+
+
+
+
+
data = (byte *)malloc(width * height * depth);
old_image = *image;
int bytes_per_line, bitmap_size;
FILE *file;
+
+
+
+
+ printf("Read_ILBM_to_Bitmap\n");
+
+
+
+
if (!(file = fopen(filename,"r")))
return(ILBM_OpenFailed);