summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-21 22:30:20 +0100
committeraap <aap@papnet.eu>2021-01-21 22:30:20 +0100
commitc67273e92a60e50d67d8146f6a150a5b39a2a641 (patch)
tree062bb3b8d9b2ba99e477748aeaf2a1e19c891da0
parentef24783bff1dc74a846966660005cfefe23d48a2 (diff)
fixed anisotropic filtering; updated librw
-rw-r--r--src/core/config.h1
-rw-r--r--src/core/main.cpp8
-rw-r--r--src/fakerw/fake.cpp9
-rw-r--r--src/fakerw/rpanisot.h6
-rw-r--r--src/rw/TexRead.cpp9
m---------vendor/librw0
6 files changed, 32 insertions, 1 deletions
diff --git a/src/core/config.h b/src/core/config.h
index 35130024..e4568306 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -264,6 +264,7 @@ enum Config {
#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_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
#ifdef LIBRW
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 9d8a8e52..239fae7b 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -3,6 +3,9 @@
#include "rphanim.h"
#include "rpskin.h"
#include "rtbmp.h"
+#ifdef ANISOTROPIC_FILTERING
+#include "rpanisot.h"
+#endif
#include "main.h"
#include "CdStream.h"
@@ -432,6 +435,9 @@ PluginAttach(void)
return FALSE;
}
+#ifdef ANISOTROPIC_FILTERING
+ RpAnisotPluginAttach();
+#endif
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeRegister();
#endif
@@ -440,7 +446,7 @@ PluginAttach(void)
}
#ifdef GTA_PS2
-#define NUM_PREALLOC_ATOMICS 3245
+#define NUM_PREALLOC_ATOMICS 32455
#define NUM_PREALLOC_CLUMPS 101
#define NUM_PREALLOC_FRAMES 2821
#define NUM_PREALLOC_GEOMETRIES 1404
diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp
index c1150931..366dcf3e 100644
--- a/src/fakerw/fake.cpp
+++ b/src/fakerw/fake.cpp
@@ -962,3 +962,12 @@ RtCharset *RtCharsetSetColors(RtCharset * charSet, const RwRGBA * foreGround,
RtCharset *RtCharsetGetDesc(RtCharset * charset, RtCharsetDesc * desc) { *desc = charset->desc; return charset; }
RtCharset *RtCharsetCreate(const RwRGBA * foreGround, const RwRGBA * backGround) { return Charset::create(foreGround, backGround); }
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; }
diff --git a/src/fakerw/rpanisot.h b/src/fakerw/rpanisot.h
new file mode 100644
index 00000000..a886512f
--- /dev/null
+++ b/src/fakerw/rpanisot.h
@@ -0,0 +1,6 @@
+#pragma once
+
+RwInt8 RpAnisotGetMaxSupportedMaxAnisotropy(void);
+RwTexture *RpAnisotTextureSetMaxAnisotropy(RwTexture *tex, RwInt8 val);
+RwInt8 RpAnisotTextureGetMaxAnisotropy(RwTexture *tex);
+RwBool RpAnisotPluginAttach(void);
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp
index d0addcca..c009af96 100644
--- a/src/rw/TexRead.cpp
+++ b/src/rw/TexRead.cpp
@@ -2,6 +2,9 @@
#pragma warning( disable : 4005)
#pragma warning( pop )
#include "common.h"
+#ifdef ANISOTROPIC_FILTERING
+#include "rpanisot.h"
+#endif
#include "crossplatform.h"
#include "platform.h"
@@ -48,6 +51,12 @@ RwTextureGtaStreamRead(RwStream *stream)
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
texNumLoaded++;
}
+
+#ifdef ANISOTROPIC_FILTERING
+ if(tex && RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense
+ RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotGetMaxSupportedMaxAnisotropy());
+#endif
+
return tex;
}
diff --git a/vendor/librw b/vendor/librw
-Subproject 9260bddc66f70eb51adf0749fa835fed1562c17
+Subproject 60a5ace16309ccd3d174a3ec14a106254093406