* Options now correctly save when exitting the menu in html5

* Debug builds no longer quick save ever 5 seconds


git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1623 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2018-06-09 04:26:02 +00:00
parent 2367dc5e3e
commit 838fa92175
8 changed files with 36 additions and 36 deletions

View file

@ -913,6 +913,11 @@ void App::UpdateVideoSettings()
//SetFPSLimit(v);
};
void App::SaveSettings()
{
m_varDB.Save("save.dat");
}
void App::SaveAllData()
{
@ -924,7 +929,7 @@ void App::SaveAllData()
}
//GetAudioManager()->StopMusic();
m_varDB.Save("save.dat");
SaveSettings();
}
void App::OnEnterBackground()

View file

@ -72,6 +72,7 @@ public:
Variant * GetVarWithDefault(const string &varName, const Variant &var) {return m_varDB.GetVarWithDefault(varName, var);}
int GetSpecial();
void UpdateVideoSettings();
void SaveSettings();
void SetUsingTouchScreen(bool bNew) { m_bUsingTouchScreen = bNew; }
bool GetUsingTouchScreen() {return m_bUsingTouchScreen;}
bool CanDownloadDMODS() {return m_bHasDMODSupport;}

View file

@ -252,7 +252,7 @@ void OnDMODInstallHTTPFinish(VariantList *pVList)
Entity *pMenu = pVList->m_variant[0].GetComponent()->GetParent();
#ifdef _DEBUG
LogMsg("Finish signal received");
LogMsg("Download finished...");
#endif
DMODSetTitleLabel(pMenu, string("Installing ")+pMenu->GetVar("originalFileName")->GetString()+"...");

View file

@ -15,14 +15,8 @@
#include "Entity/ArcadeInputComponent.h"
#include "Renderer/SoftSurface.h"
#ifdef _DEBUG
#define AUTO_SAVE_MS (1000*8)
#else
#define AUTO_SAVE_MS (1000*60*5)
#endif
void UpdatePauseMenuPosition(Entity *pBG);
void ShowQuickMessage(string msg)

View file

@ -255,6 +255,7 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
ZoomToPositionEntity(pMenu, CL_Vec2f(GetScreenSizeXf(),0), 500); //slide up
KillEntity(pMenu, 500);
AddFocusIfNeeded(pMenu->GetParent(), true, 500);
GetApp()->SaveSettings();
SyncPersistentData();
}

View file

