From 6da2839b615112abd108c37f0a12370e1cb894ff Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 25 May 2017 08:51:36 +1000 Subject: [PATCH] [Video[ rename grDepthMask to gfxDepthMask --- Source/Project64-video/FBtoScreen.cpp | 4 ++-- Source/Project64-video/Main.cpp | 12 ++++++------ Source/Project64-video/Renderer/OGLESgeometry.cpp | 4 ++-- Source/Project64-video/Renderer/OGLgeometry.cpp | 5 ++--- Source/Project64-video/Renderer/Renderer.h | 1 + Source/Project64-video/TexBuffer.cpp | 10 +++++----- Source/Project64-video/Util.cpp | 6 +++--- Source/Project64-video/rdp.cpp | 12 ++++++------ Source/Project64-video/ucode06.cpp | 4 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index 626f81aae..83b60a369 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -92,7 +92,7 @@ static int SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaque) } gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxCullMode(GR_CULL_DISABLE); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); rdp.update |= UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; return tmu; } @@ -500,7 +500,7 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) GR_BLEND_ONE, GR_BLEND_ZERO); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); gfxCullMode(GR_CULL_DISABLE); gfxTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_NONE, diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index 1d09f2f08..e7001134f 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -539,7 +539,7 @@ int InitGfx() gfxDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); gfxDepthBufferFunction(GR_CMP_LESS); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); ChangeSize(); @@ -551,11 +551,11 @@ int InitGfx() gfxDepthBufferFunction(GR_CMP_ALWAYS); grRenderBuffer(GR_BUFFER_BACKBUFFER); gfxColorMask(FXTRUE, FXTRUE); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); grBufferClear(0, 0, 0xFFFF); grBufferSwap(0); grBufferClear(0, 0, 0xFFFF); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); grTexFilterMode(1, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); grTexClampMode(0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP); @@ -1116,7 +1116,7 @@ static void DrawFrameBuffer() if (to_fullscreen) GoToFullScreen(); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); gfxColorMask(FXTRUE, FXTRUE); grBufferClear(0, 0, 0xFFFF); drawViRegBG(); @@ -1319,7 +1319,7 @@ void newSwapBuffers() rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); gfxCullMode(GR_CULL_DISABLE); if (g_capture_screen) @@ -1434,7 +1434,7 @@ void newSwapBuffers() if (g_settings->wireframe() || g_settings->buff_clear() || (g_settings->hacks(CSettings::hack_PPL) && g_settings->ucode() == CSettings::ucode_S2DEX)) { - grDepthMask((g_settings->hacks(CSettings::hack_RE2) && g_settings->fb_depth_render_enabled()) ? FXFALSE : FXTRUE); + gfxDepthMask((g_settings->hacks(CSettings::hack_RE2) && g_settings->fb_depth_render_enabled()) ? FXFALSE : FXTRUE); grBufferClear(0, 0, 0xFFFF); } diff --git a/Source/Project64-video/Renderer/OGLESgeometry.cpp b/Source/Project64-video/Renderer/OGLESgeometry.cpp index 1b7112038..3c876893e 100644 --- a/Source/Project64-video/Renderer/OGLESgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLESgeometry.cpp @@ -287,12 +287,12 @@ void gfxDepthBufferFunction(GrCmpFnc_t function) } } -FX_ENTRY void FX_CALL -grDepthMask(FxBool mask) +void gfxDepthMask(FxBool mask) { WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask); glDepthMask(mask); } + float biasFactor = 0; FX_ENTRY void FX_CALL grDepthBiasLevel(FxI32 level) diff --git a/Source/Project64-video/Renderer/OGLgeometry.cpp b/Source/Project64-video/Renderer/OGLgeometry.cpp index 302d07fe6..7a8bae524 100644 --- a/Source/Project64-video/Renderer/OGLgeometry.cpp +++ b/Source/Project64-video/Renderer/OGLgeometry.cpp @@ -219,12 +219,11 @@ void gfxDepthBufferFunction(GrCmpFnc_t function) grDisplayGLError("gfxDepthBufferFunction"); } -FX_ENTRY void FX_CALL -grDepthMask(FxBool mask) +void gfxDepthMask(FxBool mask) { WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask); glDepthMask((GLboolean)mask); - grDisplayGLError("grDepthMask"); + grDisplayGLError("gfxDepthMask"); } float biasFactor = 0; diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index eb077c71d..e08cca398 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -45,6 +45,7 @@ void gfxVertexLayout(FxU32 param, FxI32 offset, FxU32 mode); void gfxCullMode(GrCullMode_t mode); void gfxDepthBufferMode(GrDepthBufferMode_t mode); void gfxDepthBufferFunction(GrCmpFnc_t function); +void gfxDepthMask(FxBool mask); 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 72b30ef87..ab0b02cc3 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -258,9 +258,9 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage) 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); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); grBufferClear(0, 0, 0xFFFF); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); grRenderBuffer(GR_BUFFER_BACKBUFFER); rdp.texbufs[i].count--; if (j < rdp.texbufs[i].count) @@ -300,9 +300,9 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage) if (rdp.cur_image->clear && g_settings->fb_hwfbe_buf_clear_enabled() && cimage.changed) { rdp.cur_image->clear = FALSE; - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); grBufferClear(0, 0, 0xFFFF); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); } //*/ // memset(gfx.RDRAM+cimage.addr, 0, cimage.width*cimage.height*cimage.size); @@ -341,7 +341,7 @@ static GrTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE) GR_BLEND_ZERO); gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); gfxCullMode(GR_CULL_DISABLE); gfxFogMode(GR_FOG_DISABLE); GrTextureFormat_t buf_format = (rdp.tbuff_tex) ? rdp.tbuff_tex->info.format : GFX_TEXFMT_RGB_565; diff --git a/Source/Project64-video/Util.cpp b/Source/Project64-video/Util.cpp index c895ffe86..fea69a405 100644 --- a/Source/Project64-video/Util.cpp +++ b/Source/Project64-video/Util.cpp @@ -1776,15 +1776,15 @@ void update() } if (rdp.flags & ZBUF_UPDATE) - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); else - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); } else { grDepthBiasLevel(0); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); } } diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index 75d62fb99..2f3b1304d 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2395,7 +2395,7 @@ void rdp_fillrect() if (!g_settings->hacks(CSettings::hack_Hyperbike) || rdp.ci_width > 64) //do not clear main depth buffer for aux depth buffers { update_scissor(); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); gfxColorMask(FXFALSE, FXFALSE); grBufferClear(0, 0, rdp.fill_color ? rdp.fill_color & 0xFFFF : 0xFFFF); gfxColorMask(FXTRUE, FXTRUE); @@ -2437,9 +2437,9 @@ void rdp_fillrect() ((uint32_t)((float)((color & 0x07C0) >> 6) / 31.0f * 255.0f) << 16) | ((uint32_t)((float)((color & 0x003E) >> 1) / 31.0f * 255.0f) << 8); } - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); grBufferClear(color, 0, 0xFFFF); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); rdp.update |= UPDATE_ZBUF_ENABLED; WriteTrace(TraceRDP, TraceDebug, "Fillrect - cleared the texture buffer"); return; @@ -2522,7 +2522,7 @@ void rdp_fillrect() gfxCullMode(GR_CULL_DISABLE); gfxFogMode(GR_FOG_DISABLE); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); rdp.update |= UPDATE_COMBINE | UPDATE_CULL_MODE | UPDATE_FOG_ENABLED | UPDATE_ZBUF_ENABLED; } @@ -2721,9 +2721,9 @@ static void RestoreScale() rdp.view_trans[1] *= rdp.scale_y; rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR; //* - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); grBufferClear(0, 0, 0xFFFF); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); //*/ } diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index 2b886c75d..4ef68f0dc 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -173,7 +173,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) GR_BLEND_ONE, GR_BLEND_ZERO); gfxDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); + gfxDepthMask(FXFALSE); GrLOD_t LOD = g_scr_res_x > 1024 ? GFX_LOD_LOG2_2048 : GFX_LOD_LOG2_1024; @@ -202,7 +202,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) grDrawTriangle(&v[2], &v[3], &v[1]); grRenderBuffer(GR_BUFFER_BACKBUFFER); grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); - grDepthMask(FXTRUE); + gfxDepthMask(FXTRUE); } void DrawDepthImage(const DRAWIMAGE & d)