|
|
@ -10,7 +10,7 @@ |
|
|
#define setColorFast(pr, r) *((u_int*)(pr)) = *((u_int*)(r)) |
|
|
#define setColorFast(pr, r) *((u_int*)(pr)) = *((u_int*)(r)) |
|
|
#define setUVFast(pu, u) *((u_short*)(pu)) = *((u_short*)(u)) |
|
|
#define setUVFast(pu, u) *((u_short*)(pu)) = *((u_short*)(u)) |
|
|
|
|
|
|
|
|
static u_int color_white = ((255 << 24) | (255 << 16) | (255 << 8) | 255); |
|
|
|
|
|
|
|
|
static u_int color_white = ((255 << 16) | (255 << 8) | 255); |
|
|
|
|
|
|
|
|
static INLINE void draw_triangle_lit(SVECTOR *verts, u_long *ot) |
|
|
static INLINE void draw_triangle_lit(SVECTOR *verts, u_long *ot) |
|
|
{ |
|
|
{ |
|
|
@ -243,8 +243,8 @@ static INLINE void draw_quadstrip_textured(const ps1bsp_vertex_t *vertices, cons |
|
|
// Fill out the quad's data fields in struct order, to optimize data access |
|
|
// Fill out the quad's data fields in struct order, to optimize data access |
|
|
// First vertex and texture CLUT |
|
|
// First vertex and texture CLUT |
|
|
setColorFast(&poly->r0, &v0->r); |
|
|
setColorFast(&poly->r0, &v0->r); |
|
|
gte_stsxy0(&poly->x0); |
|
|
|
|
|
setUVFast(&poly->u0, &v0->u); |
|
|
setUVFast(&poly->u0, &v0->u); |
|
|
|
|
|
gte_stsxy0(&poly->x0); |
|
|
poly->clut = quake_clut; |
|
|
poly->clut = quake_clut; |
|
|
|
|
|
|
|
|
// Second vertex and texture page |
|
|
// Second vertex and texture page |
|
|
@ -264,8 +264,8 @@ static INLINE void draw_quadstrip_textured(const ps1bsp_vertex_t *vertices, cons |
|
|
|
|
|
|
|
|
// Fourth vertex |
|
|
// Fourth vertex |
|
|
setColorFast(&poly->r3, &v3->r); |
|
|
setColorFast(&poly->r3, &v3->r); |
|
|
gte_stsxy(&poly->x3); |
|
|
|
|
|
setUVFast(&poly->u3, &v3->u); |
|
|
setUVFast(&poly->u3, &v3->u); |
|
|
|
|
|
gte_stsxy(&poly->x3); |
|
|
|
|
|
|
|
|
setPolyGT4(poly); |
|
|
setPolyGT4(poly); |
|
|
addPrim(ot, poly); |
|
|
addPrim(ot, poly); |
|
|
@ -309,29 +309,29 @@ static INLINE void draw_quadstrip_water(const ps1bsp_vertex_t *vertices, const p |
|
|
// Fill out the quad's data fields in struct order, to optimize data access |
|
|
// Fill out the quad's data fields in struct order, to optimize data access |
|
|
// First vertex and texture CLUT |
|
|
// First vertex and texture CLUT |
|
|
setColorFast(&poly->r0, &color_white); |
|
|
setColorFast(&poly->r0, &color_white); |
|
|
gte_stsxy0(&poly->x0); |
|
|
|
|
|
setUVFast(&poly->u0, &v0->u); |
|
|
setUVFast(&poly->u0, &v0->u); |
|
|
poly->clut = quake_clut; |
|
|
|
|
|
|
|
|
gte_stsxy0(&poly->x0); |
|
|
|
|
|
poly->clut = water_clut; |
|
|
|
|
|
|
|
|
// Second vertex and texture page |
|
|
// Second vertex and texture page |
|
|
gte_stsxy1(&poly->x1); |
|
|
|
|
|
setUVFast(&poly->u1, &v1->u); |
|
|
setUVFast(&poly->u1, &v1->u); |
|
|
poly->tpage = tpage; |
|
|
poly->tpage = tpage; |
|
|
|
|
|
gte_stsxy1(&poly->x1); |
|
|
|
|
|
|
|
|
// Third vertex |
|
|
// Third vertex |
|
|
gte_stsxy2(&poly->x2); |
|
|
|
|
|
setUVFast(&poly->u2, &v2->u); |
|
|
setUVFast(&poly->u2, &v2->u); |
|
|
|
|
|
gte_stsxy2(&poly->x2); |
|
|
|
|
|
|
|
|
// Transform the fourth vertex to complete the quad |
|
|
// Transform the fourth vertex to complete the quad |
|
|
gte_ldv0(&vertices[v3->index]); |
|
|
gte_ldv0(&vertices[v3->index]); |
|
|
gte_rtps(); |
|
|
gte_rtps(); |
|
|
|
|
|
|
|
|
// Fourth vertex |
|
|
// Fourth vertex |
|
|
gte_stsxy(&poly->x3); |
|
|
|
|
|
setUVFast(&poly->u3, &v3->u); |
|
|
setUVFast(&poly->u3, &v3->u); |
|
|
|
|
|
gte_stsxy(&poly->x3); |
|
|
|
|
|
|
|
|
setPolyFT4(poly); |
|
|
setPolyFT4(poly); |
|
|
setSemiTrans(poly, semiTrans); |
|
|
|
|
|
|
|
|
if (semiTrans) poly->code |= 2; |
|
|
addPrim(ot, poly); |
|
|
addPrim(ot, poly); |
|
|
++polyCount; |
|
|
++polyCount; |
|
|
} |
|
|
} |
|
|
|