Skip to content

Commit

Permalink
[Video] Rename grColorCombine to gfxColorCombine
Browse files Browse the repository at this point in the history
  • Loading branch information
zilmar committed May 23, 2017
1 parent 706e922 commit 078c3e8
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Source/Project64-video/Combine.h
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions Source/Project64-video/FBtoScreen.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 3 additions & 7 deletions Source/Project64-video/Renderer/OGLEScombiner.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions Source/Project64-video/Renderer/OGLcombiner.cpp
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions Source/Project64-video/Renderer/Renderer.h
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion Source/Project64-video/TexBuffer.cpp
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Source/Project64-video/TexCache.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Project64-video/Util.cpp
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions Source/Project64-video/rdp.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions Source/Project64-video/ucode06.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 078c3e8

Please sign in to comment.