|
|
@ -5,22 +5,22 @@ |
|
|
#include "draw.h" |
|
|
#include "draw.h" |
|
|
#include "frustum.h" |
|
|
#include "frustum.h" |
|
|
|
|
|
|
|
|
static CVECTOR colors[] = |
|
|
|
|
|
|
|
|
static P_COLOR colors[] = |
|
|
{ |
|
|
{ |
|
|
{ 255, 0, 0 }, |
|
|
|
|
|
{ 0, 255, 0 }, |
|
|
|
|
|
{ 0, 0, 255 }, |
|
|
|
|
|
{ 255, 255, 0 }, |
|
|
|
|
|
{ 255, 0, 255 }, |
|
|
|
|
|
{ 0, 255, 255 }, |
|
|
|
|
|
{ 128, 255, 0 }, |
|
|
|
|
|
{ 255, 128, 0 }, |
|
|
|
|
|
{ 128, 0, 255 }, |
|
|
|
|
|
{ 255, 0, 128 }, |
|
|
|
|
|
{ 0, 128, 255 }, |
|
|
|
|
|
{ 0, 255, 128 }, |
|
|
|
|
|
|
|
|
{ (255 << 16), 0 }, |
|
|
|
|
|
{ (255 << 8), 0 }, |
|
|
|
|
|
{ (255 << 0), 0 }, |
|
|
|
|
|
{ (255 << 16) | (255 << 8), 0 }, |
|
|
|
|
|
{ (255 << 16) | (255 << 0), 0 }, |
|
|
|
|
|
{ (255 << 8) | (255 << 0), 0 }, |
|
|
|
|
|
{ (128 << 8) | (255 << 8), 0 }, |
|
|
|
|
|
{ (255 << 16) | (128 << 8), 0 }, |
|
|
|
|
|
{ (128 << 16) | (255 << 0), 0 }, |
|
|
|
|
|
{ (255 << 16) | (128 << 0), 0 }, |
|
|
|
|
|
{ (128 << 8) | (255 << 0), 0 }, |
|
|
|
|
|
{ (128 << 8) | (128 << 0), 0 }, |
|
|
}; |
|
|
}; |
|
|
static const int numColors = sizeof(colors) / sizeof(CVECTOR); |
|
|
|
|
|
|
|
|
static const int numColors = sizeof(colors) / sizeof(P_COLOR); |
|
|
|
|
|
|
|
|
// Set data pointers directly from an in-memory byte buffer |
|
|
// Set data pointers directly from an in-memory byte buffer |
|
|
#define LOAD_CHUNK(type, dst, num, src, entry) \ |
|
|
#define LOAD_CHUNK(type, dst, num, src, entry) \ |
|
|
@ -110,6 +110,13 @@ static INLINE char world_cull_backface(const world_t *world, const ps1bsp_face_t |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void world_drawface_flat(const world_t *world, const ps1bsp_face_t *face, P_COLOR *color, u_long *ot) |
|
|
|
|
|
{ |
|
|
|
|
|
// Draw untextured, vertex colored faces, skipping the entire polygon tessellation step |
|
|
|
|
|
const ps1bsp_facevertex_t *faceVertices = &world->faceVertices[face->firstFaceVertex]; |
|
|
|
|
|
draw_quadstrip_flat(world->vertices, faceVertices, face->numFaceVertices, color, ot); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static void world_drawface_fast(const world_t *world, const ps1bsp_face_t *face, u_long *ot) |
|
|
static void world_drawface_fast(const world_t *world, const ps1bsp_face_t *face, u_long *ot) |
|
|
{ |
|
|
{ |
|
|
// Draw untextured, vertex colored faces, skipping the entire polygon tessellation step |
|
|
// Draw untextured, vertex colored faces, skipping the entire polygon tessellation step |
|
|
|