@ -12863,25 +12863,19 @@ void StartScreenScrollTransition(int direction)
CheckTransitionSurface();
//remember this for later
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
{
//no_transition = true;
return;
}
//remove the aspect ratio hack
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
//g_transitionSurf.InitBlankSurface(GetPrimaryGLX(), GetPrimaryGLY());
UpdateFrameWithoutTransitionAndThinking();
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
{
g_transitionSurf.FillColor(glColorBytes(0, 0, 0, 255));
@ -12890,6 +12884,7 @@ void StartScreenScrollTransition(int direction)
{
g_transitionSurf.CopyFromScreen();
}
ApplyAspectRatioGLMatrix();
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
{
@ -12946,8 +12941,6 @@ void ProcessTransition(void)
float inverseProg = 1.0f - g_dglo.m_transitionProgress;
if (g_dglo.m_transitionProgress >= 1)
{
g_bTransitionActive = false;
@ -12961,7 +12954,6 @@ void ProcessTransition(void)
float fTemp = inverseProg;
//fTemp = 1.0f;
glTranslatef((g_dglo.m_transitionOffset.x*fTemp),(g_dglo.m_transitionOffset.y*fTemp), 0);
//LogMsg("Trans: %.2f", g_dglo.m_transitionProgress);
//glScalef(G_TRANSITION_SCALE_TRICK,G_TRANSITION_SCALE_TRICK,1);
@ -12982,15 +12974,16 @@ void BlitSecondTransitionScreen()
if (g_bTransitionActive)
{
CheckTransitionSurface();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
float offsetX = g_dglo.m_centeringOffset.x*(1.0f - ((float)GetFakePrimaryScreenSizeX() / (float)C_DINK_SCREENSIZE_X));
float offsetY = g_dglo.m_centeringOffset.y*(1.0f - ((float)GetFakePrimaryScreenSizeY() / (float)C_DINK_SCREENSIZE_Y));
glTranslatef(-offsetX, -offsetY, 0);
rtRectf dstRect = g_dglo.m_nativeGameArea;
static rtRectf dstOffset;
@ -13001,7 +12994,6 @@ void BlitSecondTransitionScreen()
//fix black lines due to antialiasing
dstOffset = rtRectf(-1, -1, 1, 1);
srcOffset = rtRectf(1, 1, -1, -1);
}
else
{
@ -13009,13 +13001,16 @@ void BlitSecondTransitionScreen()
dstOffset = rtRectf(-0.05, -0.05f, 0.05f, 0.05);
srcOffset = rtRectf(0.4, 0.4, -0.4, -0.4);
}
dstRect.AdjustPosition( ( -g_dglo.m_transitionOffsetNative.x*g_dglo.m_transitionProgress),
( -g_dglo.m_transitionOffsetNative.y*g_dglo.m_transitionProgress));
dstRect.AdjustPosition((-g_dglo.m_transitionOffsetNative.x*g_dglo.m_transitionProgress),
(-g_dglo.m_transitionOffsetNative.y*g_dglo.m_transitionProgress));
rtRectf srcRect = ConvertFakeScreenRectToReal(g_dglo.m_nativeGameArea);
// LogMsg("Dest rect: %s",PrintRect(dstRect));
#ifdef _DEBUG
//LogMsg("Final Trans Src rect: %s", PrintRect(srcRect).c_str());
//LogMsg("Trans Dest rect: %s", PrintRect(dstRect).c_str());
//LogMsg("Trans surf size: %s", PrintRect(g_transitionSurf.GetRectf()).c_str());
#endif
g_transitionSurf.BlitEx(dstRect+dstOffset, srcRect+ srcOffset);
@ -17097,7 +17092,7 @@ void DinkGlobals::SetView( eView view )
RecomputeAspectRatio();
#ifdef _DEBUG
LogMsg("Rect %s AspectX: %.4f, Aspect Y: %.4f", PrintRect(g_dglo.m_nativeGameArea).c_str(), aspect, aspectY);
LogMsg("DinkGlobals::SetView>VIEW_FULL Rect %s AspectX: %.4f, Aspect Y: %.4f", PrintRect(g_dglo.m_nativeGameArea).c_str(), aspect, aspectY);
#endif
}
@ -17921,7 +17916,6 @@ void RecomputeAspectRatio()
else
{
float aspect_r = (float)GetPrimaryGLX() / (float)GetPrimaryGLY(); // aspect ratio
const float correctAspectRatio = (float)C_DINK_SCREENSIZE_X / (float)C_DINK_SCREENSIZE_Y;
/*
@ -17958,7 +17952,6 @@ void DinkReInitSurfacesAfterVideoChange()
{
g_transitionSurf.HardKill();
//CheckTransitionSurface();
bool bHighColor = false;
if (lpDDSBackGround && lpDDSBackGround->m_pSurf && lpDDSBackGround->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
bHighColor = true;
@ -17971,6 +17964,8 @@ void DinkReInitSurfacesAfterVideoChange()
lpDDSBackGround->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
g_onePixelSurf.HardKill();
}
RecomputeAspectRatio();
@ -17987,7 +17982,9 @@ void DinkOnForeground()
//force reinit on windows even if using iphone or android mode
bForceReinit = true;
#endif
#ifdef PLATFORM_HTML5
//bForceReinit = true;
#endif
if (IsDesktop() || GetEmulatedPlatformID() == PLATFORM_ID_ANDROID || bForceReinit) //xoom needs this too after a suspend/resume from hitting the power button
{