[Video] Rename GrFogMode_t to gfxFogMode_t

This commit is contained in:
zilmar 2017-07-31 21:15:09 +10:00
parent 30ca04c2a0
commit 27950b4eb1
9 changed files with 39 additions and 27 deletions

View File

@ -1566,21 +1566,21 @@ void gfxAlphaTestFunction(gfxCmpFnc_t function)
// fog // fog
void gfxFogMode(GrFogMode_t mode) void gfxFogMode(gfxFogMode_t mode)
{ {
WriteTrace(TraceGlitch, TraceDebug, "mode: %d", mode); WriteTrace(TraceGlitch, TraceDebug, "mode: %d", mode);
switch (mode) switch (mode)
{ {
case GR_FOG_DISABLE: case GFX_FOG_DISABLE:
//glDisable(GL_FOG); //glDisable(GL_FOG);
g_fog_enabled = 0; g_fog_enabled = 0;
break; break;
case GR_FOG_WITH_TABLE_ON_Q: case GFX_FOG_WITH_TABLE_ON_Q:
//glEnable(GL_FOG); //glEnable(GL_FOG);
//glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); //glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
g_fog_enabled = 1; g_fog_enabled = 1;
break; break;
case GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT: case GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT:
//glEnable(GL_FOG); //glEnable(GL_FOG);
//glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); //glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
g_fog_enabled = 2; g_fog_enabled = 2;

View File

@ -936,7 +936,7 @@ uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params)
params[0] = 256; params[0] = 256;
return 4; return 4;
break; break;
case GR_FOG_TABLE_ENTRIES: case GFX_FOG_TABLE_ENTRIES:
if (plength < 4 || params == NULL) return 0; if (plength < 4 || params == NULL) return 0;
params[0] = 64; params[0] = 64;
return 4; return 4;

View File

@ -1510,21 +1510,21 @@ void gfxAlphaTestFunction(gfxCmpFnc_t function)
// fog // fog
void gfxFogMode(GrFogMode_t mode) void gfxFogMode(gfxFogMode_t mode)
{ {
WriteTrace(TraceGlitch, TraceDebug, "mode: %d", mode); WriteTrace(TraceGlitch, TraceDebug, "mode: %d", mode);
switch (mode) switch (mode)
{ {
case GR_FOG_DISABLE: case GFX_FOG_DISABLE:
glDisable(GL_FOG); glDisable(GL_FOG);
fog_enabled = 0; fog_enabled = 0;
break; break;
case GR_FOG_WITH_TABLE_ON_Q: case GFX_FOG_WITH_TABLE_ON_Q:
glEnable(GL_FOG); glEnable(GL_FOG);
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
fog_enabled = 1; fog_enabled = 1;
break; break;
case GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT: case GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT:
glEnable(GL_FOG); glEnable(GL_FOG);
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
fog_enabled = 2; fog_enabled = 2;

View File

@ -29,7 +29,7 @@ void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombin
void gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df); void gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df);
void gfxAlphaTestReferenceValue(gfxAlpha_t value); void gfxAlphaTestReferenceValue(gfxAlpha_t value);
void gfxAlphaTestFunction(gfxCmpFnc_t function); void gfxAlphaTestFunction(gfxCmpFnc_t function);
void gfxFogMode(GrFogMode_t mode); void gfxFogMode(gfxFogMode_t mode);
void gfxFogGenerateLinear(float nearZ, float farZ); void gfxFogGenerateLinear(float nearZ, float farZ);
void gfxFogColorValue(gfxColor_t fogcolor); void gfxFogColorValue(gfxColor_t fogcolor);
void gfxChromakeyMode(GrChromakeyMode_t mode); void gfxChromakeyMode(GrChromakeyMode_t mode);

View File

@ -126,6 +126,18 @@ enum gfxCombineFunction_t
GFX_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA = 0x10, GFX_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA = 0x10,
}; };
enum gfxFogMode_t
{
GFX_FOG_DISABLE = 0x0,
GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT = 0x1,
GFX_FOG_WITH_TABLE_ON_Q = 0x2,
GFX_FOG_WITH_TABLE_ON_W = GFX_FOG_WITH_TABLE_ON_Q,
GFX_FOG_WITH_ITERATED_Z = 0x3,
GFX_FOG_WITH_ITERATED_ALPHA_EXT = 0x4,
GFX_FOG_MULT2 = 0x100,
GFX_FOG_ADD2 = 0x200,
};
enum gfxCombineFactor_t enum gfxCombineFactor_t
{ {
GFX_COMBINE_FACTOR_ZERO = 0x0, GFX_COMBINE_FACTOR_ZERO = 0x0,

View File

@ -343,7 +343,7 @@ static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
gfxDepthBufferFunction(GFX_CMP_ALWAYS); gfxDepthBufferFunction(GFX_CMP_ALWAYS);
gfxDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
gfxTextureFormat_t buf_format = (rdp.tbuff_tex) ? rdp.tbuff_tex->info.format : GFX_TEXFMT_RGB_565; gfxTextureFormat_t buf_format = (rdp.tbuff_tex) ? rdp.tbuff_tex->info.format : GFX_TEXFMT_RGB_565;
gfxCombineFunction_t color_source = GFX_COMBINE_FUNCTION_LOCAL; gfxCombineFunction_t color_source = GFX_COMBINE_FUNCTION_LOCAL;
if (!force_rgb && rdp.black_ci_index > 0 && rdp.black_ci_index <= rdp.copy_ci_index) if (!force_rgb && rdp.black_ci_index > 0 && rdp.black_ci_index <= rdp.copy_ci_index)
@ -433,7 +433,7 @@ int CloseTextureBuffer(int draw)
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
{ {
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
} }
WriteTrace(TraceRDP, TraceDebug, "CloseTextureBuffer draw, OK"); WriteTrace(TraceRDP, TraceDebug, "CloseTextureBuffer draw, OK");
rdp.tbuff_tex = 0; rdp.tbuff_tex = 0;
@ -497,7 +497,7 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to)
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR; rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR;
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
WriteTrace(TraceRDP, TraceDebug, "CopyTextureBuffer draw, OK"); WriteTrace(TraceRDP, TraceDebug, "CopyTextureBuffer draw, OK");
rdp.tbuff_tex = 0; rdp.tbuff_tex = 0;
rdp.cur_image = 0; rdp.cur_image = 0;
@ -549,7 +549,7 @@ int CopyDepthBuffer()
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
WriteTrace(TraceRDP, TraceDebug, "CopyDepthBuffer draw, OK"); WriteTrace(TraceRDP, TraceDebug, "CopyDepthBuffer draw, OK");
rdp.tbuff_tex = 0; rdp.tbuff_tex = 0;
return TRUE; return TRUE;
@ -624,7 +624,7 @@ int SwapTextureBuffer()
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE; rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
{ {
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
} }
WriteTrace(TraceRDP, TraceDebug, "SwapTextureBuffer draw, OK"); WriteTrace(TraceRDP, TraceDebug, "SwapTextureBuffer draw, OK");
return TRUE; return TRUE;

View File

@ -1887,7 +1887,7 @@ void update()
if ((rdp.fog_multiplier > 0) && (bl.c1_m1a == 3 || bl.c1_m2a == 3 || bl.c2_m1a == 3 || bl.c2_m2a == 3)) if ((rdp.fog_multiplier > 0) && (bl.c1_m1a == 3 || bl.c1_m2a == 3 || bl.c2_m1a == 3 || bl.c2_m2a == 3))
{ {
gfxFogColorValue(rdp.fog_color); gfxFogColorValue(rdp.fog_color);
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
rdp.fog_mode = CRDP::fog_enabled; rdp.fog_mode = CRDP::fog_enabled;
WriteTrace(TraceRDP, TraceDebug, "fog enabled "); WriteTrace(TraceRDP, TraceDebug, "fog enabled ");
} }
@ -1895,20 +1895,20 @@ void update()
{ {
WriteTrace(TraceRDP, TraceDebug, "fog disabled in blender"); WriteTrace(TraceRDP, TraceDebug, "fog disabled in blender");
rdp.fog_mode = CRDP::fog_disabled; rdp.fog_mode = CRDP::fog_disabled;
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
} }
} }
else if (blender == 0xc410 || blender == 0xc411 || blender == 0xf500) else if (blender == 0xc410 || blender == 0xc411 || blender == 0xf500)
{ {
gfxFogColorValue(rdp.fog_color); gfxFogColorValue(rdp.fog_color);
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
rdp.fog_mode = CRDP::fog_blend; rdp.fog_mode = CRDP::fog_blend;
WriteTrace(TraceRDP, TraceDebug, "fog blend "); WriteTrace(TraceRDP, TraceDebug, "fog blend ");
} }
else if (blender == 0x04d1) else if (blender == 0x04d1)
{ {
gfxFogColorValue(rdp.fog_color); gfxFogColorValue(rdp.fog_color);
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
rdp.fog_mode = CRDP::fog_blend_inverse; rdp.fog_mode = CRDP::fog_blend_inverse;
WriteTrace(TraceRDP, TraceDebug, "fog blend "); WriteTrace(TraceRDP, TraceDebug, "fog blend ");
} }
@ -1916,7 +1916,7 @@ void update()
{ {
WriteTrace(TraceRDP, TraceDebug, "fog disabled"); WriteTrace(TraceRDP, TraceDebug, "fog disabled");
rdp.fog_mode = CRDP::fog_disabled; rdp.fog_mode = CRDP::fog_disabled;
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
} }
} }
@ -1985,5 +1985,5 @@ void set_message_combiner()
voodoo.tex_min_addr[GFX_TMU0] + offset_font, voodoo.tex_min_addr[GFX_TMU0] + offset_font,
GR_MIPMAPLEVELMASK_BOTH, GR_MIPMAPLEVELMASK_BOTH,
&fontTex); &fontTex);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
} }

