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 */
22 #define DWARF_XSIZE 40
23 #define DWARF_YSIZE 48
27 #define DWARF_FRAMES 8
29 #define DWARF_STEPSIZE 4
30 #define JUMPER_XSIZE 48
31 #define JUMPER_YSIZE 56
34 #define JUMPER_FRAMES 8
35 #define JUMPER_DELAY 5
36 #define JUMPER_STEPSIZE 4
37 #define CLOWN_XSIZE 80
38 #define CLOWN_YSIZE 110
41 #define CLOWN_FRAMES 1
43 #define CLOWN_STEPSIZE 4
52 #define BIRD_STEPSIZE 4
54 struct ToonInfo toons[NUM_TOONS] =
58 DWARF_XSIZE, DWARF_YSIZE,
69 DWARF_XSIZE, DWARF_YSIZE,
80 JUMPER_XSIZE, JUMPER_YSIZE,
91 CLOWN_XSIZE, CLOWN_YSIZE,
102 BIRD_XSIZE, BIRD_YSIZE,
113 BIRD_XSIZE, BIRD_YSIZE,
123 IMG_PLAYER1_LEFT_MOVING,
134 IMG_PLAYER1_RIGHT_MOVING,
145 IMG_PENGUIN_LEFT_MOVING,
156 IMG_PENGUIN_RIGHT_MOVING,
167 IMG_MOLE_LEFT_MOVING,
178 IMG_MOLE_RIGHT_MOVING,
200 IMG_PIG_RIGHT_MOVING,
211 IMG_DRAGON_LEFT_MOVING,
222 IMG_DRAGON_RIGHT_MOVING,
233 IMG_SATELLITE_MOVING,
244 IMG_SATELLITE_MOVING,
256 static void PrepareBackbuffer()
258 /* Fill empty backbuffer for animation functions */
259 if (setup.direct_draw && game_status == PLAYING)
263 SetDrawtoField(DRAW_BACKBUFFER);
265 for(xx=0; xx<SCR_FIELDX; xx++)
266 for(yy=0; yy<SCR_FIELDY; yy++)
267 DrawScreenField(xx,yy);
270 SetDrawtoField(DRAW_DIRECT);
273 if (setup.soft_scrolling && game_status == PLAYING)
275 int fx = FX, fy = FY;
277 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
278 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
280 BlitBitmap(fieldbuffer, backbuffer, fx,fy, SXSIZE,SYSIZE, SX,SY);
284 boolean ToonNeedsRedraw()
286 return (game_status == HELPSCREEN ||
287 (game_status == MAINMENU &&
288 ((redraw_mask & REDRAW_MICROLEVEL) ||
289 (redraw_mask & REDRAW_MICROLABEL))));
296 for (i=0; i<NUM_TOONS; i++)
298 int graphic = toons[i].graphic;
300 toons[i].bitmap = new_graphic_info[graphic].bitmap;
302 if (toons[i].src_x == -1 && toons[i].src_y == -1)
304 int anim_frames = new_graphic_info[graphic].anim_frames;
305 int anim_delay = new_graphic_info[graphic].anim_delay;
306 int anim_mode = new_graphic_info[graphic].anim_mode;
307 int start_frame = new_graphic_info[graphic].anim_start_frame;
309 toons[i].src_x = new_graphic_info[graphic].src_x;
310 toons[i].src_y = new_graphic_info[graphic].src_y;
312 toons[i].width = TILEX;
313 toons[i].height = TILEY;
315 toons[i].anim_frames = anim_frames;
316 toons[i].anim_delay = anim_delay;
317 toons[i].anim_mode = anim_mode;
318 toons[i].start_frame = start_frame;
320 toons[i].move_delay = 1;
321 toons[i].stepsize = TILEX / 8;
325 toons[i].anim_delay = 1; /* no delay between frames */
326 toons[i].start_frame = 0; /* always start with first */
330 InitToonScreen(bitmap_db_door,
331 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
333 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,