-
-static struct ToonScreenInfo screen_info;
-
-void InitToonScreen(Bitmap **toon_bitmap_array,
- Bitmap *save_buffer,
- void (*update_function)(void),
- void (*prepare_backbuffer_function)(void),
- boolean (*redraw_needed_function)(void),
- struct ToonInfo *toons, int num_toons,
- int startx, int starty,
- int width, int height)
-{
- screen_info.toon_bitmap_array = toon_bitmap_array;
- screen_info.save_buffer = save_buffer;
- screen_info.update_function = update_function;
- screen_info.prepare_backbuffer_function = prepare_backbuffer_function;
- screen_info.redraw_needed_function = redraw_needed_function;
- screen_info.toons = toons;
- screen_info.num_toons = num_toons;
- screen_info.startx = startx;
- screen_info.starty = starty;
- screen_info.width = width;
- screen_info.height = height;
-}
-
-void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc,
- int src_x, int src_y, int width, int height,
- int dest_x, int dest_y, int pad_x, int pad_y)
-{
- int buf_x = DOOR_GFX_PAGEX3, buf_y = DOOR_GFX_PAGEY1;
-
-#if 1
- /* special method to avoid flickering interference with BackToFront() */
- BlitBitmap(backbuffer, screen_info.save_buffer, dest_x-pad_x, dest_y-pad_y,
- width+2*pad_x, height+2*pad_y, buf_x, buf_y);
- SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x-src_x, dest_y-src_y);
- BlitBitmapMasked(toon_bitmap, backbuffer,
- src_x, src_y, width, height, dest_x, dest_y);
- BlitBitmap(backbuffer, window, dest_x-pad_x, dest_y-pad_y,
- width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y);
-
- screen_info.update_function();
-
- BlitBitmap(screen_info.save_buffer, backbuffer, buf_x, buf_y,
- width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y);
-#else
- /* normal method, causing flickering interference with BackToFront() */
- BlitBitmap(backbuffer, screen_info.save_buffer, dest_x-pad_x, dest_y-pad_y,
- width+2*pad_x, height+2*pad_y, buf_x, buf_y);
- SetClipOrigin(toon_bitmap,toon_clip_gc, buf_x-src_x+pad_x,buf_y-src_y+pad_y);
- BlitBitmapMasked(toon_bitmap, screen_info.save_buffer,
- src_x, src_y, width, height, buf_x+pad_x, buf_y+pad_y);
- BlitBitmap(screen_info.save_buffer, window, buf_x, buf_y,
- width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y);
-#endif
-
- FlushDisplay();
-}
-
-boolean AnimateToon(int toon_nr, boolean restart)