1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
19 /* values for toon definition */
20 #define MAX_NUM_TOONS 20
22 static struct ToonInfo toons[MAX_NUM_TOONS];
24 static void PrepareBackbuffer()
26 if (game_status == GAME_MODE_PLAYING &&
27 level.game_engine_type == GAME_ENGINE_TYPE_EM)
29 BlitScreenToBitmap_EM(backbuffer);
34 /* fill empty backbuffer for animation functions */
35 if (setup.direct_draw && game_status == GAME_MODE_PLAYING)
39 SetDrawtoField(DRAW_BACKBUFFER);
41 for (xx = 0; xx < SCR_FIELDX; xx++)
42 for (yy = 0; yy < SCR_FIELDY; yy++)
43 DrawScreenField(xx, yy);
46 SetDrawtoField(DRAW_DIRECT);
49 if (setup.soft_scrolling && game_status == GAME_MODE_PLAYING)
53 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
54 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
56 BlitBitmap(fieldbuffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
60 boolean ToonNeedsRedraw()
67 int num_toons = MAX_NUM_TOONS;
70 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
71 num_toons = global.num_toons;
73 for (i = 0; i < num_toons; i++)
75 int graphic = IMG_TOON_1 + i;
76 struct FileInfo *image = getImageListEntryFromImageID(graphic);
78 toons[i].bitmap = graphic_info[graphic].bitmap;
80 toons[i].src_x = graphic_info[graphic].src_x;
81 toons[i].src_y = graphic_info[graphic].src_y;
83 toons[i].width = graphic_info[graphic].width;
84 toons[i].height = graphic_info[graphic].height;
86 toons[i].anim_frames = graphic_info[graphic].anim_frames;
87 toons[i].anim_delay = graphic_info[graphic].anim_delay;
88 toons[i].anim_mode = graphic_info[graphic].anim_mode;
89 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
91 toons[i].step_offset = graphic_info[graphic].step_offset;
92 toons[i].step_delay = graphic_info[graphic].step_delay;
94 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
95 toons[i].position = image->parameter[GFX_ARG_POSITION];
98 InitToonScreen(bitmap_db_door,
99 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
101 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,