View File

@ -1570,7 +1570,7 @@ void rdp_texrect()
{ {
vptr[i].f = fog; vptr[i].f = fog;
} }
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
} }
ConvertCoordsConvert(vptr, n_vertices); ConvertCoordsConvert(vptr, n_vertices);
@ -2471,7 +2471,7 @@ void rdp_fillrect()
WriteTrace(TraceRDP, TraceDebug, " - %d, %d, %d, %d", s_ul_x, s_ul_y, s_lr_x, s_lr_y); WriteTrace(TraceRDP, TraceDebug, " - %d, %d, %d, %d", s_ul_x, s_ul_y, s_lr_x, s_lr_y);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
const float Z = (rdp.cycle_mode == 3) ? 0.0f : set_sprite_combine_mode(); const float Z = (rdp.cycle_mode == 3) ? 0.0f : set_sprite_combine_mode();
@ -2520,7 +2520,7 @@ void rdp_fillrect()
gfxStippleMode(GR_STIPPLE_DISABLE); gfxStippleMode(GR_STIPPLE_DISABLE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
gfxDepthBufferFunction(GFX_CMP_ALWAYS); gfxDepthBufferFunction(GFX_CMP_ALWAYS);
gfxDepthMask(FXFALSE); gfxDepthMask(FXFALSE);

View File

@ -67,7 +67,7 @@ float set_sprite_combine_mode()
} }
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GFX_FOG_DISABLE);
rdp.update |= UPDATE_CULL_MODE | UPDATE_FOG_ENABLED; rdp.update |= UPDATE_CULL_MODE | UPDATE_FOG_ENABLED;
if (rdp.cycle_mode == 2) if (rdp.cycle_mode == 2)
@ -908,7 +908,7 @@ static void uc6_draw_polygons(VERTEX v[4])
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
{ {
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
} }
} }
@ -1617,7 +1617,7 @@ void uc6_sprite2d()
if (g_settings->fog() && (rdp.flags & FOG_ENABLED)) if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
{ {
gfxFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); gfxFogMode(GFX_FOG_WITH_TABLE_ON_FOGCOORD_EXT);
} }
} }
a = rdp.pc[rdp.pc_i] & BMASK; a = rdp.pc[rdp.pc_i] & BMASK;