Skip to content

Commit 671958a

Browse files
committed
use square map
1 parent 1ad1827 commit 671958a

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

data/gfx.tgz

-271 Bytes
Binary file not shown.

src/my_game_defs.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#define MAP_WIDTH 32
1212
#define MAP_HEIGHT 32
1313
#define MAP_SLOTS 16
14-
#define MAP_TILES_ACROSS 20
15-
#define MAP_TILES_DOWN 20
14+
#define MAP_TILES_ACROSS 16
15+
#define MAP_TILES_DOWN 16
1616
#define MAP_SCROLL_BORDER 0.4
1717
#define MAP_SCROLL_SPEED 5
1818
#define TICK_DURATION_MS 50

src/sdl.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ void config_game_gfx_update(Gamep g)
861861
// Now convert that to pixels
862862
//
863863
double visible_game_map_w = (double) TILE_WIDTH * MAP_TILES_ACROSS;
864-
double visible_game_map_h = (double) TILE_HEIGHT * (MAP_TILES_DOWN / ratio);
864+
double visible_game_map_h = (double) TILE_HEIGHT * ceil(MAP_TILES_DOWN / ratio);
865+
865866
//
866867
// Compensate for any additional pixels the rounding of the terminal cells loses
867868
//
@@ -871,6 +872,11 @@ void config_game_gfx_update(Gamep g)
871872
visible_game_map_w *= pixel_rounding_w_fixup;
872873
visible_game_map_h *= pixel_rounding_h_fixup;
873874

875+
//
876+
// For now use a square map, ignoring the above
877+
//
878+
visible_game_map_h = visible_game_map_w;
879+
874880
game_pix_width_set(g, visible_game_map_w);
875881
game_pix_height_set(g, visible_game_map_h);
876882

0 commit comments

Comments
 (0)