[Glide64] Make stipple_pattern private

This commit is contained in:
zilmar 2017-03-13 07:48:22 +11:00
parent 09504e2244
commit c2bb2c5dac
8 changed files with 20 additions and 54 deletions

View File

@ -277,8 +277,6 @@ extern "C" {
typedef int(*GETTEXADDR)(int tmu, int texsize);
extern GRSTIPPLE grStippleModeExt;
extern GRSTIPPLE grStipplePatternExt;
extern GETTEXADDR GetTexAddr;
#ifndef GR_STIPPLE_DISABLE

View File

@ -216,9 +216,6 @@ void UseUnregisteredSetting(int /*SettingID*/)
}
extern int g_width, g_height;
GRSTIPPLE grStippleModeExt = NULL;
GRSTIPPLE grStipplePatternExt = NULL;
int GetTexAddrUMA(int /*tmu*/, int texsize)
{
int addr = voodoo.tex_min_addr[0] + voodoo.tmem_ptr[0];
@ -456,6 +453,9 @@ void ExitFullScreen(void)
}
#endif
void setPattern();
int InitGfx()
{
if (GfxInitDone)
@ -572,11 +572,8 @@ int InitGfx()
if (strstr(extensions, "GETGAMMA"))
grGet(GR_GAMMA_TABLE_ENTRIES, sizeof(voodoo.gamma_table_size), &voodoo.gamma_table_size);
grStippleModeExt = (GRSTIPPLE)grStippleMode;
grStipplePatternExt = (GRSTIPPLE)grStipplePattern;
if (grStipplePatternExt)
grStipplePatternExt(g_settings->stipple_pattern);
srand(g_settings->stipple_pattern());
setPattern();
InitCombine();

View File

@ -68,7 +68,7 @@ CSettings::CSettings() :
m_decrease_fillrect_edge(false), // sub 1 from lower right corner coordinates of fillrect
m_texture_correction(false), // enable perspective texture correction emulation. is on by default
m_stipple_mode(STIPPLE_Disable), //used for dithered alpha emulation
stipple_pattern(0), //used for dithered alpha emulation
m_stipple_pattern(0), //used for dithered alpha emulation
force_microcheck(0), //check microcode each frame, for mixed F3DEX-S2DEX games
force_quad3d(0), //force 0xb5 command to be quad, not line 3d
clip_zmin(0), //enable near z clipping
@ -722,7 +722,7 @@ void CSettings::ReadGameSettings(const char * name)
g_settings->pal230 = GetSetting(Set_pal230) == 1 ? 1 : 0;
m_stipple_mode = (StippleMode_t)GetSetting(Set_stipple_mode);
int stipple_pattern = GetSetting(Set_stipple_pattern);
g_settings->stipple_pattern = stipple_pattern > 0 ? (uint32_t)stipple_pattern : 0x3E0F83E0;
m_stipple_pattern = stipple_pattern > 0 ? (uint32_t)stipple_pattern : 0x3E0F83E0;
g_settings->force_microcheck = GetSetting(Set_force_microcheck);
g_settings->force_quad3d = GetSetting(Set_force_quad3d);
g_settings->clip_zmin = GetSetting(Set_clip_zmin);

View File

@ -242,7 +242,7 @@ public:
inline bool decrease_fillrect_edge(void) const { return m_decrease_fillrect_edge; }; // sub 1 from lower right corner coordinates of fillrect
inline bool texture_correction(void) const { return m_texture_correction; } // enable perspective texture correction emulation. is on by default
inline StippleMode_t stipple_mode(void) const { return m_stipple_mode; } //used for dithered alpha emulation
uint32_t stipple_pattern; //used for dithered alpha emulation
inline uint32_t stipple_pattern(void) const { return m_stipple_pattern; } //used for dithered alpha emulation
int force_microcheck; //check microcode each frame, for mixed F3DEX-S2DEX games
int force_quad3d; //force 0xb5 command to be quad, not line 3d
int clip_zmin; //enable near z clipping
@ -361,6 +361,7 @@ private:
bool m_decrease_fillrect_edge;
bool m_texture_correction;
StippleMode_t m_stipple_mode;
uint32_t m_stipple_pattern;
hacks_t m_hacks;
};

View File

@ -1876,23 +1876,17 @@ void update()
}
if (rdp.acmp == 3 && rdp.cycle_mode < 2)
{
if (grStippleModeExt != 0)
{
if (g_settings->old_style_adither || rdp.alpha_dither_mode != 3) {
WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither");
grStippleModeExt(g_settings->stipple_mode());
}
else
grStippleModeExt(GR_STIPPLE_DISABLE);
if (g_settings->old_style_adither || rdp.alpha_dither_mode != 3) {
WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither");
grStippleMode(g_settings->stipple_mode());
}
else
grStippleMode(GR_STIPPLE_DISABLE);
}
else
{
if (grStippleModeExt)
{
//WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither disabled");
grStippleModeExt(GR_STIPPLE_DISABLE);
}
//WriteTrace(TraceRDP, TraceDebug, " |- alpha compare: dither disabled");
grStippleMode(GR_STIPPLE_DISABLE);
}
}
// Cull mode (leave this in for z-clipped triangles)
@ -2010,10 +2004,7 @@ void set_message_combiner()
GR_BLEND_ZERO,
GR_BLEND_ZERO);
grAlphaTestFunction(GR_CMP_ALWAYS);
if (grStippleModeExt)
{
grStippleModeExt(GR_STIPPLE_DISABLE);
}
grStippleMode(GR_STIPPLE_DISABLE);
grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
grTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_NONE,

View File

@ -2353,10 +2353,7 @@ static void rdp_fillrect()
grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);
grAlphaTestFunction(GR_CMP_ALWAYS);
if (grStippleModeExt)
{
grStippleModeExt(GR_STIPPLE_DISABLE);
}
grStippleMode(GR_STIPPLE_DISABLE);
grCullMode(GR_CULL_DISABLE);
grFogMode(GR_FOG_DISABLE);

View File

@ -1689,7 +1689,7 @@ grChromakeyValue(GrColor_t value)
g_chroma_color[2], g_chroma_color[3]);
}
static void setPattern()
void setPattern()
{
int i;
GLubyte stip[32 * 4];
@ -1724,15 +1724,6 @@ static void setPattern()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
FX_ENTRY void FX_CALL
grStipplePattern(
GrStipplePattern_t stipple)
{
WriteTrace(TraceResolution, TraceDebug, "value: %x", stipple);
srand(stipple);
setPattern();
}
FX_ENTRY void FX_CALL
grStippleMode(GrStippleMode_t mode)
{

View File

@ -1651,7 +1651,7 @@ grChromakeyValue(GrColor_t value)
grDisplayGLError("grChromakeyValue");
}
static void setPattern()
void setPattern()
{
int i;
GLubyte stip[32 * 4];
@ -1690,15 +1690,6 @@ static void setPattern()
grDisplayGLError("setPattern");
}
FX_ENTRY void FX_CALL
grStipplePattern(
GrStipplePattern_t stipple)
{
WriteTrace(TraceResolution, TraceDebug, "value: %x", stipple);
srand(stipple);
setPattern();
}
FX_ENTRY void FX_CALL
grStippleMode(GrStippleMode_t mode)
{