1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
17 /* values for toon definition */
18 #define MAX_NUM_TOONS 20
20 static struct ToonInfo toons[MAX_NUM_TOONS];
22 static void PrepareBackbuffer()
24 if (game_status != GAME_MODE_PLAYING)
28 BlitScreenToBitmap(backbuffer);
30 if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
32 BlitScreenToBitmap_EM(backbuffer);
34 else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
36 BlitScreenToBitmap_SP(backbuffer);
38 else if (setup.soft_scrolling) /* GAME_ENGINE_TYPE_RND */
42 fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
43 fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
45 BlitBitmap(fieldbuffer, backbuffer, fx, fy, SXSIZE, SYSIZE, SX, SY);
50 boolean ToonNeedsRedraw()
57 int num_toons = MAX_NUM_TOONS;
60 if (global.num_toons >= 0 && global.num_toons < MAX_NUM_TOONS)
61 num_toons = global.num_toons;
63 for (i = 0; i < num_toons; i++)
65 int graphic = IMG_TOON_1 + i;
66 struct FileInfo *image = getImageListEntryFromImageID(graphic);
68 toons[i].bitmap = graphic_info[graphic].bitmap;
70 toons[i].src_x = graphic_info[graphic].src_x;
71 toons[i].src_y = graphic_info[graphic].src_y;
73 toons[i].width = graphic_info[graphic].width;
74 toons[i].height = graphic_info[graphic].height;
76 toons[i].anim_frames = graphic_info[graphic].anim_frames;
77 toons[i].anim_delay = graphic_info[graphic].anim_delay;
78 toons[i].anim_mode = graphic_info[graphic].anim_mode;
79 toons[i].anim_start_frame = graphic_info[graphic].anim_start_frame;
81 toons[i].step_offset = graphic_info[graphic].step_offset;
82 toons[i].step_delay = graphic_info[graphic].step_delay;
84 toons[i].direction = image->parameter[GFX_ARG_DIRECTION];
85 toons[i].position = image->parameter[GFX_ARG_POSITION];
89 InitToonScreen(bitmap_db_toons,
91 InitToonScreen(bitmap_db_door,
93 BackToFront, PrepareBackbuffer, ToonNeedsRedraw,
95 REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,