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)
29 if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
31 BlitScreenToBitmap_EM(backbuffer);
33 else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
35 BlitScreenToBitmap_SP(backbuffer);
37 else if (setup.soft_scrolling) /* GAME_ENGINE_TYPE_RND */
41 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
42 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
44 BlitBitmap(fieldbuffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
48 boolean ToonNeedsRedraw()
55 int num_toons = MAX_NUM_TOONS;
58 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
59 num_toons = global.num_toons;
61 for (i = 0; i < num_toons; i++)
63 int graphic = IMG_TOON_1 + i;
64 struct FileInfo *image = getImageListEntryFromImageID(graphic);
66 toons[i].bitmap = graphic_info[graphic].bitmap;
68 toons[i].src_x = graphic_info[graphic].src_x;
69 toons[i].src_y = graphic_info[graphic].src_y;
71 toons[i].width = graphic_info[graphic].width;
72 toons[i].height = graphic_info[graphic].height;
74 toons[i].anim_frames = graphic_info[graphic].anim_frames;
75 toons[i].anim_delay = graphic_info[graphic].anim_delay;
76 toons[i].anim_mode = graphic_info[graphic].anim_mode;
77 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
79 toons[i].step_offset = graphic_info[graphic].step_offset;
80 toons[i].step_delay = graphic_info[graphic].step_delay;
82 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
83 toons[i].position = image->parameter[GFX_ARG_POSITION];
87 InitToonScreen(bitmap_db_toons,
89 InitToonScreen(bitmap_db_door,
91 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
93 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,