diff --git a/draw.h b/draw.h index d939900..df86535 100644 --- a/draw.h +++ b/draw.h @@ -256,7 +256,7 @@ static INLINE void draw_quadstrip_textured(const ps1bsp_vertex_t *vertices, cons } } -static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const ps1bsp_polyvertex_t *polyVerts, u_char numVerts, u_short tpage, u_long *ot) +static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const ps1bsp_polyvertex_t *polyVerts, u_char numVerts, u_short tpage, u_char semiTrans, u_long *ot) { // Draw the face as a quad strip const ps1bsp_polyvertex_t *v0, *v1, *v2, *v3; @@ -289,7 +289,7 @@ static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const p // Draw a flat-shaded textured quad POLY_FT4 *poly = (POLY_FT4*)mem_prim(sizeof(POLY_FT4)); setPolyFT4(poly); - setSemiTrans(poly, 1); + setSemiTrans(poly, semiTrans); gte_stsxy3_ft3(poly); // Transform the fourth vertex to complete the quad diff --git a/ps1bsp.h b/ps1bsp.h index d2eb4a0..1f926ce 100755 --- a/ps1bsp.h +++ b/ps1bsp.h @@ -85,7 +85,7 @@ typedef struct } ps1bsp_facevertex_t; #define SURF_DRAWSKY 0x2 -#define SURF_DRAWTURB 0x4 +#define SURF_DRAWLIQUID 0x4 #define SURF_DRAWWATER 0x8 // High quality: Face -> polygons -> polygon vertex indices (index + UV + light) -> vertices diff --git a/test.ps1bsp b/test.ps1bsp index 1ddc313..f1082fc 100755 Binary files a/test.ps1bsp and b/test.ps1bsp differ diff --git a/world.c b/world.c index 0bce96a..5634e8e 100644 --- a/world.c +++ b/world.c @@ -142,12 +142,12 @@ static void world_drawface_textured(const world_t *world, const ps1bsp_face_t *f const ps1bsp_texture_t *texture = &world->textures[face->textureId]; const ps1bsp_polygon_t* poly = &world->polygons[face->firstPolygon]; - if (face->flags & SURF_DRAWWATER) + if (face->flags & SURF_DRAWLIQUID) { for (u_char polyIdx = 0; polyIdx < face->numPolygons; ++polyIdx, ++poly) { ps1bsp_polyvertex_t *polyVertices = &world->polyVertices[poly->firstPolyVertex]; - draw_quadstrip_water(world->vertices, polyVertices, poly->numPolyVertices, texture->tpage, ot); + draw_quadstrip_water(world->vertices, polyVertices, poly->numPolyVertices, texture->tpage, face->flags & SURF_DRAWWATER, ot); } } else