* 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

@ -113,9 +113,9 @@ set APP_SRC=%APP%\App.cpp %APP%\Component\ActionButtonComponent.cpp %APP%\Compon
%APP%\GUI\PauseMenu.cpp %APP%\GUI\PopUpMenu.cpp %APP%\GUI\QuickTipMenu.cpp %APP%\GUI\ReadTextMenu.cpp %APP%\GUI\ExpiredMenu.cpp
REM **************************************** END SOURCE
:unused so far: -s USE_GLFW=3 -s NO_EXIT_RUNTIME=1 -s FORCE_ALIGNED_MEMORY=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED
:unused so far: -s USE_GLFW=3 -s NO_EXIT_RUNTIME=1 -s FORCE_ALIGNED_MEMORY=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED -s TOTAL_MEMORY=16MB
:To skip font loading so it needs no resource files or zlib, add -DC_NO_ZLIB
SET CUSTOM_FLAGS= -DHAS_SOCKLEN_T -DBOOST_ALL_NO_LIB -DPLATFORM_HTML5 -DRT_USE_SDL_AUDIO -DRT_JPG_SUPPORT -DC_GL_MODE -s LEGACY_GL_EMULATION=1 -DPLATFORM_HTML5 -s TOTAL_MEMORY=16MB -s ALLOW_MEMORY_GROWTH=1 -Wno-c++11-compat-deprecated-writable-strings --ignore-dynamic-linking --memory-init-file 0 -Wno-switch -s PRECISE_F32=2
SET CUSTOM_FLAGS= -DHAS_SOCKLEN_T -DBOOST_ALL_NO_LIB -DPLATFORM_HTML5 -DRT_USE_SDL_AUDIO -DRT_JPG_SUPPORT -DC_GL_MODE -s LEGACY_GL_EMULATION=1 -DPLATFORM_HTML5 -s ALLOW_MEMORY_GROWTH=1 -Wno-c++11-compat-deprecated-writable-strings --ignore-dynamic-linking --memory-init-file 0 -Wno-switch -s PRECISE_F32=2 -Wno-writable-strings -Wno-shift-negative-value
:unused: -s FULL_ES2=1 --emrun
@ -127,13 +127,14 @@ SET FINAL_EXTENSION=js
SET FINAL_EXTENSION=html
)
:-s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED -s WASM=1
IF %DEBUG% EQU 0 (
echo Compiling in release mode
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -O2 -DNDEBUG
) else (
echo Compiling in debug mode
:removed -s SAFE_HEAP=1 , causes alignment error with FMOD
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -D_DEBUG -s GL_UNSAFE_OPTS=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s EXCEPTION_DEBUG=1 -s DEMANGLE_SUPPORT=1 -s ALIASING_FUNCTION_POINTERS=0 --emrun
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -D_DEBUG -s GL_UNSAFE_OPTS=0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s EXCEPTION_DEBUG=1 -s ASSERTIONS=2 -s DEMANGLE_SUPPORT=1 -s ALIASING_FUNCTION_POINTERS=0 --emrun
)
SET INCLUDE_DIRS=-I%SHARED% -I%APP% -I../../shared/util/boost -I../../shared/ClanLib-2.0/Sources -I../../shared/Network/enet/include ^

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

@ -12864,24 +12864,18 @@ 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,6 +12974,7 @@ void BlitSecondTransitionScreen()
if (g_bTransitionActive)
{
CheckTransitionSurface();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
@ -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
{
@ -13010,12 +13002,15 @@ void BlitSecondTransitionScreen()
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
{

View file

@ -7,7 +7,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>../test_bad_dmoddir_changes.dmod</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
<LocalDebuggerCommandArguments>