diff --git a/Source/Project64-video/Renderer/OGLESgeometry.cpp b/Source/Project64-video/Renderer/OGLESgeometry.cpp index 047cb8910..926cfda4d 100644 --- a/Source/Project64-video/Renderer/OGLESgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLESgeometry.cpp @@ -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: diff --git a/Source/Project64-video/Renderer/OGLgeometry.cpp b/Source/Project64-video/Renderer/OGLgeometry.cpp index 142211244..41f203abd 100644 --- a/Source/Project64-video/Renderer/OGLgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLgeometry.cpp @@ -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: diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 67f241afb..8496521ec 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -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); diff --git a/Source/Project64-video/Renderer/types.h b/Source/Project64-video/Renderer/types.h index e69208049..e612dd92d 100644 --- a/Source/Project64-video/Renderer/types.h +++ b/Source/Project64-video/Renderer/types.h @@ -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, diff --git a/Source/Project64-video/Util.cpp b/Source/Project64-video/Util.cpp index eda166244..30ac682b3 100644 --- a/Source/Project64-video/Util.cpp +++ b/Source/Project64-video/Util.cpp @@ -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)); } } } diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index 5e194bcb3..cd1790350 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -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) diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index bd90f3c5c..ead773519 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -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