diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index 2dea868a2..01d110d34 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -49,8 +49,8 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu int filter = (rdp.filter_mode != 2) ? GR_TEXTUREFILTER_POINT_SAMPLED : GR_TEXTUREFILTER_BILINEAR; gfxTexFilterMode(tmu, filter, filter); gfxTexClampMode(tmu, - GR_TEXTURECLAMP_CLAMP, - GR_TEXTURECLAMP_CLAMP); + GFX_TEXTURECLAMP_CLAMP, + GFX_TEXTURECLAMP_CLAMP); // gfxConstantColorValue (0xFFFFFFFF); gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER, GFX_COMBINE_FACTOR_ONE, diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index a89c8511a..ded8c6f4b 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -550,8 +550,8 @@ int InitGfx() gfxDepthMask(FXFALSE); gfxTexFilterMode(GFX_TMU0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); gfxTexFilterMode(GFX_TMU1, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); - gfxTexClampMode(GFX_TMU0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP); - gfxTexClampMode(GFX_TMU1, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP); + gfxTexClampMode(GFX_TMU0, GFX_TEXTURECLAMP_CLAMP, GFX_TEXTURECLAMP_CLAMP); + gfxTexClampMode(GFX_TMU1, GFX_TEXTURECLAMP_CLAMP, GFX_TEXTURECLAMP_CLAMP); gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; diff --git a/Source/Project64-video/Renderer/OGLEStextures.cpp b/Source/Project64-video/Renderer/OGLEStextures.cpp index c999612ec..14ba083ab 100644 --- a/Source/Project64-video/Renderer/OGLEStextures.cpp +++ b/Source/Project64-video/Renderer/OGLEStextures.cpp @@ -742,20 +742,20 @@ void gfxTexFilterMode(gfxChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrT } } -void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode) +void gfxTexClampMode(gfxChipID_t tmu, gfxTextureClampMode_t s_clampmode, gfxTextureClampMode_t t_clampmode) { WriteTrace(TraceGlitch, TraceDebug, "tmu = %d, s_clampmode: %d t_clampmode: %d", tmu, s_clampmode, t_clampmode); if (tmu == GFX_TMU1) { switch (s_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_s0 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_s0 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_s0 = GL_MIRRORED_REPEAT; break; default: @@ -763,13 +763,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur } switch (t_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_t0 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_t0 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_t0 = GL_MIRRORED_REPEAT; break; default: @@ -783,13 +783,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur { switch (s_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_s1 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_s1 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_s1 = GL_MIRRORED_REPEAT; break; default: @@ -797,13 +797,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur } switch (t_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_t1 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_t1 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_t1 = GL_MIRRORED_REPEAT; break; default: diff --git a/Source/Project64-video/Renderer/OGLtextures.cpp b/Source/Project64-video/Renderer/OGLtextures.cpp index 386fc7d2e..8e63ecefa 100644 --- a/Source/Project64-video/Renderer/OGLtextures.cpp +++ b/Source/Project64-video/Renderer/OGLtextures.cpp @@ -742,7 +742,7 @@ void gfxTexFilterMode(gfxChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrT grDisplayGLError("gfxTexFilterMode"); } -void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode) +void gfxTexClampMode(gfxChipID_t tmu, gfxTextureClampMode_t s_clampmode, gfxTextureClampMode_t t_clampmode) { WriteTrace(TraceGlitch, TraceDebug, "tmu = %d, s_clampmode: %d t_clampmode: %d", tmu, s_clampmode, t_clampmode); if (tmu == GFX_TMU1 || nbTextureUnits <= 2) @@ -750,13 +750,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur if (tmu == GFX_TMU1 && nbTextureUnits <= 2) return; switch (s_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_s0 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_s0 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_s0 = GL_MIRRORED_REPEAT_ARB; break; default: @@ -764,13 +764,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur } switch (t_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_t0 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_t0 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_t0 = GL_MIRRORED_REPEAT_ARB; break; default: @@ -784,13 +784,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur { switch (s_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_s1 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_s1 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_s1 = GL_MIRRORED_REPEAT_ARB; break; default: @@ -798,13 +798,13 @@ void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextur } switch (t_clampmode) { - case GR_TEXTURECLAMP_WRAP: + case GFX_TEXTURECLAMP_WRAP: wrap_t1 = GL_REPEAT; break; - case GR_TEXTURECLAMP_CLAMP: + case GFX_TEXTURECLAMP_CLAMP: wrap_t1 = GL_CLAMP_TO_EDGE; break; - case GR_TEXTURECLAMP_MIRROR_EXT: + case GFX_TEXTURECLAMP_MIRROR_EXT: wrap_t1 = GL_MIRRORED_REPEAT_ARB; break; default: diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 40c0dc7fa..31dfd66ca 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -68,7 +68,7 @@ void gfxGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB); void gfxTexDownloadMipMap(gfxChipID_t tmu, uint32_t startAddress, uint32_t evenOdd, gfxTexInfo *info); void gfxTexSource(gfxChipID_t tmu, uint32_t startAddress, uint32_t evenOdd, gfxTexInfo *info); void gfxTexDetailControl(gfxChipID_t tmu, int lod_bias, FxU8 detail_scale, float detail_max); -void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode); +void gfxTexClampMode(gfxChipID_t tmu, gfxTextureClampMode_t s_clampmode, gfxTextureClampMode_t t_clampmode); void gfxTexFilterMode(gfxChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrTextureFilterMode_t magfilter_mode); extern uint32_t nbTextureUnits; diff --git a/Source/Project64-video/Renderer/types.h b/Source/Project64-video/Renderer/types.h index d1ae5f3c7..6188cab5d 100644 --- a/Source/Project64-video/Renderer/types.h +++ b/Source/Project64-video/Renderer/types.h @@ -299,6 +299,13 @@ enum gfxOriginLocation_t GFX_ORIGIN_ANY = 0xFF, }; +enum gfxTextureClampMode_t +{ + GFX_TEXTURECLAMP_WRAP = 0x0, + GFX_TEXTURECLAMP_CLAMP = 0x1, + GFX_TEXTURECLAMP_MIRROR_EXT = 0x2, +}; + enum gfxLfbSrcFmt_t { GFX_LFB_SRC_FMT_565 = 0x00, diff --git a/Source/Project64-video/TexCache.cpp b/Source/Project64-video/TexCache.cpp index 5719642b2..364d8adfd 100644 --- a/Source/Project64-video/TexCache.cpp +++ b/Source/Project64-video/TexCache.cpp @@ -826,7 +826,7 @@ void TexCache() if (rdp.cur_cache[i]) { - uint32_t mode_s, mode_t; + gfxTextureClampMode_t mode_s, mode_t; int clamp_s, clamp_t; if (rdp.force_wrap && !rdp.texrecting) { @@ -842,31 +842,31 @@ void TexCache() } if (rdp.cur_cache[i]->f_mirror_s) - mode_s = GR_TEXTURECLAMP_MIRROR_EXT; + mode_s = GFX_TEXTURECLAMP_MIRROR_EXT; else if (rdp.cur_cache[i]->f_wrap_s) - mode_s = GR_TEXTURECLAMP_WRAP; + mode_s = GFX_TEXTURECLAMP_WRAP; else if (clamp_s) - mode_s = GR_TEXTURECLAMP_CLAMP; + mode_s = GFX_TEXTURECLAMP_CLAMP; else { if (rdp.tiles(tile).mirror_s && voodoo.sup_mirroring) - mode_s = GR_TEXTURECLAMP_MIRROR_EXT; + mode_s = GFX_TEXTURECLAMP_MIRROR_EXT; else - mode_s = GR_TEXTURECLAMP_WRAP; + mode_s = GFX_TEXTURECLAMP_WRAP; } if (rdp.cur_cache[i]->f_mirror_t) - mode_t = GR_TEXTURECLAMP_MIRROR_EXT; + mode_t = GFX_TEXTURECLAMP_MIRROR_EXT; else if (rdp.cur_cache[i]->f_wrap_t) - mode_t = GR_TEXTURECLAMP_WRAP; + mode_t = GFX_TEXTURECLAMP_WRAP; else if (clamp_t) - mode_t = GR_TEXTURECLAMP_CLAMP; + mode_t = GFX_TEXTURECLAMP_CLAMP; else { if (rdp.tiles(tile).mirror_t && voodoo.sup_mirroring) - mode_t = GR_TEXTURECLAMP_MIRROR_EXT; + mode_t = GFX_TEXTURECLAMP_MIRROR_EXT; else - mode_t = GR_TEXTURECLAMP_WRAP; + mode_t = GFX_TEXTURECLAMP_WRAP; } gfxTexClampMode(tmu, @@ -1677,4 +1677,4 @@ void LoadTex(int id, gfxChipID_t tmu) gfxTexSource(tmu, tex_addr, GR_MIPMAPLEVELMASK_BOTH, t_info); } WriteTrace(TraceRDP, TraceDebug, " | | +- LoadTex end"); -} +} \ No newline at end of file