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)
30 BlitScreenToBitmap(backbuffer);
32 if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
34 BlitScreenToBitmap_EM(backbuffer);
36 else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
38 BlitScreenToBitmap_SP(backbuffer);
40 else if (setup.soft_scrolling) /* GAME_ENGINE_TYPE_RND */
44 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
45 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
47 BlitBitmap(fieldbuffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
52 boolean ToonNeedsRedraw()
59 int num_toons = MAX_NUM_TOONS;
62 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
63 num_toons = global.num_toons;
65 for (i = 0; i < num_toons; i++)
67 int graphic = IMG_TOON_1 + i;
68 struct FileInfo *image = getImageListEntryFromImageID(graphic);
70 toons[i].bitmap = graphic_info[graphic].bitmap;
72 toons[i].src_x = graphic_info[graphic].src_x;
73 toons[i].src_y = graphic_info[graphic].src_y;
75 toons[i].width = graphic_info[graphic].width;
76 toons[i].height = graphic_info[graphic].height;
78 toons[i].anim_frames = graphic_info[graphic].anim_frames;
79 toons[i].anim_delay = graphic_info[graphic].anim_delay;
80 toons[i].anim_mode = graphic_info[graphic].anim_mode;
81 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
83 toons[i].step_offset = graphic_info[graphic].step_offset;
84 toons[i].step_delay = graphic_info[graphic].step_delay;
86 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
87 toons[i].position = image->parameter[GFX_ARG_POSITION];
91 InitToonScreen(bitmap_db_toons,
93 InitToonScreen(bitmap_db_door,
95 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
97 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,