From 4c62e09b2c7b902ee5030befb64828cff8b7eac1 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 22 May 2017 20:35:28 +1000 Subject: [PATCH] [Video] rename grColorMask to gfxColorMask --- Source/Project64-video/Main.cpp | 20 +++---------------- .../Renderer/OGLESglitchmain.cpp | 15 +------------- .../Renderer/OGLglitchmain.cpp | 20 ++++--------------- Source/Project64-video/Renderer/Renderer.h | 1 + Source/Project64-video/rdp.cpp | 6 +++--- 5 files changed, 12 insertions(+), 50 deletions(-) diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index f75e41a66..ea7fae6a3 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -363,7 +363,7 @@ void DisplayLoadProgress(const wchar_t *format, ...) x = (1024 - len) / 2.0f; output(x, 360, 1, buf); grBufferSwap(0); - grColorMask(FXTRUE, FXTRUE); + gfxColorMask(FXTRUE, FXTRUE); grBufferClear(0, 0, 0xFFFF); } @@ -457,9 +457,6 @@ int InitGfx() WriteTrace(TraceGlide64, TraceDebug, "-"); - // Initialize Glide - grGlideInit(); - // Check which SST we are using and initialize stuff // Hiroshi Morii enum { @@ -487,7 +484,6 @@ int InitGfx() if (!gfx_context) { g_Notify->DisplayError("Error setting display mode"); - grGlideShutdown(); return FALSE; } rdp.init(); @@ -570,7 +566,7 @@ int InitGfx() grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); grDepthBufferFunction(GR_CMP_ALWAYS); grRenderBuffer(GR_BUFFER_BACKBUFFER); - grColorMask(FXTRUE, FXTRUE); + gfxColorMask(FXTRUE, FXTRUE); grDepthMask(FXTRUE); grBufferClear(0, 0, 0xFFFF); grBufferSwap(0); @@ -667,9 +663,6 @@ void ReleaseGfx() // Release graphics grSstWinClose(gfx_context); - // Shutdown glide - grGlideShutdown(); - GfxInitDone = FALSE; rdp.window_changed = TRUE; } @@ -945,8 +938,6 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info) ZLUT_init(); grConfigWrapperExt(g_settings->wrpVRAM() * 1024 * 1024, g_settings->wrpFBO(), g_settings->wrpAnisotropic()); - grGlideInit(); - grGlideShutdown(); evoodoo = 1; voodoo.has_2mb_tex_boundary = 0; return TRUE; @@ -1085,11 +1076,6 @@ void CALL RomOpen(void) CheckDRAMSize(); // ** EVOODOO EXTENSIONS ** - if (!GfxInitDone) - { - grGlideInit(); - } - grGlideShutdown(); evoodoo = 1; InitGfx(); } @@ -1147,7 +1133,7 @@ static void DrawFrameBuffer() GoToFullScreen(); grDepthMask(FXTRUE); - grColorMask(FXTRUE, FXTRUE); + gfxColorMask(FXTRUE, FXTRUE); grBufferClear(0, 0, 0xFFFF); drawViRegBG(); } diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index 1dd456a91..f0ba0f141 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -243,19 +243,12 @@ void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy) glEnable(GL_SCISSOR_TEST); } -FX_ENTRY void FX_CALL -grColorMask(FxBool rgb, FxBool a) +void gfxColorMask(FxBool rgb, FxBool a) { WriteTrace(TraceGlitch, TraceDebug, "rgb = %d, a: %d", rgb, a); glColorMask(rgb, rgb, rgb, a); } -FX_ENTRY void FX_CALL -grGlideInit(void) -{ - WriteTrace(TraceGlitch, TraceDebug, "-"); -} - int isExtensionSupported(const char *extension) { return 0; @@ -543,12 +536,6 @@ FX_ENTRY GrContext_t FX_CALL grSstWinOpen(GrColorFormat_t color_format, GrOrigin return 1; } -FX_ENTRY void FX_CALL -grGlideShutdown(void) -{ - WriteTrace(TraceGlitch, TraceDebug, "-"); -} - FX_ENTRY FxBool FX_CALL grSstWinClose(GrContext_t context) { diff --git a/Source/Project64-video/Renderer/OGLglitchmain.cpp b/Source/Project64-video/Renderer/OGLglitchmain.cpp index 8a925019a..c5fa55682 100644 --- a/Source/Project64-video/Renderer/OGLglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLglitchmain.cpp @@ -366,25 +366,19 @@ void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy) glScissor(minx, miny + g_viewport_offset, maxx - minx, maxy - miny); //printf("gl scissor %d %d %d %d\n", minx, miny, maxx, maxy); } - else { + else + { glScissor(minx, (g_viewport_offset)+g_height - maxy, maxx - minx, maxy - miny); } glEnable(GL_SCISSOR_TEST); grDisplayGLError("gfxClipWindow"); } -FX_ENTRY void FX_CALL -grColorMask(FxBool rgb, FxBool a) +void gfxColorMask(FxBool rgb, FxBool a) { WriteTrace(TraceGlitch, TraceDebug, "rgb = %d, a: %d", rgb, a); glColorMask((GLboolean)rgb, (GLboolean)rgb, (GLboolean)rgb, (GLboolean)a); - grDisplayGLError("grColorMask"); -} - -FX_ENTRY void FX_CALL -grGlideInit(void) -{ - WriteTrace(TraceGlitch, TraceDebug, "-"); + grDisplayGLError("gfxColorMask"); } int isExtensionSupported(const char *extension) @@ -824,12 +818,6 @@ grSstWinOpen( return 1; } -FX_ENTRY void FX_CALL -grGlideShutdown(void) -{ - WriteTrace(TraceGlitch, TraceDebug, "-"); -} - FX_ENTRY FxBool FX_CALL grSstWinClose(GrContext_t context) { diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 411228498..a46376888 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -18,6 +18,7 @@ void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy); FxU32 gfxTexMinAddress(GrChipID_t tmu); +void gfxColorMask(FxBool rgb, FxBool a); 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/rdp.cpp b/Source/Project64-video/rdp.cpp index 962c2a8d7..8a6293045 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2396,9 +2396,9 @@ void rdp_fillrect() { update_scissor(); grDepthMask(FXTRUE); - grColorMask(FXFALSE, FXFALSE); + gfxColorMask(FXFALSE, FXFALSE); grBufferClear(0, 0, rdp.fill_color ? rdp.fill_color & 0xFFFF : 0xFFFF); - grColorMask(FXTRUE, FXTRUE); + gfxColorMask(FXTRUE, FXTRUE); rdp.update |= UPDATE_ZBUF_ENABLED; } ul_x = minval(maxval(ul_x, rdp.scissor_o.ul_x), rdp.scissor_o.lr_x); @@ -2986,7 +2986,7 @@ void rdp_setcolorimage() /* else //just clear buffer { - grColorMask(FXTRUE, FXTRUE); + gfxColorMask(FXTRUE, FXTRUE); grBufferClear (0, 0, 0xFFFF); } */