X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=f7a67afb42b0a9a3a9a1e345923ed77c08eaf1c4;hb=6269ea8e89e9dea338b286bc6cb3a48388a43ad7;hp=89ad7c741bdd1103a25f181a5111eef4390a6182;hpb=bb2ddcf13df18d69e4472d4697da173981970e9d;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 89ad7c74..f7a67afb 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1,33 +1,33 @@ /*********************************************************** -* Rocks'n'Diamonds -- McDuffin Strikes Back! * +* Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* (c) 1995-98 Artsoft Entertainment * -* Holger Schemel * -* Oststrasse 11a * -* 33604 Bielefeld * -* phone: ++49 +521 290471 * -* email: aeglos@valinor.owl.de * +* (c) 1995-2001 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * *----------------------------------------------------------* -* tools.c * +* tools.c * ***********************************************************/ #include -#ifdef __FreeBSD__ +#if defined(PLATFORM_FREEBSD) #include #endif +#include "libgame/libgame.h" + #include "tools.h" #include "game.h" #include "events.h" -#include "sound.h" -#include "misc.h" -#include "buttons.h" #include "joystick.h" #include "cartoons.h" #include "network.h" +#include "tape.h" -#ifdef MSDOS +#if defined(PLATFORM_MSDOS) extern boolean wait_for_vsync; #endif @@ -85,7 +85,7 @@ void SetDrawtoField(int mode) void BackToFront() { int x,y; - DrawBuffer buffer = (drawto_field == window ? backbuffer : drawto_field); + DrawBuffer *buffer = (drawto_field == window ? backbuffer : drawto_field); if (setup.direct_draw && game_status == PLAYING) redraw_mask &= ~REDRAW_MAIN; @@ -248,7 +248,7 @@ void BackToFront() info1[0] = '\0'; sprintf(text, "%.1f fps%s", global.frames_per_second, info1); - DrawTextExt(window, gc, SX, SY, text, FS_SMALL, FC_YELLOW); + DrawTextExt(window, SX, SY, text, FS_SMALL, FC_YELLOW); } FlushDisplay(); @@ -352,141 +352,34 @@ void ClearWindow() redraw_mask |= REDRAW_FIELD; } -int getFontWidth(int font_size, int font_type) -{ - return (font_size == FS_BIG ? FONT1_XSIZE : - font_size == FS_MEDIUM ? FONT6_XSIZE : - font_type == FC_SPECIAL1 ? FONT3_XSIZE : - font_type == FC_SPECIAL2 ? FONT4_XSIZE : - font_type == FC_SPECIAL3 ? FONT5_XSIZE : - FONT2_XSIZE); -} - -int getFontHeight(int font_size, int font_type) -{ - return (font_size == FS_BIG ? FONT1_YSIZE : - font_size == FS_MEDIUM ? FONT6_YSIZE : - font_type == FC_SPECIAL1 ? FONT3_YSIZE : - font_type == FC_SPECIAL2 ? FONT4_YSIZE : - font_type == FC_SPECIAL3 ? FONT5_YSIZE : - FONT2_YSIZE); -} - -void DrawInitText(char *text, int ypos, int color) -{ - if (window && pix[PIX_SMALLFONT]) - { - ClearRectangle(window, 0, ypos, WIN_XSIZE, FONT2_YSIZE); - DrawTextExt(window, gc, (WIN_XSIZE - strlen(text) * FONT2_XSIZE)/2, - ypos, text, FS_SMALL, color); - FlushDisplay(); - } -} - -void DrawTextFCentered(int y, int font_type, char *format, ...) -{ - char buffer[FULL_SXSIZE / FONT5_XSIZE + 10]; - int font_width = getFontWidth(FS_SMALL, font_type); - va_list ap; - - va_start(ap, format); - vsprintf(buffer, format, ap); - va_end(ap); - - DrawText(SX + (SXSIZE - strlen(buffer) * font_width) / 2, SY + y, - buffer, FS_SMALL, font_type); -} - -void DrawTextF(int x, int y, int font_type, char *format, ...) +void MarkTileDirty(int x, int y) { - char buffer[FULL_SXSIZE / FONT5_XSIZE + 10]; - va_list ap; - - va_start(ap, format); - vsprintf(buffer, format, ap); - va_end(ap); - - DrawText(SX + x, SY + y, buffer, FS_SMALL, font_type); -} + int xx = redraw_x1 + x; + int yy = redraw_y1 + y; -void DrawText(int x, int y, char *text, int font_size, int font_type) -{ - DrawTextExt(drawto, gc, x, y, text, font_size, font_type); + if (!redraw[xx][yy]) + redraw_tiles++; - if (x < DX) - redraw_mask |= REDRAW_FIELD; - else if (y < VY) - redraw_mask |= REDRAW_DOOR_1; + redraw[xx][yy] = TRUE; + redraw_mask |= REDRAW_TILES; } -void DrawTextExt(DrawBuffer d, GC gc, int x, int y, - char *text, int font_size, int font_type) +void SetBorderElement() { - int font_width, font_height, font_start; - int font_bitmap; - boolean print_inverse = FALSE; - - if (font_size != FS_SMALL && font_size != FS_BIG && font_size != FS_MEDIUM) - font_size = FS_SMALL; - if (font_type < FC_RED || font_type > FC_SPECIAL3) - font_type = FC_RED; - - font_width = getFontWidth(font_size, font_type); - font_height = getFontHeight(font_size, font_type); - - font_bitmap = (font_size == FS_BIG ? PIX_BIGFONT : - font_size == FS_MEDIUM ? PIX_MEDIUMFONT : - PIX_SMALLFONT); - font_start = (font_type * (font_size == FS_BIG ? FONT1_YSIZE : - font_size == FS_MEDIUM ? FONT6_YSIZE : - FONT2_YSIZE) * - FONT_LINES_PER_FONT); + int x, y; - if (font_type == FC_SPECIAL3) - font_start += (FONT4_YSIZE - FONT2_YSIZE) * FONT_LINES_PER_FONT; + BorderElement = EL_LEERRAUM; - while (*text) + for(y=0; y= 'a' && c <= 'z') - c = 'A' + (c - 'a'); - else if (c == 'ä' || c == 'Ä') - c = 91; - else if (c == 'ö' || c == 'Ö') - c = 92; - else if (c == 'ü' || c == 'Ü') - c = 93; - - if (c >= 32 && c <= 95) - { - int src_x = ((c - 32) % FONT_CHARS_PER_LINE) * font_width; - int src_y = ((c - 32) / FONT_CHARS_PER_LINE) * font_height + font_start; - int dest_x = x, dest_y = y; + if (!IS_MASSIVE(Feld[x][y])) + BorderElement = EL_BETON; - if (print_inverse) - { - BlitBitmap(pix[font_bitmap], d, - FONT_CHARS_PER_LINE * font_width, - 3 * font_height + font_start, - font_width, font_height, x, y); - - SetClipOrigin(clip_gc[font_bitmap], dest_x - src_x, dest_y - src_y); - BlitBitmapMasked(pix_masked[font_bitmap], d, - 0, 0, font_width, font_height, dest_x, dest_y); - } - else - BlitBitmap(pix[font_bitmap], d, - src_x, src_y, font_width, font_height, dest_x, dest_y); + if (y != 0 && y != lev_fieldy - 1 && x != lev_fieldx - 1) + x = lev_fieldx - 2; } - - x += font_width; } } @@ -874,17 +767,17 @@ void DrawGraphic(int x, int y, int graphic) } #endif - DrawGraphicExt(drawto_field, gc, FX + x*TILEX, FY + y*TILEY, graphic); + DrawGraphicExt(drawto_field, FX + x*TILEX, FY + y*TILEY, graphic); MarkTileDirty(x,y); } -void DrawGraphicExt(DrawBuffer d, GC gc, int x, int y, int graphic) +void DrawGraphicExt(DrawBuffer *bitmap, int x, int y, int graphic) { int bitmap_nr; int src_x, src_y; getGraphicSource(graphic, &bitmap_nr, &src_x, &src_y); - BlitBitmap(pix[bitmap_nr], d, src_x, src_y, TILEX, TILEY, x, y); + BlitBitmap(pix[bitmap_nr], bitmap, src_x, src_y, TILEX, TILEY, x, y); } void DrawGraphicThruMask(int x, int y, int graphic) @@ -902,37 +795,37 @@ void DrawGraphicThruMask(int x, int y, int graphic) MarkTileDirty(x,y); } -void DrawGraphicThruMaskExt(DrawBuffer d, int dest_x, int dest_y, int graphic) +void DrawGraphicThruMaskExt(DrawBuffer *d, int dest_x, int dest_y, int graphic) { int tile = graphic; int bitmap_nr; int src_x, src_y; - Bitmap src_bitmap; + Bitmap *src_bitmap; GC drawing_gc; if (graphic == GFX_LEERRAUM) return; getGraphicSource(graphic, &bitmap_nr, &src_x, &src_y); - src_bitmap = pix_masked[bitmap_nr]; - drawing_gc = clip_gc[bitmap_nr]; + src_bitmap = pix[bitmap_nr]; + drawing_gc = pix[bitmap_nr]->stored_clip_gc; if (tile_clipmask[tile] != None) { - SetClipMask(tile_clip_gc, tile_clipmask[tile]); - SetClipOrigin(tile_clip_gc, dest_x, dest_y); + SetClipMask(src_bitmap, tile_clip_gc, tile_clipmask[tile]); + SetClipOrigin(src_bitmap, tile_clip_gc, dest_x, dest_y); BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y); } else { #if DEBUG -#ifndef USE_SDL_LIBRARY +#ifndef TARGET_SDL printf("DrawGraphicThruMask(): tile '%d' needs clipping!\n", tile); #endif #endif - SetClipOrigin(drawing_gc, dest_x-src_x, dest_y-src_y); + SetClipOrigin(src_bitmap, drawing_gc, dest_x-src_x, dest_y-src_y); BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y); } @@ -940,11 +833,11 @@ void DrawGraphicThruMaskExt(DrawBuffer d, int dest_x, int dest_y, int graphic) void DrawMiniGraphic(int x, int y, int graphic) { - DrawMiniGraphicExt(drawto,gc, SX + x*MINI_TILEX, SY + y*MINI_TILEY, graphic); + DrawMiniGraphicExt(drawto, SX + x*MINI_TILEX, SY + y*MINI_TILEY, graphic); MarkTileDirty(x/2, y/2); } -void getMiniGraphicSource(int graphic, Bitmap *bitmap, int *x, int *y) +void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) { if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN) { @@ -991,9 +884,9 @@ void getMiniGraphicSource(int graphic, Bitmap *bitmap, int *x, int *y) } } -void DrawMiniGraphicExt(DrawBuffer d, GC gc, int x, int y, int graphic) +void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic) { - Bitmap bitmap; + Bitmap *bitmap; int src_x, src_y; getMiniGraphicSource(graphic, &bitmap, &src_x, &src_y); @@ -1008,6 +901,7 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int src_x, src_y, dest_x, dest_y; int tile = graphic; int bitmap_nr; + Bitmap *src_bitmap; GC drawing_gc; if (graphic < 0) @@ -1081,7 +975,8 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, } getGraphicSource(graphic, &bitmap_nr, &src_x, &src_y); - drawing_gc = clip_gc[bitmap_nr]; + src_bitmap = pix[bitmap_nr]; + drawing_gc = pix[bitmap_nr]->stored_clip_gc; src_x += cx; src_y += cy; @@ -1102,21 +997,21 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, { if (tile_clipmask[tile] != None) { - SetClipMask(tile_clip_gc, tile_clipmask[tile]); - SetClipOrigin(tile_clip_gc, dest_x, dest_y); - BlitBitmapMasked(pix_masked[bitmap_nr], drawto_field, + SetClipMask(src_bitmap, tile_clip_gc, tile_clipmask[tile]); + SetClipOrigin(src_bitmap, tile_clip_gc, dest_x, dest_y); + BlitBitmapMasked(src_bitmap, drawto_field, src_x, src_y, TILEX, TILEY, dest_x, dest_y); } else { #if DEBUG -#ifndef USE_SDL_LIBRARY +#ifndef TARGET_SDL printf("DrawGraphicShifted(): tile '%d' needs clipping!\n", tile); #endif #endif - SetClipOrigin(drawing_gc, dest_x - src_x, dest_y - src_y); - BlitBitmapMasked(pix_masked[bitmap_nr], drawto_field, + SetClipOrigin(src_bitmap, drawing_gc, dest_x - src_x, dest_y - src_y); + BlitBitmapMasked(src_bitmap, drawto_field, src_x, src_y, width, height, dest_x, dest_y); } } @@ -1441,7 +1336,7 @@ void DrawLevelElement(int x, int y, int element) void DrawScreenField(int x, int y) { int ux = LEVELX(x), uy = LEVELY(y); - int element; + int element, content; if (!IN_LEV_FIELD(ux, uy)) { @@ -1455,33 +1350,44 @@ void DrawScreenField(int x, int y) } element = Feld[ux][uy]; + content = Store[ux][uy]; if (IS_MOVING(ux, uy)) { int horiz_move = (MovDir[ux][uy] == MV_LEFT || MovDir[ux][uy] == MV_RIGHT); boolean cut_mode = NO_CUTTING; - if (Store[ux][uy] == EL_MORAST_LEER || - Store[ux][uy] == EL_MAGIC_WALL_EMPTY || - Store[ux][uy] == EL_MAGIC_WALL_BD_EMPTY || - Store[ux][uy] == EL_AMOEBE_NASS) + if (element == EL_QUICKSAND_EMPTYING || + content == EL_MAGIC_WALL_EMPTY || + content == EL_MAGIC_WALL_BD_EMPTY || + content == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; - else if (Store[ux][uy] == EL_MORAST_VOLL || - Store[ux][uy] == EL_MAGIC_WALL_FULL || - Store[ux][uy] == EL_MAGIC_WALL_BD_FULL) + else if (element == EL_QUICKSAND_FILLING || + content == EL_MAGIC_WALL_FULL || + content == EL_MAGIC_WALL_BD_FULL) cut_mode = CUT_BELOW; if (cut_mode == CUT_ABOVE) - DrawScreenElementShifted(x, y, 0, 0, Store[ux][uy], NO_CUTTING); + { + if (element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING); + else + DrawScreenElementShifted(x, y, 0, 0, content, NO_CUTTING); + } else DrawScreenElement(x, y, EL_LEERRAUM); if (horiz_move) DrawScreenElementShifted(x, y, MovPos[ux][uy], 0, element, NO_CUTTING); else - DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + { + if (element == EL_QUICKSAND_FILLING || element == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], content, cut_mode); + else + DrawScreenElementShifted(x, y, 0, MovPos[ux][uy], element, cut_mode); + } - if (Store[ux][uy] == EL_SALZSAEURE) + if (content == EL_SALZSAEURE) DrawLevelElementThruMask(ux, uy + 1, EL_SALZSAEURE); } else if (IS_BLOCKED(ux, uy)) @@ -1490,6 +1396,7 @@ void DrawScreenField(int x, int y) int sx, sy; int horiz_move; boolean cut_mode = NO_CUTTING; + int element_old, content_old; Blocked2Moving(ux, uy, &oldx, &oldy); sx = SCREENX(oldx); @@ -1497,19 +1404,29 @@ void DrawScreenField(int x, int y) horiz_move = (MovDir[oldx][oldy] == MV_LEFT || MovDir[oldx][oldy] == MV_RIGHT); - if (Store[oldx][oldy] == EL_MORAST_LEER || - Store[oldx][oldy] == EL_MAGIC_WALL_EMPTY || - Store[oldx][oldy] == EL_MAGIC_WALL_BD_EMPTY || - Store[oldx][oldy] == EL_AMOEBE_NASS) + element_old = Feld[oldx][oldy]; + content_old = Store[oldx][oldy]; + + if (element_old == EL_QUICKSAND_EMPTYING || + content_old == EL_MAGIC_WALL_EMPTY || + content_old == EL_MAGIC_WALL_BD_EMPTY || + content_old == EL_AMOEBE_NASS) cut_mode = CUT_ABOVE; DrawScreenElement(x, y, EL_LEERRAUM); - element = Feld[oldx][oldy]; if (horiz_move) - DrawScreenElementShifted(sx,sy, MovPos[oldx][oldy],0,element,NO_CUTTING); + DrawScreenElementShifted(sx, sy, MovPos[oldx][oldy], 0, element_old, + NO_CUTTING); else - DrawScreenElementShifted(sx,sy, 0,MovPos[oldx][oldy],element,cut_mode); + { + if (element_old == EL_QUICKSAND_EMPTYING) + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], content_old, + cut_mode); + else + DrawScreenElementShifted(sx, sy, 0, MovPos[oldx][oldy], element_old, + cut_mode); + } } else if (IS_DRAWABLE(element)) DrawScreenElement(x, y, element); @@ -1827,7 +1744,7 @@ boolean Request(char *text, unsigned int req_state) int mx, my, ty, result = -1; unsigned int old_door_state; -#if !defined(MSDOS) && !defined(WIN32) +#if defined(PLATFORM_UNIX) /* pause network game while waiting for request to answer */ if (options.network && game_status == PLAYING && @@ -1872,8 +1789,7 @@ boolean Request(char *text, unsigned int req_state) } sprintf(txt, text); txt[tl] = 0; - DrawTextExt(drawto, gc, - DX + 51 - (tl * 14)/2, DY + 8 + ty * 16, + DrawTextExt(drawto, DX + 51 - (tl * 14)/2, DY + 8 + ty * 16, txt, FS_SMALL, FC_YELLOW); text += tl + (tc == 32 ? 1 : 0); } @@ -1991,11 +1907,11 @@ boolean Request(char *text, unsigned int req_state) case EVENT_KEYPRESS: switch(GetEventKey((KeyEvent *)&event, TRUE)) { - case KEY_Return: + case KSYM_Return: result = 1; break; - case KEY_Escape: + case KSYM_Escape: result = 0; break; @@ -2051,7 +1967,7 @@ boolean Request(char *text, unsigned int req_state) RemapAllGadgets(); -#if !defined(MSDOS) && !defined(WIN32) +#if defined(PLATFORM_UNIX) /* continue network game after request */ if (options.network && game_status == PLAYING && @@ -2134,6 +2050,9 @@ unsigned int MoveDoor(unsigned int door_state) for(x=start; x<=DXSIZE; x+=stepsize) { + Bitmap *bitmap = pix[PIX_DOOR]; + GC gc = bitmap->stored_clip_gc; + WaitUntilDelayReached(&door_delay, door_delay_value); if (door_state & DOOR_ACTION_1) @@ -2147,33 +2066,32 @@ unsigned int MoveDoor(unsigned int door_state) ClearRectangle(drawto, DX, DY + DYSIZE - i/2, DXSIZE,i/2); - SetClipOrigin(clip_gc[PIX_DOOR], DX - i, (DY + j) - DOOR_GFX_PAGEY1); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + SetClipOrigin(bitmap, gc, DX - i, (DY + j) - DOOR_GFX_PAGEY1); + BlitBitmapMasked(bitmap, drawto, DXSIZE, DOOR_GFX_PAGEY1, i, 77, DX + DXSIZE - i, DY + j); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, DXSIZE, DOOR_GFX_PAGEY1 + 140, i, 63, DX + DXSIZE - i, DY + 140 + j); - SetClipOrigin(clip_gc[PIX_DOOR], - DX - DXSIZE + i, DY - (DOOR_GFX_PAGEY1 + j)); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + SetClipOrigin(bitmap, gc, DX - DXSIZE + i, DY - (DOOR_GFX_PAGEY1 + j)); + BlitBitmapMasked(bitmap, drawto, DXSIZE - i, DOOR_GFX_PAGEY1 + j, i, 77 - j, DX, DY); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, DXSIZE-i, DOOR_GFX_PAGEY1 + 140, i, 63, DX, DY + 140 - j); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, DXSIZE - i, DOOR_GFX_PAGEY1 + 77, i, 63, DX, DY + 77 - j); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, DXSIZE - i, DOOR_GFX_PAGEY1 + 203, i, 77, DX, DY + 203 - j); - SetClipOrigin(clip_gc[PIX_DOOR], DX - i, (DY + j) - DOOR_GFX_PAGEY1); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + SetClipOrigin(bitmap, gc, DX - i, (DY + j) - DOOR_GFX_PAGEY1); + BlitBitmapMasked(bitmap, drawto, DXSIZE, DOOR_GFX_PAGEY1 + 77, i, 63, DX + DXSIZE - i, DY + 77 + j); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, DXSIZE, DOOR_GFX_PAGEY1 + 203, i, 77 - j, DX + DXSIZE - i, DY + 203 + j); @@ -2191,21 +2109,21 @@ unsigned int MoveDoor(unsigned int door_state) ClearRectangle(drawto, VX, VY + VYSIZE-i/2, VXSIZE, i/2); - SetClipOrigin(clip_gc[PIX_DOOR], VX - i, (VY + j) - DOOR_GFX_PAGEY2); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + SetClipOrigin(bitmap, gc, VX - i, (VY + j) - DOOR_GFX_PAGEY2); + BlitBitmapMasked(bitmap, drawto, VXSIZE, DOOR_GFX_PAGEY2, i, VYSIZE / 2, VX + VXSIZE-i, VY+j); - SetClipOrigin(clip_gc[PIX_DOOR], + SetClipOrigin(bitmap, gc, VX - VXSIZE + i, VY - (DOOR_GFX_PAGEY2 + j)); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, VXSIZE - i, DOOR_GFX_PAGEY2 + j, i, VYSIZE / 2 - j, VX, VY); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + BlitBitmapMasked(bitmap, drawto, VXSIZE - i, DOOR_GFX_PAGEY2 + VYSIZE / 2, i, VYSIZE / 2, VX, VY + VYSIZE / 2 - j); - SetClipOrigin(clip_gc[PIX_DOOR], VX - i, (VY + j) - DOOR_GFX_PAGEY2); - BlitBitmapMasked(pix_masked[PIX_DOOR], drawto, + SetClipOrigin(bitmap, gc, VX - i, (VY + j) - DOOR_GFX_PAGEY2); + BlitBitmapMasked(bitmap, drawto, VXSIZE, DOOR_GFX_PAGEY2 + VYSIZE / 2, i, VYSIZE / 2 - j, VX + VXSIZE - i, VY + VYSIZE / 2 + j); @@ -2249,13 +2167,14 @@ void UndrawSpecialEditorDoor() redraw_mask |= REDRAW_ALL; } -#ifndef USE_SDL_LIBRARY -int ReadPixel(DrawBuffer d, int x, int y) +#ifndef TARGET_SDL +int ReadPixel(DrawBuffer *bitmap, int x, int y) { XImage *pixel_image; unsigned long pixel_value; - pixel_image = XGetImage(display, d, x, y, 1, 1, AllPlanes, ZPixmap); + pixel_image = XGetImage(display, bitmap->drawable, + x, y, 1, 1, AllPlanes, ZPixmap); pixel_value = XGetPixel(pixel_image, 0, 0); XDestroyImage(pixel_image); @@ -2365,10 +2284,12 @@ static struct } }; +#if 0 static void DoNotDisplayInfoText(void *ptr) { return; } +#endif void CreateToolButtons() { @@ -2376,8 +2297,8 @@ void CreateToolButtons() for (i=0; i