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 */
20 #define MAX_NUM_TOONS 20
22 static struct ToonInfo toons[MAX_NUM_TOONS];
24 static void PrepareBackbuffer()
26 /* Fill empty backbuffer for animation functions */
27 if (setup.direct_draw && game_status == GAME_MODE_PLAYING)
31 SetDrawtoField(DRAW_BACKBUFFER);
33 for(xx=0; xx<SCR_FIELDX; xx++)
34 for(yy=0; yy<SCR_FIELDY; yy++)
35 DrawScreenField(xx,yy);
38 SetDrawtoField(DRAW_DIRECT);
41 if (setup.soft_scrolling && game_status == GAME_MODE_PLAYING)
45 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
46 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
48 BlitBitmap(fieldbuffer, backbuffer, fx,fy, SXSIZE,SYSIZE, SX,SY);
52 boolean ToonNeedsRedraw()
54 return (game_status == GAME_MODE_INFO ||
55 (game_status == GAME_MODE_MAIN &&
56 ((redraw_mask & REDRAW_MICROLEVEL) ||
57 (redraw_mask & REDRAW_MICROLABEL))));
62 int num_toons = MAX_NUM_TOONS;
65 if (global.num_toons > 0 && global.num_toons < MAX_NUM_TOONS)
66 num_toons = global.num_toons;
68 for (i=0; i < num_toons; i++)
70 int graphic = IMG_TOON_1 + i;
71 struct FileInfo *image = getImageListEntry(graphic);
73 toons[i].bitmap = graphic_info[graphic].bitmap;
75 toons[i].src_x = graphic_info[graphic].src_x;
76 toons[i].src_y = graphic_info[graphic].src_y;
78 toons[i].width = graphic_info[graphic].width;
79 toons[i].height = graphic_info[graphic].height;
81 toons[i].anim_frames = graphic_info[graphic].anim_frames;
82 toons[i].anim_delay = graphic_info[graphic].anim_delay;
83 toons[i].anim_mode = graphic_info[graphic].anim_mode;
84 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
86 toons[i].step_offset = graphic_info[graphic].step_offset;
87 toons[i].step_delay = graphic_info[graphic].step_delay;
89 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
90 toons[i].position = image->parameter[GFX_ARG_POSITION];
93 InitToonScreen(bitmap_db_door,
94 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
96 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,