summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-28 15:29:45 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-28 15:29:45 +0100
commitad48b9cde01522938590aab444bb09275ff5359d (patch)
tree6597afb92a9d03c7d5688cdcd4839c4d935d8fc3
parentAdd multisampling to librw (diff)
downloadre3-ad48b9cde01522938590aab444bb09275ff5359d.tar
re3-ad48b9cde01522938590aab444bb09275ff5359d.tar.gz
re3-ad48b9cde01522938590aab444bb09275ff5359d.tar.bz2
re3-ad48b9cde01522938590aab444bb09275ff5359d.tar.lz
re3-ad48b9cde01522938590aab444bb09275ff5359d.tar.xz
re3-ad48b9cde01522938590aab444bb09275ff5359d.tar.zst
re3-ad48b9cde01522938590aab444bb09275ff5359d.zip
-rw-r--r--src/core/config.h1
-rw-r--r--src/rw/TexRead.cpp16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/config.h b/src/core/config.h
index ead9b787..99c5f6ef 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -233,6 +233,7 @@ enum Config {
#define PS2_ALPHA_TEST // emulate ps2 alpha test
#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 USE_TEXTURE_POOL
#ifdef LIBRW
//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp
index 72d2ae17..7403ae1d 100644
--- a/src/rw/TexRead.cpp
+++ b/src/rw/TexRead.cpp
@@ -18,6 +18,7 @@
#include "Sprite2d.h"
#include "Text.h"
#include "RwHelper.h"
+#include "Frontend.h"
#endif //GTA_PC
float texLoadTime;
@@ -357,6 +358,15 @@ CreateTxdImageForVideoCard()
// so let's hope that is the case for all
rw::gl3::needToReadBackTextures = true;
#endif
+
+#ifdef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
+ // let's disable vsync and frame limiter to speed up texture conversion
+ // (actually we probably don't need to disable frame limiter in here, but let's do it just in case =P)
+ int8 vsyncState = CMenuManager::m_PrefsVsync;
+ int8 frameLimiterState = CMenuManager::m_PrefsFrameLimiter;
+ CMenuManager::m_PrefsVsync = 0;
+ CMenuManager::m_PrefsFrameLimiter = 0;
+#endif
int32 i;
for (i = 0; i < TXDSTORESIZE; i++) {
@@ -411,6 +421,12 @@ CreateTxdImageForVideoCard()
}
}
+#ifdef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
+ // restore vsync and frame limiter states
+ CMenuManager::m_PrefsVsync = vsyncState;
+ CMenuManager::m_PrefsFrameLimiter = frameLimiterState;
+#endif
+
RwStreamClose(img, nil);
delete []buf;