generate walls at world edge
This commit is contained in:
parent
0bacad7ada
commit
879491753e
@ -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);
|
||||
|
||||
40
src/pp/pp.c
40
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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user