diff --git a/src/glyph_cache/glyph_cache.c b/src/glyph_cache/glyph_cache.c index 978dcd2e..f0de7b5d 100644 --- a/src/glyph_cache/glyph_cache.c +++ b/src/glyph_cache/glyph_cache.c @@ -330,7 +330,7 @@ void GC_TickAsync(WaveLaneCtx *lane, AsyncFrameLaneCtx *base_async_lane_frame) atlas->cur_pos.y += atlas->cur_row_height; atlas->cur_row_height = 0; } - if (atlas->cur_pos.x + image_dims.x < atlas->dims.x && atlas->cur_pos.y + image_dims.y < atlas->dims.y) + if (atlas->cur_pos.x + image_dims.x <= atlas->dims.x && atlas->cur_pos.y + image_dims.y <= atlas->dims.y) { pos_in_atlas = atlas->cur_pos; atlas->cur_row_height = MaxI32(atlas->cur_row_height, image_dims.y); diff --git a/src/pp/pp.c b/src/pp/pp.c index abd804af..500db2b4 100644 --- a/src/pp/pp.c +++ b/src/pp/pp.c @@ -1351,7 +1351,7 @@ P_Space P_SpaceFromWalls(Arena *arena, P_Frame *frame) GenWall *first_wall = 0; - //- Generate horizontal walls + //- Generate horizontal tile walls for (i32 tile_y = 0; tile_y < P_TilesPitch + 1; ++tile_y) { i32 wall_start = -1; @@ -1396,7 +1396,7 @@ P_Space P_SpaceFromWalls(Arena *arena, P_Frame *frame) } } - //- Generate vertical walls + //- Generate vertical tile walls for (i32 tile_x = 0; tile_x < P_TilesPitch + 1; ++tile_x) { i32 wall_start = -1; @@ -1441,6 +1441,42 @@ P_Space P_SpaceFromWalls(Arena *arena, P_Frame *frame) } } + //- Generate world edge walls + { + { + // Top + GenWall *wall = PushStruct(scratch.arena, GenWall); + SllStackPush(first_wall, wall); + wall->dir = WallDir_Down; + wall->start = VEC2I32(0, 0); + wall->end = VEC2I32(P_TilesPitch, 0); + } + // Bottom + { + GenWall *wall = PushStruct(scratch.arena, GenWall); + SllStackPush(first_wall, wall); + wall->dir = WallDir_Up; + wall->start = VEC2I32(0, P_TilesPitch); + wall->end = VEC2I32(P_TilesPitch, P_TilesPitch); + } + // Left + { + GenWall *wall = PushStruct(scratch.arena, GenWall); + SllStackPush(first_wall, wall); + wall->dir = WallDir_Right; + wall->start = VEC2I32(0, 0); + wall->end = VEC2I32(0, P_TilesPitch); + } + // Right + { + GenWall *wall = PushStruct(scratch.arena, GenWall); + SllStackPush(first_wall, wall); + wall->dir = WallDir_Left; + wall->start = VEC2I32(P_TilesPitch, 0); + wall->end = VEC2I32(P_TilesPitch, P_TilesPitch); + } + } + //- Push walls to space for (GenWall *wall = first_wall; wall; wall = wall->next) { diff --git a/src/pp/pp_vis/pp_vis_core.c b/src/pp/pp_vis/pp_vis_core.c index 328393fe..6500983f 100644 --- a/src/pp/pp_vis/pp_vis_core.c +++ b/src/pp/pp_vis/pp_vis_core.c @@ -4753,7 +4753,7 @@ void V_TickForever(WaveLaneCtx *lane) //- Build gpu data // Backdrop - frame->backdrop_parallax = TweakFloat("Backdrop parallax", 10, 0, 20); + frame->backdrop_parallax = TweakFloat("Backdrop parallax", 4, 0, 20); { SPR_SheetKey sheet = SPR_SheetKeyFromResource(ResourceKeyFromStore(&P_Resources, Lit("backdrop.ase"))); SPR_Sprite sprite = SPR_SpriteFromSheet(sheet, SPR_NilSpanKey, 0); diff --git a/src/sprite/sprite.c b/src/sprite/sprite.c index 88e940bd..902d61ad 100644 --- a/src/sprite/sprite.c +++ b/src/sprite/sprite.c @@ -453,7 +453,7 @@ void SPR_TickAsync(WaveLaneCtx *lane, AsyncFrameLaneCtx *base_async_lane_frame) atlas->cur_pos.y += atlas->cur_row_height; atlas->cur_row_height = 0; } - if (atlas->cur_pos.x + slice_dims.x < atlas->dims.x && atlas->cur_pos.y + slice_dims.y < atlas->dims.y) + if (atlas->cur_pos.x + slice_dims.x <= atlas->dims.x && atlas->cur_pos.y + slice_dims.y <= atlas->dims.y) { atlas_pos = atlas->cur_pos; atlas->cur_row_height = MaxI32(atlas->cur_row_height, slice_dims.y);