fixed playing with small game graphics for native EM engine
authorHolger Schemel <info@artsoft.org>
Mon, 12 Feb 2024 23:01:47 +0000 (00:01 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 18 Feb 2024 15:16:58 +0000 (16:16 +0100)
src/game_bd/bd_graphics.c
src/game_bd/main_bd.h

index b68459bfb2ec7e21420b93a2289e7ab48bf87931..2c0e1335ad05573c81313f83b919d223762abb08 100644 (file)
@@ -343,12 +343,13 @@ int gd_drawcave(Bitmap *dest, GdGame *game, boolean force_redraw)
        int tile = game->element_buffer[y][x];
        int frame = game->animcycle;
        struct GraphicInfo_BD *g = &graphic_info_bd_object[tile][frame];
+       int width  = g->width  * TILESIZE_VAR / TILESIZE;
+       int height = g->height * TILESIZE_VAR / TILESIZE;
 
-       blit_bitmap(g->bitmap, dest, g->src_x, g->src_y, g->width, g->height,
-                   offset.x, offset.y);
+       blit_bitmap(g->bitmap, dest, g->src_x, g->src_y, width, height, offset.x, offset.y);
 
 #if DO_GFX_SANITY_CHECK
-       if (use_native_bd_graphics_engine() && !program.headless)
+       if (use_native_bd_graphics_engine() && !setup.small_game_graphics && !program.headless)
        {
          int old_x = (game->gfx_buffer[y][x] % GD_NUM_OF_CELLS) % GD_NUM_OF_CELLS_X;
          int old_y = (game->gfx_buffer[y][x] % GD_NUM_OF_CELLS) / GD_NUM_OF_CELLS_X;
index 1018cb23bc50a68fdb553625b74166e20e42dffd..d14b9c4c07982ac9f17adc45ee344b4f4e30b531 100644 (file)
@@ -48,6 +48,8 @@
 
 /* screen sizes and positions for BD engine */
 
+#define TILESIZE               32
+
 extern int                     TILESIZE_VAR;
 
 #define TILEX                  TILESIZE_VAR