Merge pull request #127 from Phnod/font-filtering

port: add a config option to disable texture filtering on fonts
This commit is contained in:
fgsfds authored and GitHub committed 2023-09-03 00:22:06 +02:00
commit 18b467a4d8
3 files changed
+15 -1

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ s32 videoGetNativeHeight(void);
s32 videoGetWidth(void);
s32 videoGetHeight(void);
f32 videoGetAspect(void);
u32 videoGetFontTextureFilter(void);
s32 videoCreateFramebuffer(u32 w, u32 h);
void videoSetFramebuffer(s32 target);
+8
View File
@@ -20,6 +20,7 @@ static u32 dlcount = 0;
static u32 frames = 0;
static u32 framesPerSec = 0;
static f64 startTime, endTime, fpsTime;
static u32 fontTextureFilter = 1;
s32 videoInit(void)
{
@@ -46,6 +47,8 @@ s32 videoInit(void)
if (filter > FILTER_THREE_POINT) filter = FILTER_THREE_POINT;
renderingAPI->set_texture_filter((enum FilteringMode)filter);
fontTextureFilter = configGetInt("Video.FontTextureFilter", 1);
initDone = true;
return 0;
}
@@ -134,6 +137,11 @@ f32 videoGetAspect(void)
return gfx_current_dimensions.aspect_ratio;
}
u32 videoGetFontTextureFilter(void)
{
return fontTextureFilter;
}
s32 videoCreateFramebuffer(u32 w, u32 h)
{
return gfx_create_framebuffer(w, h);
+6 -1
View File
@@ -394,7 +394,12 @@ Gfx *text0f153628(Gfx *gdl)
}
#endif
else {
gDPSetTextureFilter(gdl++, G_TF_BILERP);
if (videoGetFontTextureFilter() == 0) {
gDPSetTextureFilter(gdl++, G_TF_POINT);
}
else {
gDPSetTextureFilter(gdl++, G_TF_BILERP);
}
}
return gdl;