From de12e4269f24342be1d82916685494a0207cbb3e Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Thu, 2 Feb 2023 14:41:35 +0100 Subject: [PATCH] Minor stuff --- draw.h | 2 +- world.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/draw.h b/draw.h index 644f1ab..699252a 100644 --- a/draw.h +++ b/draw.h @@ -331,7 +331,7 @@ static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const p gte_stsxy(&poly->x3); setPolyFT4(poly); - if (semiTrans) poly->code |= 2; + poly->code |= 2 * !!semiTrans; addPrim(ot, poly); ++polyCount; } diff --git a/world.c b/world.c index bcd6fac..536c0a9 100644 --- a/world.c +++ b/world.c @@ -122,7 +122,7 @@ static void world_drawface_lit(const world_t *world, const ps1bsp_face_t *face, const ps1bsp_polygon_t* poly = &world->polygons[face->firstPolygon]; for (u_char polyIdx = 0; polyIdx < face->numPolygons; ++polyIdx, ++poly) { - ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; + const ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; draw_quadstrip_lit(world->vertices, polyVertices, poly->numPolyVertices, ot); } } @@ -137,7 +137,7 @@ static void world_drawface_textured(const world_t *world, const ps1bsp_face_t *f { for (u_char polyIdx = 0; polyIdx < face->numPolygons; ++polyIdx, ++poly) { - ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; + const ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; draw_quadstrip_water(world->vertices, polyVertices, poly->numPolyVertices, texture->tpage, face->flags & SURF_DRAWWATER, ot); } } @@ -145,7 +145,7 @@ static void world_drawface_textured(const world_t *world, const ps1bsp_face_t *f { for (u_char polyIdx = 0; polyIdx < face->numPolygons; ++polyIdx, ++poly) { - ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; + const ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; draw_quadstrip_textured(world->vertices, polyVertices, poly->numPolyVertices, texture->tpage, ot); } }