summaryrefslogtreecommitdiffstats
path: root/src/rw
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-28 15:29:45 +0100
committerSergeanur <s.anureev@yandex.ua>2020-12-01 02:51:31 +0100
commit5a3a058ed34848ebd44f055d8175c0ba4560f25a (patch)
tree028ad895a8ddd94c1935099954d8e5c296bb801c /src/rw
parentAdd multisampling to librw (diff)
downloadre3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar.gz
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar.bz2
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar.lz
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar.xz
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.tar.zst
re3-5a3a058ed34848ebd44f055d8175c0ba4560f25a.zip
Diffstat (limited to '')
-rw-r--r--src/rw/TexRead.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp
index 069152a2..c5252f77 100644
--- a/src/rw/TexRead.cpp
+++ b/src/rw/TexRead.cpp
@@ -24,6 +24,7 @@
#include "Sprite2d.h"
#include "Text.h"
#include "RwHelper.h"
+#include "Frontend.h"
#endif //GTA_PC
float texLoadTime;
@@ -390,6 +391,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 = FrontEndMenuManager.m_PrefsVsync;
+ int8 frameLimiterState = FrontEndMenuManager.m_PrefsFrameLimiter;
+ FrontEndMenuManager.m_PrefsVsync = 0;
+ FrontEndMenuManager.m_PrefsFrameLimiter = 0;
+#endif
int32 i;
for (i = 0; i < TXDSTORESIZE; i++) {
@@ -444,6 +454,12 @@ CreateTxdImageForVideoCard()
}
}
+#ifdef DISABLE_VSYNC_ON_TEXTURE_CONVERSION
+ // restore vsync and frame limiter states
+ FrontEndMenuManager.m_PrefsVsync = vsyncState;
+ FrontEndMenuManager.m_PrefsFrameLimiter = frameLimiterState;
+#endif
+
RwStreamClose(img, nil);
delete []buf;