[Video] Add gfxDrawMode_t

This commit is contained in:
zilmar 2017-08-10 17:37:41 +10:00
parent 2ffaa42f9e
commit 6350243590
7 changed files with 29 additions and 16 deletions

View File

@ -348,7 +348,7 @@ void gfxDrawLine(const void *a, const void *b)
{
}
void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
void gfxDrawVertexArray(gfxDrawMode_t mode, uint32_t Count, void *pointers2)
{
void **pointers = (void**)pointers2;
WriteTrace(TraceGlitch, TraceDebug, "gfxDrawVertexArray(%d,%d)\r\n", mode, Count);
@ -363,7 +363,7 @@ void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
if (need_to_compile) compile_shader();
if (mode != GR_TRIANGLE_FAN)
if (mode != GFX_TRIANGLE_FAN)
{
WriteTrace(TraceGlitch, TraceWarning, "gfxDrawVertexArray : unknown mode : %x", mode);
}
@ -372,7 +372,7 @@ void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
vbo_buffer(GL_TRIANGLE_FAN, 0, Count, pointers[0]);
}
void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, uint32_t stride)
void gfxDrawVertexArrayContiguous(gfxDrawMode_t mode, uint32_t Count, void *pointers, uint32_t stride)
{
WriteTrace(TraceGlitch, TraceDebug, "gfxDrawVertexArrayContiguous(%d,%d,%d)\r\n", mode, Count, stride);
@ -395,10 +395,10 @@ void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers,
switch (mode)
{
case GR_TRIANGLE_STRIP:
case GFX_TRIANGLE_STRIP:
vbo_buffer(GL_TRIANGLE_STRIP, 0, Count, pointers);
break;
case GR_TRIANGLE_FAN:
case GFX_TRIANGLE_FAN:
vbo_buffer(GL_TRIANGLE_FAN, 0, Count, pointers);
break;
default:

View File

@ -534,7 +534,7 @@ void gfxDrawLine(const void *a, const void *b)
grDisplayGLError("gfxDrawLine");
}
void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
void gfxDrawVertexArray(gfxDrawMode_t mode, uint32_t Count, void *pointers2)
{
unsigned int i;
float *x, *y, *q, *s0, *t0, *s1, *t1, *z, *fog;
@ -554,7 +554,7 @@ void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
switch (mode)
{
case GR_TRIANGLE_FAN:
case GFX_TRIANGLE_FAN:
glBegin(GL_TRIANGLE_FAN);
break;
default:
@ -606,7 +606,7 @@ void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2)
grDisplayGLError("gfxDrawVertexArray");
}
void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, uint32_t stride)
void gfxDrawVertexArrayContiguous(gfxDrawMode_t mode, uint32_t Count, void *pointers, uint32_t stride)
{
unsigned int i;
float *x, *y, *q, *s0, *t0, *s1, *t1, *z, *fog;
@ -625,10 +625,10 @@ void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers,
switch (mode)
{
case GR_TRIANGLE_STRIP:
case GFX_TRIANGLE_STRIP:
glBegin(GL_TRIANGLE_STRIP);
break;
case GR_TRIANGLE_FAN:
case GFX_TRIANGLE_FAN:
glBegin(GL_TRIANGLE_FAN);
break;
default:

View File

@ -48,8 +48,8 @@ void gfxDepthMask(bool mask);
void gfxDrawTriangle(const void *a, const void *b, const void *c);
void gfxDepthBiasLevel(int32_t level);
void gfxDrawLine(const void *a, const void *b);
void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2);
void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, uint32_t stride);
void gfxDrawVertexArray(gfxDrawMode_t mode, uint32_t Count, void *pointers2);
void gfxDrawVertexArrayContiguous(gfxDrawMode_t mode, uint32_t Count, void *pointers, uint32_t stride);
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
void gfxAuxBufferExt(gfxBuffer_t buffer);

View File

@ -283,6 +283,19 @@ enum gfxLfbWriteMode_t
GFX_LFBWRITEMODE_ANY = 0xFF,
};
enum gfxDrawMode_t
{
GFX_POINTS = 0,
GFX_LINE_STRIP = 1,
GFX_LINES = 2,
GFX_POLYGON = 3,
GFX_TRIANGLE_STRIP = 4,
GFX_TRIANGLE_FAN = 5,
GFX_TRIANGLES = 6,
GFX_TRIANGLE_STRIP_CONTINUE = 7,
GFX_TRIANGLE_FAN_CONTINUE = 8,
};
enum gfxColorFormat_t
{
GFX_COLORFORMAT_ARGB = 0x0,

View File

@ -1604,7 +1604,7 @@ static void render_tri(uint16_t linew, int old_interpolate)
DepthBuffer(rdp.vtxbuf, n);
if ((rdp.rm & 0xC10) == 0xC10)
gfxDepthBiasLevel(-deltaZ);
gfxDrawVertexArray(GR_TRIANGLE_FAN, n, rdp.vtx_buffer ? (&vtx_list2) : (&vtx_list1));
gfxDrawVertexArray(GFX_TRIANGLE_FAN, n, rdp.vtx_buffer ? (&vtx_list2) : (&vtx_list1));
}
}
}

View File

@ -1586,7 +1586,7 @@ void rdp_texrect()
}
else
{
gfxDrawVertexArrayContiguous(GR_TRIANGLE_STRIP, n_vertices, vptr, sizeof(VERTEX));
gfxDrawVertexArrayContiguous(GFX_TRIANGLE_STRIP, n_vertices, vptr, sizeof(VERTEX));
}
rdp.tri_n += 2;
@ -3949,7 +3949,7 @@ void lle_triangle(uint32_t w1, uint32_t w2, int shade, int texture, int zbuffer,
}
ConvertCoordsConvert(vtxbuf, nbVtxs);
gfxCullMode(GFX_CULL_DISABLE);
gfxDrawVertexArrayContiguous(GR_TRIANGLE_STRIP, nbVtxs - 1, vtxbuf, sizeof(VERTEX));
gfxDrawVertexArrayContiguous(GFX_TRIANGLE_STRIP, nbVtxs - 1, vtxbuf, sizeof(VERTEX));
}
void rdp_triangle(int shade, int texture, int zbuffer)

View File

@ -474,7 +474,7 @@ void DrawImage(DRAWIMAGE & d)
apply_shade_mods(&(v[s]));
ConvertCoordsConvert(v, 4);
gfxDrawVertexArrayContiguous(GR_TRIANGLE_STRIP, 4, v, sizeof(VERTEX));
gfxDrawVertexArrayContiguous(GFX_TRIANGLE_STRIP, 4, v, sizeof(VERTEX));
rdp.tri_n += 2;
}
else