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()
57 return (game_status == GAME_MODE_INFO ||
58 game_status == GAME_MODE_LEVELS ||
59 game_status == GAME_MODE_SETUP ||
60 (game_status == GAME_MODE_MAIN &&
61 ((redraw_mask & REDRAW_MICROLEVEL) ||
62 (redraw_mask & REDRAW_MICROLABEL))));
68 int num_toons = MAX_NUM_TOONS;
71 if (global.num_toons > 0 && global.num_toons < MAX_NUM_TOONS)
72 num_toons = global.num_toons;
74 for (i=0; i < num_toons; i++)
76 int graphic = IMG_TOON_1 + i;
77 struct FileInfo *image = getImageListEntry(graphic);
79 toons[i].bitmap = graphic_info[graphic].bitmap;
81 toons[i].src_x = graphic_info[graphic].src_x;
82 toons[i].src_y = graphic_info[graphic].src_y;
84 toons[i].width = graphic_info[graphic].width;
85 toons[i].height = graphic_info[graphic].height;
87 toons[i].anim_frames = graphic_info[graphic].anim_frames;
88 toons[i].anim_delay = graphic_info[graphic].anim_delay;
89 toons[i].anim_mode = graphic_info[graphic].anim_mode;
90 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
92 toons[i].step_offset = graphic_info[graphic].step_offset;
93 toons[i].step_delay = graphic_info[graphic].step_delay;
95 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
96 toons[i].position = image->parameter[GFX_ARG_POSITION];
99 InitToonScreen(bitmap_db_door,
100 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
102 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,