|
|
@ -193,6 +193,12 @@ static void world_drawface_textured(const world_t *world, const ps1bsp_face_t *f |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Texture window commands needs to be placed *after* the draw commands, because the commands are executed in reverse order |
|
|
|
|
|
DR_TWIN *twin = (DR_TWIN*)mem_prim(sizeof(DR_TWIN)); |
|
|
|
|
|
setlen(twin, 1); |
|
|
|
|
|
twin->code[0] = texture->twin; |
|
|
|
|
|
addPrim(ot, twin); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void (*world_drawface)(const world_t*, const ps1bsp_face_t*, u_long *ot) = &world_drawface_fast; |
|
|
static void (*world_drawface)(const world_t*, const ps1bsp_face_t*, u_long *ot) = &world_drawface_fast; |
|
|
@ -205,7 +211,7 @@ static void world_drawFaces(const world_t *world, const ps1bsp_face_t *firstFace |
|
|
for (const ps1bsp_face_t *face = firstFace; face != NULL; face = face->nextFace) |
|
|
for (const ps1bsp_face_t *face = firstFace; face != NULL; face = face->nextFace) |
|
|
{ |
|
|
{ |
|
|
// Early primitive buffer check |
|
|
// Early primitive buffer check |
|
|
if (!mem_checkprim(sizeof(POLY_GT4), face->totalPrimitives)) |
|
|
|
|
|
|
|
|
if (!mem_checkprim(sizeof(POLY_GT4) + sizeof(DR_TWIN), face->totalPrimitives)) |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
world_drawface(world, face, curOT); |
|
|
world_drawface(world, face, curOT); |
|
|
@ -482,5 +488,11 @@ void world_draw(const world_t *world) |
|
|
else |
|
|
else |
|
|
world_drawface = &world_drawface_lit; |
|
|
world_drawface = &world_drawface_lit; |
|
|
|
|
|
|
|
|
|
|
|
// Make sure we set the texture window back to default after drawing the world |
|
|
|
|
|
DR_TWIN *twin = (DR_TWIN*)mem_prim(sizeof(DR_TWIN)); |
|
|
|
|
|
setlen(twin, 1); |
|
|
|
|
|
twin->code[0] = 0xe2000000; |
|
|
|
|
|
addPrim(curOT, twin); |
|
|
|
|
|
|
|
|
world_drawFaces(world, firstFace); |
|
|
world_drawFaces(world, firstFace); |
|
|
} |
|
|
} |