- renamed WResourceManager::autoResize() to ResetCacheLimits(), since the function doesn't actually resize anything. It's merely setting clamping limits on when we should purge the cache.
- fixed the debug framerate calculation / drawing code (consolidated duplicated functions & variables mDelta vs a win-only mDeltaTime, no reason to have two), repositioned it to draw on the bottom left (it was colliding with other debug text for the cache info). - for debug testing purposes, added a #define override to force the image cache to work with less memory (I've picked 8 megs, which is what the psp seems to use - the normal default on win/linux is 20 megs).
This commit is contained in:
@@ -322,26 +322,9 @@ void JGE::Init()
|
||||
LeftClickedProcessed();
|
||||
}
|
||||
|
||||
void JGE::SetDelta(float delta)
|
||||
{
|
||||
mDeltaTime = delta;
|
||||
}
|
||||
|
||||
float JGE::GetDelta()
|
||||
{
|
||||
return mDeltaTime;
|
||||
}
|
||||
|
||||
float JGE::GetFPS()
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#else ///// PSP specific code
|
||||
|
||||
|
||||
void JGE::Init()
|
||||
{
|
||||
#ifdef DEBUG_PRINT
|
||||
@@ -367,17 +350,6 @@ void JGE::Init()
|
||||
mCriticalAssert = false;
|
||||
}
|
||||
|
||||
float JGE::GetDelta()
|
||||
{
|
||||
return mDelta;
|
||||
}
|
||||
|
||||
|
||||
float JGE::GetFPS()
|
||||
{
|
||||
return 1.0f / mDelta;
|
||||
}
|
||||
|
||||
u8 JGE::GetAnalogX()
|
||||
{
|
||||
return JGEGetAnalogX();
|
||||
@@ -423,7 +395,7 @@ void JGE::Run()
|
||||
{
|
||||
sceRtcGetCurrentTick(&curr);
|
||||
float dt = (curr - lastTime) / (float)gTickFrequency;
|
||||
mDelta = dt;
|
||||
mDeltaTime = dt;
|
||||
sceCtrlPeekBufferPositive(&gCtrlPad, 1);
|
||||
for (signed int i = sizeof(keyCodeList)/sizeof(keyCodeList[0]) - 1; i >= 0; --i)
|
||||
{
|
||||
@@ -468,6 +440,23 @@ int JGE::GetTime()
|
||||
}
|
||||
|
||||
|
||||
void JGE::SetDelta(float delta)
|
||||
{
|
||||
mDeltaTime = delta;
|
||||
}
|
||||
|
||||
|
||||
float JGE::GetDelta()
|
||||
{
|
||||
return mDeltaTime;
|
||||
}
|
||||
|
||||
|
||||
float JGE::GetFPS()
|
||||
{
|
||||
return mDeltaTime > 0 ? 1.0f / mDeltaTime : 0;
|
||||
}
|
||||
|
||||
JGE* JGE::GetInstance()
|
||||
{
|
||||
if (mInstance == NULL) mInstance = new JGE();
|
||||
|
||||
Reference in New Issue
Block a user