mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-25 09:11:50 +01:00
Added timing to RwTextureGtaStreamRead
This commit is contained in:
parent
b6cb716452
commit
832572664c
@ -1,5 +1,15 @@
|
|||||||
|
#pragma warning( push )
|
||||||
|
#pragma warning( disable : 4005)
|
||||||
|
#define DIRECTINPUT_VERSION 0x0800
|
||||||
|
#include <dinput.h>
|
||||||
|
#pragma warning( pop )
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "win.h"
|
||||||
#include "patcher.h"
|
#include "patcher.h"
|
||||||
|
#include "Timer.h"
|
||||||
|
|
||||||
|
float &texLoadTime = *(float*)0x8F1B50;
|
||||||
|
int32 &texNumLoaded = *(int32*)0x8F252C;
|
||||||
|
|
||||||
RwTexture*
|
RwTexture*
|
||||||
RwTextureGtaStreamRead(RwStream *stream)
|
RwTextureGtaStreamRead(RwStream *stream)
|
||||||
@ -10,11 +20,15 @@ RwTextureGtaStreamRead(RwStream *stream)
|
|||||||
if(!RwStreamFindChunk(stream, rwID_TEXTURENATIVE, &size, &version))
|
if(!RwStreamFindChunk(stream, rwID_TEXTURENATIVE, &size, &version))
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
// TODO: unused timing
|
float preloadTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
|
||||||
|
|
||||||
if(!RWSRCGLOBAL(stdFunc[rwSTANDARDNATIVETEXTUREREAD](stream, &tex, size)))
|
if(!RWSRCGLOBAL(stdFunc[rwSTANDARDNATIVETEXTUREREAD](stream, &tex, size)))
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
|
if (gGameState == GS_INIT_PLAYING_GAME) {
|
||||||
|
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
|
||||||
|
texNumLoaded++;
|
||||||
|
}
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user