diff --git a/Source/Project64-video/Debugger.cpp b/Source/Project64-video/Debugger.cpp index 1eb0f042c..87b842ae2 100644 --- a/Source/Project64-video/Debugger.cpp +++ b/Source/Project64-video/Debugger.cpp @@ -56,8 +56,8 @@ void output(float x, float y, int scale, const char *fmt, ...) ConvertCoordsKeep(v, 4); - grDrawTriangle(&v[0], &v[1], &v[2]); - grDrawTriangle(&v[1], &v[3], &v[2]); + gfxDrawTriangle(&v[0], &v[1], &v[2]); + gfxDrawTriangle(&v[1], &v[3], &v[2]); x += 8; } diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index 83b60a369..ab2810ddd 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -113,8 +113,8 @@ static void DrawRE2Video(FB_TO_SCREEN_INFO & fb_info, float scale) { ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } static void DrawRE2Video256(FB_TO_SCREEN_INFO & fb_info) @@ -266,8 +266,8 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info) { ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } } } @@ -392,8 +392,8 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info) { ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } return true; } @@ -464,8 +464,8 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info) { ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } } } @@ -533,8 +533,8 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) { ul_x, lr_y, 1, 1, ul_u, lr_v, ul_u, lr_v, { ul_u, lr_v, ul_u, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); // grAuxBufferExt( GR_BUFFER_TEXTUREAUXBUFFER_EXT ); rdp.update |= UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; } @@ -624,6 +624,6 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) { ul_x, lr_y, 1, 1, zero, lr_v, zero, lr_v, { zero, lr_v, zero, lr_v } }, { lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } } }; - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } \ No newline at end of file diff --git a/Source/Project64-video/Renderer/OGLESgeometry.cpp b/Source/Project64-video/Renderer/OGLESgeometry.cpp index 3c876893e..31e04c981 100644 --- a/Source/Project64-video/Renderer/OGLESgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLESgeometry.cpp @@ -318,9 +318,7 @@ grDepthBiasLevel(FxI32 level) } // draw - -FX_ENTRY void FX_CALL -grDrawTriangle(const void *a, const void *b, const void *c) +void gfxDrawTriangle(const void *a, const void *b, const void *c) { WriteTrace(TraceGlitch, TraceDebug, "start"); vbo_enable(); diff --git a/Source/Project64-video/Renderer/OGLgeometry.cpp b/Source/Project64-video/Renderer/OGLgeometry.cpp index 7a8bae524..ad9769ba8 100644 --- a/Source/Project64-video/Renderer/OGLgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLgeometry.cpp @@ -307,9 +307,7 @@ grDepthBiasLevel(FxI32 level) } // draw - -FX_ENTRY void FX_CALL -grDrawTriangle(const void *a, const void *b, const void *c) +void gfxDrawTriangle(const void *a, const void *b, const void *c) { float *a_x = (float*)a + xy_off / sizeof(float); float *a_y = (float*)a + xy_off / sizeof(float) + 1; @@ -442,7 +440,7 @@ grDrawTriangle(const void *a, const void *b, const void *c) -(*c_y - (float)heighto) / (float)(g_height / 2) / *c_q, ZCALC(*c_z, *c_q), 1.0f / *c_q); glEnd(); - grDisplayGLError("grDrawTriangle"); + grDisplayGLError("gfxDrawTriangle"); } FX_ENTRY void FX_CALL diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index e08cca398..e01170694 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -46,6 +46,7 @@ void gfxCullMode(GrCullMode_t mode); void gfxDepthBufferMode(GrDepthBufferMode_t mode); void gfxDepthBufferFunction(GrCmpFnc_t function); void gfxDepthMask(FxBool mask); +void gfxDrawTriangle(const void *a, const void *b, const void *c); extern uint32_t nbTextureUnits; extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y; diff --git a/Source/Project64-video/TexBuffer.cpp b/Source/Project64-video/TexBuffer.cpp index ab0b02cc3..a43b37f15 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -428,8 +428,8 @@ int CloseTextureBuffer(int draw) grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info)); gfxClipWindow(0, 0, g_res_x, g_res_y); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) { @@ -482,16 +482,16 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to) }; grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info)); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); grRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.offset_x = rdp.offset_x_bak; rdp.offset_y = rdp.offset_y_bak; rdp.offset_x_bak = rdp.offset_y_bak = 0; AddOffset(v, 4); gfxClipWindow(0, 0, g_res_x, g_res_y); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); rdp.tbuff_tex->info.format = buf_format; rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; @@ -542,8 +542,8 @@ int CopyDepthBuffer() grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(rdp.texbufs[1].tmu, rdp.texbufs[1].begin, LOD, LOD, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); grRenderBuffer(GR_BUFFER_BACKBUFFER); grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); @@ -599,8 +599,8 @@ int SwapTextureBuffer() grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2, texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); rdp.texbufs[rdp.tbuff_tex->tmu].clear_allowed = TRUE; rdp.texbufs[rdp.tbuff_tex->tmu].count = 0; texbuf->tile_uls = rdp.tbuff_tex->tile_uls; diff --git a/Source/Project64-video/Util.cpp b/Source/Project64-video/Util.cpp index fea69a405..4dc14f5ce 100644 --- a/Source/Project64-video/Util.cpp +++ b/Source/Project64-video/Util.cpp @@ -1596,8 +1596,8 @@ static void render_tri(uint16_t linew, int old_interpolate) v[3].x = V1->x - wx; v[3].y = V1->y + wy; } - grDrawTriangle(&v[0], &v[1], &v[2]); - grDrawTriangle(&v[1], &v[2], &v[3]); + gfxDrawTriangle(&v[0], &v[1], &v[2]); + gfxDrawTriangle(&v[1], &v[2], &v[3]); } else { diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index 2f3b1304d..8f55d063b 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2562,8 +2562,8 @@ void rdp_fillrect() } else { - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); } rdp.tri_n += 2; diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index 4ef68f0dc..8618dec16 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -198,8 +198,8 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); grAuxBufferExt(GR_BUFFER_AUXBUFFER); grBufferClear(0, 0, 0xFFFF); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); grRenderBuffer(GR_BUFFER_BACKBUFFER); grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); gfxDepthMask(FXTRUE); @@ -623,8 +623,8 @@ void DrawHiresImage(DRAWIMAGE & d, int screensize) AddOffset(v, 4); for (int s = 0; s < 4; s++) apply_shade_mods(&(v[s])); - grDrawTriangle(&v[0], &v[2], &v[1]); - grDrawTriangle(&v[2], &v[3], &v[1]); + gfxDrawTriangle(&v[0], &v[2], &v[1]); + gfxDrawTriangle(&v[2], &v[3], &v[1]); rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE | UPDATE_SCISSOR; rdp.tri_n += 2; rdp.tbuff_tex = tbuff_tex;