fixed anisotropic filtering; updated librw

This commit is contained in:
aap 2021-01-21 22:17:35 +01:00
parent 50cde66067
commit e99589a3eb
5 changed files with 17 additions and 7 deletions

View File

@ -263,6 +263,7 @@ enum Config {
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
#define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync #define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync
#define ANISOTROPIC_FILTERING // set all textures to max anisotropic filtering
//#define USE_TEXTURE_POOL //#define USE_TEXTURE_POOL
#ifdef LIBRW #ifdef LIBRW
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) #define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)

View File

@ -3,7 +3,7 @@
#include "rphanim.h" #include "rphanim.h"
#include "rpskin.h" #include "rpskin.h"
#include "rtbmp.h" #include "rtbmp.h"
#ifndef LIBRW #ifdef ANISOTROPIC_FILTERING
#include "rpanisot.h" #include "rpanisot.h"
#endif #endif
@ -402,7 +402,7 @@ PluginAttach(void)
return FALSE; return FALSE;
} }
#ifndef LIBRW #ifdef ANISOTROPIC_FILTERING
RpAnisotPluginAttach(); RpAnisotPluginAttach();
#endif #endif
#ifdef EXTENDED_PIPELINES #ifdef EXTENDED_PIPELINES

View File

@ -964,3 +964,12 @@ RtCharset *RtCharsetSetColors(RtCharset * charSet, const RwRGBA * foreGround,
RtCharset *RtCharsetGetDesc(RtCharset * charset, RtCharsetDesc * desc) { *desc = charset->desc; return charset; } RtCharset *RtCharsetGetDesc(RtCharset * charset, RtCharsetDesc * desc) { *desc = charset->desc; return charset; }
RtCharset *RtCharsetCreate(const RwRGBA * foreGround, const RwRGBA * backGround) { return Charset::create(foreGround, backGround); } RtCharset *RtCharsetCreate(const RwRGBA * foreGround, const RwRGBA * backGround) { return Charset::create(foreGround, backGround); }
RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return true; } RwBool RtCharsetDestroy(RtCharset * charSet) { charSet->destroy(); return true; }
#include <rpanisot.h>
RwInt8 RpAnisotGetMaxSupportedMaxAnisotropy(void) { return rw::getMaxSupportedMaxAnisotropy(); }
RwTexture *RpAnisotTextureSetMaxAnisotropy(RwTexture *tex, RwInt8 val) { tex->setMaxAnisotropy(val); return tex; }
RwInt8 RpAnisotTextureGetMaxAnisotropy(RwTexture *tex) { return tex->getMaxAnisotropy(); }
RwBool RpAnisotPluginAttach(void) { rw::registerAnisotropyPlugin(); return true; }

View File

@ -5,7 +5,7 @@
#define WITHD3D #define WITHD3D
#endif #endif
#include "common.h" #include "common.h"
#ifndef LIBRW #ifdef ANISOTROPIC_FILTERING
#include "rpanisot.h" #include "rpanisot.h"
#endif #endif
#include "crossplatform.h" #include "crossplatform.h"
@ -58,9 +58,9 @@ RwTextureGtaStreamRead(RwStream *stream)
if(tex == nil) if(tex == nil)
return nil; return nil;
#ifndef LIBRW #ifdef ANISOTROPIC_FILTERING
if(RpAnisotTextureGetMaxAnisotropy(tex) > 1) if(RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense
RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotTextureGetMaxAnisotropy(tex)); RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotGetMaxSupportedMaxAnisotropy());
#endif #endif
return tex; return tex;

2
vendor/librw vendored

@ -1 +1 @@
Subproject commit 9260bddc66f70eb51adf0749fa835fed1562c178 Subproject commit 60a5ace16309ccd3d174a3ec14a1062540934066