Skip to content

Commit

Permalink
output: small cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Jul 3, 2024
1 parent 29c9cd3 commit 0433e8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/game/level.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ static void Level_CompleteSetup(int32_t level_num)
// Configure enemies who carry and drop items
Carrier_InitialiseLevel(level_num);

size_t max_vertices = Level_CalculateMaxVertices();
const size_t max_vertices = Level_CalculateMaxVertices();
LOG_INFO("Maximum vertices: %d", max_vertices);
Output_ReserveVertexBuffer(max_vertices);

Expand Down
10 changes: 5 additions & 5 deletions src/game/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ static const int16_t *Output_CalcRoomVertices(const int16_t *obj_ptr);
static int32_t Output_CalcFogShade(int32_t depth);
static void Output_CalcWibbleTable(void);

void Output_ReserveVertexBuffer(size_t size)
{
m_VBuf = GameBuf_Alloc(size * sizeof(PHD_VBUF), GBUF_VERTEX_BUFFER);
}

static const int16_t *Output_DrawObjectG3(
const int16_t *obj_ptr, int32_t number)
{
Expand Down Expand Up @@ -408,6 +403,11 @@ void Output_Shutdown(void)
Memory_FreePointer(&m_BackdropImagePath);
}

void Output_ReserveVertexBuffer(const size_t size)
{
m_VBuf = GameBuf_Alloc(size * sizeof(PHD_VBUF), GBUF_VERTEX_BUFFER);
}

void Output_SetWindowSize(int width, int height)
{
S_Output_SetWindowSize(width, height);
Expand Down
2 changes: 1 addition & 1 deletion src/game/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

bool Output_Init(void);
void Output_Shutdown(void);
void Output_ReserveVertexBuffer(size_t size);

void Output_SetWindowSize(int width, int height);
void Output_ApplyRenderSettings(void);
Expand All @@ -15,7 +16,6 @@ void Output_DownloadTextures(int page_count);
RGBA_8888 Output_RGB2RGBA(const RGB_888 color);
void Output_SetPalette(RGB_888 palette[256]);
RGB_888 Output_GetPaletteColor(uint8_t idx);
void Output_ReserveVertexBuffer(size_t size);

int32_t Output_GetNearZ(void);
int32_t Output_GetFarZ(void);
Expand Down

0 comments on commit 0433e8d

Please sign in to comment.