1 /***********************************************************
2 * Rocks'n'Diamonds -- McDuffin Strikes Back! *
3 *----------------------------------------------------------*
4 * (c) 1995-2002 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
19 /* values for toon definition */
26 #define DWARF_XSIZE 40
27 #define DWARF_YSIZE 48
31 #define DWARF_FRAMES 8
33 #define DWARF_STEPSIZE 4
34 #define JUMPER_XSIZE 48
35 #define JUMPER_YSIZE 56
38 #define JUMPER_FRAMES 8
39 #define JUMPER_DELAY 5
40 #define JUMPER_STEPSIZE 4
41 #define CLOWN_XSIZE 80
42 #define CLOWN_YSIZE 110
45 #define CLOWN_FRAMES 1
47 #define CLOWN_STEPSIZE 4
56 #define BIRD_STEPSIZE 4
58 struct ToonInfo toons[NUM_TOONS] =
63 DWARF_XSIZE, DWARF_YSIZE,
74 DWARF_XSIZE, DWARF_YSIZE,
85 JUMPER_XSIZE, JUMPER_YSIZE,
96 CLOWN_XSIZE, CLOWN_YSIZE,
107 BIRD_XSIZE, BIRD_YSIZE,
118 BIRD_XSIZE, BIRD_YSIZE,
198 IMG_PLAYER1_MOVING_LEFT,
209 IMG_PLAYER1_MOVING_RIGHT,
220 IMG_PENGUIN_MOVING_LEFT,
231 IMG_PENGUIN_MOVING_RIGHT,
242 IMG_MOLE_MOVING_LEFT,
253 IMG_MOLE_MOVING_RIGHT,
275 IMG_PIG_MOVING_RIGHT,
286 IMG_DRAGON_MOVING_LEFT,
297 IMG_DRAGON_MOVING_RIGHT,
308 IMG_SATELLITE_MOVING,
319 IMG_SATELLITE_MOVING,
333 static void PrepareBackbuffer()
335 /* Fill empty backbuffer for animation functions */
336 if (setup.direct_draw && game_status == PLAYING)
340 SetDrawtoField(DRAW_BACKBUFFER);
342 for(xx=0; xx<SCR_FIELDX; xx++)
343 for(yy=0; yy<SCR_FIELDY; yy++)
344 DrawScreenField(xx,yy);
347 SetDrawtoField(DRAW_DIRECT);
350 if (setup.soft_scrolling && game_status == PLAYING)
352 int fx = FX, fy = FY;
354 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
355 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
357 BlitBitmap(fieldbuffer, backbuffer, fx,fy, SXSIZE,SYSIZE, SX,SY);
361 boolean ToonNeedsRedraw()
363 return (game_status == HELPSCREEN ||
364 (game_status == MAINMENU &&
365 ((redraw_mask & REDRAW_MICROLEVEL) ||
366 (redraw_mask & REDRAW_MICROLABEL))));
373 for (i=0; i<NUM_TOONS; i++)
375 int graphic = toons[i].graphic;
377 toons[i].bitmap = graphic_info[graphic].bitmap;
379 toons[i].src_x = graphic_info[graphic].src_x;
380 toons[i].src_y = graphic_info[graphic].src_y;
382 toons[i].width = graphic_info[graphic].width;
383 toons[i].height = graphic_info[graphic].height;
385 toons[i].anim_frames = graphic_info[graphic].anim_frames;
386 toons[i].anim_delay = graphic_info[graphic].anim_delay;
387 toons[i].anim_mode = graphic_info[graphic].anim_mode;
388 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
390 toons[i].step_offset = graphic_info[graphic].step_offset;
391 toons[i].step_delay = graphic_info[graphic].step_delay;
394 InitToonScreen(bitmap_db_door,
395 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
397 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,