From: Holger Schemel Date: Thu, 20 Aug 1998 08:08:59 +0000 (+0200) Subject: rnd-19980820 X-Git-Tag: 1.2.0^2~93 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0dd76aace99b32f0a9d11b908f40e9629785ade6;p=rocksndiamonds.git rnd-19980820 --- diff --git a/src/Makefile b/src/Makefile index 01a64c2e..510e71d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,7 +20,8 @@ SCORE_ENTRIES = -DMANY_PER_NAME # many score entries per name # 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="" + +# XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="" CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK) \ $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE) diff --git a/src/game.c b/src/game.c index eb64c053..c75c9dd4 100644 --- a/src/game.c +++ b/src/game.c @@ -2781,7 +2781,7 @@ void ScrollLevel(int dx, int dy) 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; @@ -2819,30 +2819,15 @@ BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy) 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); } @@ -2882,18 +2867,18 @@ BOOL MoveFigure(int dx, int dy) 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) @@ -2953,6 +2938,18 @@ void ScrollFigure(int init) 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)) diff --git a/src/gfxloader.c b/src/gfxloader.c index c84a3cd7..9a28f435 100644 --- a/src/gfxloader.c +++ b/src/gfxloader.c @@ -14,6 +14,19 @@ #include "gfxloader.h" + + + + + +extern Window window; +extern void Delay(long); + + + + + + #ifdef DEBUG /* #define DEBUG_GIF @@ -63,12 +76,22 @@ static int Read_GIF_to_Pixmap_or_Bitmap(Display *, char *, Pixmap *, int); 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)); } @@ -141,6 +164,22 @@ int Read_GIF_to_Pixmap_or_Bitmap(Display *display, char *filename, 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); } @@ -770,15 +809,42 @@ static int ConvertXImageDepth(Display *display, XImage **image) 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; @@ -913,6 +979,15 @@ int Read_ILBM_to_Bitmap(Display *display, char *filename, Pixmap *pixmap) int bytes_per_line, bitmap_size; FILE *file; + + + + + printf("Read_ILBM_to_Bitmap\n"); + + + + if (!(file = fopen(filename,"r"))) return(ILBM_OpenFailed);