forked from Ports/perfect_dark
port: generalize the texture font filter a bit
now called TextureFilter2D; although for now I couldn't find anything other than fonts to use it on
This commit is contained in:
1 parent
18b467a4d8
commit
07c3a513ef
6 files changed
+22
-11
No files matched your search
@@ -19,7 +19,7 @@ s32 videoGetNativeHeight(void);
|
||||
s32 videoGetWidth(void);
|
||||
s32 videoGetHeight(void);
|
||||
f32 videoGetAspect(void);
|
||||
u32 videoGetFontTextureFilter(void);
|
||||
u32 videoGetTextureFilter2D(void);
|
||||
|
||||
s32 videoCreateFramebuffer(u32 w, u32 h);
|
||||
void videoSetFramebuffer(s32 target);
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ static u32 dlcount = 0;
|
||||
static u32 frames = 0;
|
||||
static u32 framesPerSec = 0;
|
||||
static f64 startTime, endTime, fpsTime;
|
||||
static u32 fontTextureFilter = 1;
|
||||
static u32 texFilter2D = 1;
|
||||
|
||||
s32 videoInit(void)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ s32 videoInit(void)
|
||||
if (filter > FILTER_THREE_POINT) filter = FILTER_THREE_POINT;
|
||||
renderingAPI->set_texture_filter((enum FilteringMode)filter);
|
||||
|
||||
fontTextureFilter = configGetInt("Video.FontTextureFilter", 1);
|
||||
texFilter2D = configGetIntClamped("Video.TextureFilter2D", 1, 0, 1);
|
||||
|
||||
initDone = true;
|
||||
return 0;
|
||||
@@ -137,9 +137,9 @@ f32 videoGetAspect(void)
|
||||
return gfx_current_dimensions.aspect_ratio;
|
||||
}
|
||||
|
||||
u32 videoGetFontTextureFilter(void)
|
||||
u32 videoGetTextureFilter2D(void)
|
||||
{
|
||||
return fontTextureFilter;
|
||||
return texFilter2D;
|
||||
}
|
||||
|
||||
s32 videoCreateFramebuffer(u32 w, u32 h)
|
||||
|
||||
@@ -394,12 +394,7 @@ Gfx *text0f153628(Gfx *gdl)
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
if (videoGetFontTextureFilter() == 0) {
|
||||
gDPSetTextureFilter(gdl++, G_TF_POINT);
|
||||
}
|
||||
else {
|
||||
gDPSetTextureFilter(gdl++, G_TF_BILERP);
|
||||
}
|
||||
gDPSetTextureFilter(gdl++, TEX_FILTER_2D);
|
||||
}
|
||||
|
||||
return gdl;
|
||||
|
||||
@@ -39,6 +39,9 @@ s32 g_TexLutMode;
|
||||
u32 var800ab5b4;
|
||||
struct tilestate g_TexTileStates[8];
|
||||
struct tilesize g_TexTileSizes[8];
|
||||
#ifndef PLATFORM_N64
|
||||
u32 g_TexFilter2D = G_TF_BILERP;
|
||||
#endif
|
||||
|
||||
// Default
|
||||
u16 g_SurfaceTypeDefaultSounds[] = { SFX_HIT_STONE_8087, SFX_HIT_STONE_8088 };
|
||||
|
||||
@@ -136,6 +136,9 @@ void texReset(void)
|
||||
|
||||
// reset backend texture cache
|
||||
videoResetTextureCache();
|
||||
|
||||
// get backend texture settings
|
||||
g_TexFilter2D = videoGetTextureFilter2D() ? G_TF_BILERP : G_TF_POINT;
|
||||
#endif
|
||||
|
||||
g_TexWords = mempAlloc(ALIGN16(g_TexNumConfigs * 4), MEMPOOL_STAGE);
|
||||
|
||||
@@ -528,12 +528,22 @@ extern struct menudialogdef g_HtDetailsMenuDialog;
|
||||
extern struct menudialogdef g_HtFailedMenuDialog;
|
||||
extern struct menudialogdef g_HtCompletedMenuDialog;
|
||||
extern struct menudialogdef g_HangarListMenuDialog;
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
|
||||
extern f32 g_PlayerCrosshairSway;
|
||||
extern f32 g_PlayerDefaultFovY;
|
||||
extern s32 g_PlayerMouseAimMode;
|
||||
extern f32 g_PlayerMouseAimSpeedX;
|
||||
extern f32 g_PlayerMouseAimSpeedY;
|
||||
extern u32 g_TexFilter2D;
|
||||
|
||||
#define TEX_FILTER_2D g_TexFilter2D
|
||||
|
||||
#else
|
||||
|
||||
#define TEX_FILTER_2D G_TF_BILERP
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user