Make texture conversion work a bit faster

# Conflicts:
#	src/core/config.h
This commit is contained in:
Sergeanur 2020-11-28 16:29:45 +02:00
parent 16abbad6b2
commit 5a3a058ed3
2 changed files with 17 additions and 0 deletions

View File

@ -240,6 +240,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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
//#define USE_TEXTURE_POOL
//#define CUTSCENE_BORDERS_SWITCH

View File

@ -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;