From 2662fc26f8c9552cce3e37f7cd83e6dfc4a5ab72 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 24 May 2017 08:24:57 +1000 Subject: [PATCH] [video] Rename grAlphaBlendFunction to gfxAlphaBlendFunction --- Source/Project64-video/FBtoScreen.cpp | 6 +++--- .../Project64-video/Renderer/OGLEScombiner.cpp | 14 +++++--------- Source/Project64-video/Renderer/OGLcombiner.cpp | 16 ++++++---------- Source/Project64-video/Renderer/Renderer.h | 1 + Source/Project64-video/TexBuffer.cpp | 2 +- Source/Project64-video/TexCache.cpp | 2 +- Source/Project64-video/Util.cpp | 2 +- Source/Project64-video/rdp.cpp | 6 +++--- Source/Project64-video/ucode06.cpp | 4 ++-- 9 files changed, 23 insertions(+), 30 deletions(-) diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index 0d55c9e0c..77d1b8957 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -78,14 +78,14 @@ static int SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaque) if (opaque) { grAlphaTestFunction(GR_CMP_ALWAYS); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); } else { - grAlphaBlendFunction(GR_BLEND_SRC_ALPHA, + gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA, GR_BLEND_ONE, GR_BLEND_ZERO); @@ -495,7 +495,7 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_SRC_ALPHA, + gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA, GR_BLEND_ONE_MINUS_SRC_ALPHA, GR_BLEND_ONE, GR_BLEND_ZERO); diff --git a/Source/Project64-video/Renderer/OGLEScombiner.cpp b/Source/Project64-video/Renderer/OGLEScombiner.cpp index 59e99e5e9..c0b2f0cb0 100644 --- a/Source/Project64-video/Renderer/OGLEScombiner.cpp +++ b/Source/Project64-video/Renderer/OGLEScombiner.cpp @@ -1464,11 +1464,7 @@ void gfxTexCombine(GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFa need_to_compile = 1; } -FX_ENTRY void FX_CALL -grAlphaBlendFunction( - GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, - GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df -) +void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df) { int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0; WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df); @@ -1488,7 +1484,7 @@ grAlphaBlendFunction( sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_sf = %x", rgb_sf); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : rgb_sf = %x", rgb_sf); } switch (rgb_df) @@ -1506,7 +1502,7 @@ grAlphaBlendFunction( dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_df = %x", rgb_df); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : rgb_df = %x", rgb_df); } switch (alpha_sf) @@ -1518,7 +1514,7 @@ grAlphaBlendFunction( sfactorAlpha = GL_ONE; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_sf = %x", alpha_sf); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : alpha_sf = %x", alpha_sf); } switch (alpha_df) @@ -1530,7 +1526,7 @@ grAlphaBlendFunction( dfactorAlpha = GL_ONE; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_df = %x", alpha_df); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : alpha_df = %x", alpha_df); } glEnable(GL_BLEND); glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); diff --git a/Source/Project64-video/Renderer/OGLcombiner.cpp b/Source/Project64-video/Renderer/OGLcombiner.cpp index 9a984848a..6ff01b3c2 100644 --- a/Source/Project64-video/Renderer/OGLcombiner.cpp +++ b/Source/Project64-video/Renderer/OGLcombiner.cpp @@ -1401,11 +1401,7 @@ void gfxTexCombine(GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFa need_to_compile = 1; } -FX_ENTRY void FX_CALL -grAlphaBlendFunction( - GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, - GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df -) +void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df) { int sfactorRGB = 0, dfactorRGB = 0, sfactorAlpha = 0, dfactorAlpha = 0; WriteTrace(TraceGlitch, TraceDebug, "rgb_sf: %d rgb_df: %d alpha_sf: %d alpha_df: %d", rgb_sf, rgb_df, alpha_sf, alpha_df); @@ -1425,7 +1421,7 @@ grAlphaBlendFunction( sfactorRGB = GL_ONE_MINUS_SRC_ALPHA; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_sf = %x", rgb_sf); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : rgb_sf = %x", rgb_sf); } switch (rgb_df) @@ -1443,7 +1439,7 @@ grAlphaBlendFunction( dfactorRGB = GL_ONE_MINUS_SRC_ALPHA; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : rgb_df = %x", rgb_df); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : rgb_df = %x", rgb_df); } switch (alpha_sf) @@ -1455,7 +1451,7 @@ grAlphaBlendFunction( sfactorAlpha = GL_ONE; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_sf = %x", alpha_sf); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : alpha_sf = %x", alpha_sf); } switch (alpha_df) @@ -1467,7 +1463,7 @@ grAlphaBlendFunction( dfactorAlpha = GL_ONE; break; default: - WriteTrace(TraceGlitch, TraceWarning, "grAlphaBlendFunction : alpha_df = %x", alpha_df); + WriteTrace(TraceGlitch, TraceWarning, "gfxAlphaBlendFunction : alpha_df = %x", alpha_df); } glEnable(GL_BLEND); if (blend_func_separate_support) @@ -1475,7 +1471,7 @@ grAlphaBlendFunction( else glBlendFunc(sfactorRGB, dfactorRGB); - grDisplayGLError("grAlphaBlendFunction"); + grDisplayGLError("gfxAlphaBlendFunction"); } FX_ENTRY void FX_CALL diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 8f3570ba0..70fa1b4ff 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -27,6 +27,7 @@ void gfxConstantColorValue(GrColor_t value); void gfxColorCombine(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); void gfxAlphaCombine(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); void gfxTexCombine(GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, FxBool alpha_invert); +void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df); 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 784c00818..cb7979203 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -335,7 +335,7 @@ static GrTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE) GR_COMBINE_OTHER_TEXTURE, FXFALSE); // gfxConstantColorValue (0xFFFFFFFF); - grAlphaBlendFunction(GR_BLEND_ONE, // use alpha compare, but not T0 alpha + gfxAlphaBlendFunction(GR_BLEND_ONE, // use alpha compare, but not T0 alpha GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); diff --git a/Source/Project64-video/TexCache.cpp b/Source/Project64-video/TexCache.cpp index 2cbcf5091..5ba84a2e5 100644 --- a/Source/Project64-video/TexCache.cpp +++ b/Source/Project64-video/TexCache.cpp @@ -686,7 +686,7 @@ void TexCache() gfxAlphaCombine(cmb.a_fnc, cmb.a_fac, cmb.a_loc, cmb.a_oth, FXFALSE); } gfxConstantColorValue(cmb.ccolor); - grAlphaBlendFunction(cmb.abf1, cmb.abf2, GR_BLEND_ZERO, GR_BLEND_ZERO); + gfxAlphaBlendFunction(cmb.abf1, cmb.abf2, GR_BLEND_ZERO, GR_BLEND_ZERO); if (!rdp.tex) //nothing more to do return; } diff --git a/Source/Project64-video/Util.cpp b/Source/Project64-video/Util.cpp index e11f0cfa3..849c95a88 100644 --- a/Source/Project64-video/Util.cpp +++ b/Source/Project64-video/Util.cpp @@ -1962,7 +1962,7 @@ void set_message_combiner() GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ZERO, GR_BLEND_ZERO); diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index e7de981b2..4d2d14ed1 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2514,7 +2514,7 @@ void rdp_fillrect() GR_COMBINE_OTHER_NONE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); grAlphaTestFunction(GR_CMP_ALWAYS); grStippleMode(GR_STIPPLE_DISABLE); @@ -3143,7 +3143,7 @@ void SetWireframeCol() GR_COMBINE_LOCAL_ITERATED, GR_COMBINE_OTHER_NONE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ZERO, GR_BLEND_ZERO); @@ -3172,7 +3172,7 @@ void SetWireframeCol() GR_COMBINE_OTHER_NONE, FXFALSE); gfxConstantColorValue(0xFF0000FF); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ZERO, GR_BLEND_ZERO); diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index 5225bac7a..b21579357 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -82,7 +82,7 @@ float set_sprite_combine_mode() GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ZERO, GR_BLEND_ZERO); @@ -168,7 +168,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - grAlphaBlendFunction(GR_BLEND_ONE, + gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);