X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=7902f42bb80279fc126ea08d394f4ad4ed536027;hb=a7b74f182679d4bd1a61b5ae840ec48409d09056;hp=0c75045275d224924c40bdf96eff2949b6f2c3b5;hpb=610e1570ca2492a97cfc5cf6a3794c07b605df48;p=rocksndiamonds.git diff --git a/src/libgame/system.c b/src/libgame/system.c index 0c750452..7902f42b 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -214,6 +214,14 @@ void InitGfxDoor2Info(int vx, int vy, int vxsize, int vysize) gfx.vysize = vysize; } +void InitGfxDoor3Info(int ex, int ey, int exsize, int eysize) +{ + gfx.ex = ex; + gfx.ey = ey; + gfx.exsize = exsize; + gfx.eysize = eysize; +} + void InitGfxWindowInfo(int win_xsize, int win_ysize) { gfx.win_xsize = win_xsize; @@ -318,11 +326,9 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize); else if (mask == REDRAW_DOOR_1) - { DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile, gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize); - } } #else @@ -350,10 +356,8 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0, gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize); else if (mask == REDRAW_DOOR_1) - { BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0, gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize); - } } #endif @@ -415,6 +419,13 @@ inline static void sysCopyArea(Bitmap *src_bitmap, Bitmap *dst_bitmap, #endif } +void LimitScreenUpdates(boolean enable) +{ +#if defined(TARGET_SDL) + SDLLimitScreenUpdates(enable); +#endif +} + void InitVideoDisplay(void) { #if defined(TARGET_SDL) @@ -438,18 +449,23 @@ void CloseVideoDisplay(void) void InitVideoBuffer(int width, int height, int depth, boolean fullscreen) { +#if 0 + printf("::: InitVideoBuffer\n"); +#endif + video.width = width; video.height = height; video.depth = GetRealDepth(depth); video.fullscreen_available = FULLSCREEN_STATUS; video.fullscreen_enabled = FALSE; + // video.fullscreen_initial = FALSE; #if 0 video.fullscreen_mode_current = NULL; video.fullscreen_modes = NULL; #endif - video.window_scaling_available = TRUE; + video.window_scaling_available = WINDOW_SCALING_STATUS; #if defined(TARGET_SDL) SDLInitVideoBuffer(&backbuffer, &window, fullscreen); @@ -555,6 +571,19 @@ inline static boolean CheckDrawingArea(int x, int y, int width, int height, if (draw_mask & REDRAW_ALL) return TRUE; +#if 1 + if ((draw_mask & REDRAW_FIELD) && IN_GFX_FIELD_FULL(x, y)) + return TRUE; + + if ((draw_mask & REDRAW_DOOR_1) && IN_GFX_DOOR_1(x, y)) + return TRUE; + + if ((draw_mask & REDRAW_DOOR_2) && IN_GFX_DOOR_2(x, y)) + return TRUE; + + if ((draw_mask & REDRAW_DOOR_3) && IN_GFX_DOOR_3(x, y)) + return TRUE; +#else if ((draw_mask & REDRAW_FIELD) && x >= gfx.real_sx && x < gfx.real_sx + gfx.full_sxsize) return TRUE; @@ -566,6 +595,7 @@ inline static boolean CheckDrawingArea(int x, int y, int width, int height, if ((draw_mask & REDRAW_DOOR_2) && x >= gfx.dx && y >= gfx.vy) return TRUE; +#endif return FALSE; } @@ -677,6 +707,9 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, int dst_x_unclipped = dst_x; int dst_y_unclipped = dst_y; + if (src_bitmap == NULL || dst_bitmap == NULL) + return; + if (DrawingDeactivated(dst_x, dst_y, width, height)) return;