X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=45447912c488dfba517c9b5718fc342d2567fe97;hb=b66bf285376f1a2c08ba8f7624fa48ffbcd898a9;hp=50846337d52f07e1c19e04769ff4eef12c436ea7;hpb=e2c85f7a96792c28d8e0d13ebd89ea183143c118;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 50846337..45447912 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1153,13 +1153,18 @@ void SetBackgroundImage(int graphic, int redraw_mask) if (graphic == IMG_UNDEFINED) g = &g_undefined; + // always use original size bitmap for backgrounds, if existing + Bitmap *bitmap = (g->bitmaps != NULL && + g->bitmaps[IMG_BITMAP_PTR_ORIGINAL] != NULL ? + g->bitmaps[IMG_BITMAP_PTR_ORIGINAL] : g->bitmap); + // remove every mask before setting mask for window, and // remove window area mask before setting mask for main or door area int remove_mask = (redraw_mask == REDRAW_ALL ? 0xffff : REDRAW_ALL); // (!!! TO BE FIXED: The whole REDRAW_* system really sucks! !!!) SetBackgroundBitmap(NULL, remove_mask, 0, 0, 0, 0); // !!! FIX THIS !!! - SetBackgroundBitmap(g->bitmap, redraw_mask, + SetBackgroundBitmap(bitmap, redraw_mask, g->src_x, g->src_y, g->width, g->height); } @@ -3003,19 +3008,6 @@ void ShowEnvelope(int envelope_nr) BackToFront(); } -void ShowEnvelope_MM(int envelope_nr) -{ - BlitBitmap(backbuffer, bitmap_db_field, REAL_SX, REAL_SY, - FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); - - ShowEnvelope(envelope_nr); - - SetDrawtoField(DRAW_TO_BACKBUFFER); - - BlitBitmap(bitmap_db_field, backbuffer, REAL_SX, REAL_SY, - FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY); -} - static void PrepareEnvelopeRequestToScreen(Bitmap *bitmap, int sx, int sy, int xsize, int ysize) { @@ -3322,14 +3314,15 @@ static void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) if (game_status == GAME_MODE_PLAYING) BlitScreenToBitmap(backbuffer); + if (game_status == GAME_MODE_PLAYING || action == ACTION_OPENING) + BlitBitmap(backbuffer, bitmap_db_store_1, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); + SetDrawtoField(DRAW_TO_BACKBUFFER); // SetDrawBackgroundMask(REDRAW_NONE); if (action == ACTION_OPENING) { - BlitBitmap(backbuffer, bitmap_db_store_1, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); - if (req_state & REQ_ASK) { MapGadget(tool_gadget[TOOL_CTRL_ID_YES]); @@ -3942,6 +3935,18 @@ void DrawFixedGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y, DrawFixedGraphicExt(dst_bitmap, x, y, graphic, frame); } +void DrawSizedGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y, + int graphic, int sync_frame, int tilesize, + int mask_mode) +{ + int frame = getGraphicAnimationFrame(graphic, sync_frame); + + if (mask_mode == USE_MASKING) + DrawSizedGraphicThruMaskExt(dst_bitmap, x, y, graphic, frame, tilesize); + else + DrawSizedGraphicExt(dst_bitmap, x, y, graphic, frame, tilesize); +} + static void DrawGraphicAnimation(int x, int y, int graphic) { int lx = LEVELX(x), ly = LEVELY(y);