diff --git a/Source/Project64-video/Combine.h b/Source/Project64-video/Combine.h index fe5fda549..5e27ac362 100644 --- a/Source/Project64-video/Combine.h +++ b/Source/Project64-video/Combine.h @@ -45,7 +45,7 @@ typedef struct { uint32_t ccolor; // constant color to set at the end, color and alpha - uint32_t c_fnc, c_fac, c_loc, c_oth; // grColorCombine flags + uint32_t c_fnc, c_fac, c_loc, c_oth; // gfxColorCombine flags uint32_t a_fnc, a_fac, a_loc, a_oth; // grAlphaCombine flags uint32_t tex, tmu0_func, tmu0_fac, tmu0_invert, tmu1_func, tmu1_fac, tmu1_invert; uint32_t tmu0_a_func, tmu0_a_fac, tmu0_a_invert, tmu1_a_func, tmu1_a_fac, tmu1_a_invert; diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index 75f4796d7..dc5b94793 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -64,7 +64,7 @@ static int SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaque) GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP); // gfxConstantColorValue (0xFFFFFFFF); - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, @@ -415,7 +415,7 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info) uint32_t tex_size = gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info); int tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque); gfxConstantColorValue(rdp.fog_color); - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_CONSTANT, @@ -485,7 +485,7 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) t_info.smallLodLog2 = t_info.largeLodLog2 = LOD; t_info.aspectRatioLog2 = GR_ASPECT_LOG2_1x1; gfxConstantColorValue(rdp.fog_color); - grColorCombine(GR_COMBINE_FUNCTION_LOCAL, + gfxColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_CONSTANT, GR_COMBINE_OTHER_NONE, @@ -597,7 +597,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) int tmu = SetupFBtoScreenCombiner(gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque); gfxConstantColorValue(rdp.fog_color); - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_CONSTANT, diff --git a/Source/Project64-video/Renderer/OGLEScombiner.cpp b/Source/Project64-video/Renderer/OGLEScombiner.cpp index 52b670c96..7dc8e2e1e 100644 --- a/Source/Project64-video/Renderer/OGLEScombiner.cpp +++ b/Source/Project64-video/Renderer/OGLEScombiner.cpp @@ -784,11 +784,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int } } -FX_ENTRY void FX_CALL -grColorCombine( - GrCombineFunction_t function, GrCombineFactor_t factor, - GrCombineLocal_t local, GrCombineOther_t other, - FxBool invert) +void gfxColorCombine(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert) { WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert); static int last_function = 0; @@ -806,7 +802,7 @@ grColorCombine( last_local = local; last_other = other; - if (invert) WriteTrace(TraceGlitch, TraceWarning, "grColorCombine : inverted result"); + if (invert) WriteTrace(TraceGlitch, TraceWarning, "gfxColorCombine : inverted result"); color_combiner_key = function | (factor << 4) | (local << 8) | (other << 10); chroma_other_color = other; @@ -872,7 +868,7 @@ grColorCombine( break; default: strcpy(fragment_shader_color_combiner, g_fragment_shader_default); - WriteTrace(TraceGlitch, TraceWarning, "grColorCombine : unknown function : %x", function); + WriteTrace(TraceGlitch, TraceWarning, "gfxColorCombine : unknown function : %x", function); } //compile_shader(); need_to_compile = 1; diff --git a/Source/Project64-video/Renderer/OGLcombiner.cpp b/Source/Project64-video/Renderer/OGLcombiner.cpp index 39b36d300..60c53681d 100644 --- a/Source/Project64-video/Renderer/OGLcombiner.cpp +++ b/Source/Project64-video/Renderer/OGLcombiner.cpp @@ -722,11 +722,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int } } -FX_ENTRY void FX_CALL -grColorCombine( - GrCombineFunction_t function, GrCombineFactor_t factor, - GrCombineLocal_t local, GrCombineOther_t other, - FxBool invert) +void gfxColorCombine(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert) { WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert); diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 9db0550a1..f4f99ac19 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -24,6 +24,7 @@ void gfxTextureBufferExt(GrChipID_t tmu, FxU32 startAddress, GrLOD_t lodmin, GrL FxU32 gfxTexMaxAddress(GrChipID_t tmu); FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info); void gfxConstantColorValue(GrColor_t value); +void gfxColorCombine(GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); 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 cbbe9400b..dee164119 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -323,7 +323,7 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage) static GrTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE) { - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, diff --git a/Source/Project64-video/TexCache.cpp b/Source/Project64-video/TexCache.cpp index 2f29fda16..853bc5e41 100644 --- a/Source/Project64-video/TexCache.cpp +++ b/Source/Project64-video/TexCache.cpp @@ -682,7 +682,7 @@ void TexCache() } else { - grColorCombine(cmb.c_fnc, cmb.c_fac, cmb.c_loc, cmb.c_oth, FXFALSE); + gfxColorCombine(cmb.c_fnc, cmb.c_fac, cmb.c_loc, cmb.c_oth, FXFALSE); grAlphaCombine(cmb.a_fnc, cmb.a_fac, cmb.a_loc, cmb.a_oth, FXFALSE); } gfxConstantColorValue(cmb.ccolor); diff --git a/Source/Project64-video/Util.cpp b/Source/Project64-video/Util.cpp index d649311be..580741f10 100644 --- a/Source/Project64-video/Util.cpp +++ b/Source/Project64-video/Util.cpp @@ -1952,7 +1952,7 @@ void update() void set_message_combiner() { - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, diff --git a/Source/Project64-video/rdp.cpp b/Source/Project64-video/rdp.cpp index cf7abc217..fdd607b27 100644 --- a/Source/Project64-video/rdp.cpp +++ b/Source/Project64-video/rdp.cpp @@ -2502,7 +2502,7 @@ void rdp_fillrect() gfxConstantColorValue(color); - grColorCombine(GR_COMBINE_FUNCTION_LOCAL, + gfxColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_CONSTANT, GR_COMBINE_OTHER_NONE, @@ -3133,7 +3133,7 @@ void SetWireframeCol() { //case CSettings::wfmode_NormalColors: // normal colors, don't do anything case CSettings::wfmode_VertexColors: - grColorCombine(GR_COMBINE_FUNCTION_LOCAL, + gfxColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_ITERATED, GR_COMBINE_OTHER_NONE, @@ -3161,7 +3161,7 @@ void SetWireframeCol() FXFALSE, FXFALSE); break; case CSettings::wfmode_RedOnly: - grColorCombine(GR_COMBINE_FUNCTION_LOCAL, + gfxColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_LOCAL_CONSTANT, GR_COMBINE_OTHER_NONE, diff --git a/Source/Project64-video/ucode06.cpp b/Source/Project64-video/ucode06.cpp index 468a3bbe5..f3f4ac233 100644 --- a/Source/Project64-video/ucode06.cpp +++ b/Source/Project64-video/ucode06.cpp @@ -72,7 +72,7 @@ float set_sprite_combine_mode() if (rdp.cycle_mode == 2) { - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE, @@ -158,7 +158,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d) GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE); - grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, + gfxColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_LOCAL_NONE, GR_COMBINE_OTHER_TEXTURE,