* 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:
parent
2367dc5e3e
commit
838fa92175
8 changed files with 36 additions and 36 deletions
|
@ -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
|
%APP%\GUI\PauseMenu.cpp %APP%\GUI\PopUpMenu.cpp %APP%\GUI\QuickTipMenu.cpp %APP%\GUI\ReadTextMenu.cpp %APP%\GUI\ExpiredMenu.cpp
|
||||||
REM **************************************** END SOURCE
|
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
|
: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
|
:unused: -s FULL_ES2=1 --emrun
|
||||||
|
|
||||||
|
@ -127,13 +127,14 @@ SET FINAL_EXTENSION=js
|
||||||
SET FINAL_EXTENSION=html
|
SET FINAL_EXTENSION=html
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:-s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -DRT_EMTERPRETER_ENABLED -s WASM=1
|
||||||
IF %DEBUG% EQU 0 (
|
IF %DEBUG% EQU 0 (
|
||||||
echo Compiling in release mode
|
echo Compiling in release mode
|
||||||
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -O2 -DNDEBUG
|
SET CUSTOM_FLAGS=%CUSTOM_FLAGS% -O2 -DNDEBUG
|
||||||
) else (
|
) else (
|
||||||
echo Compiling in debug mode
|
echo Compiling in debug mode
|
||||||
:removed -s SAFE_HEAP=1 , causes alignment error with FMOD
|
: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 ^
|
SET INCLUDE_DIRS=-I%SHARED% -I%APP% -I../../shared/util/boost -I../../shared/ClanLib-2.0/Sources -I../../shared/Network/enet/include ^
|
||||||
|
|
|
@ -913,6 +913,11 @@ void App::UpdateVideoSettings()
|
||||||
//SetFPSLimit(v);
|
//SetFPSLimit(v);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void App::SaveSettings()
|
||||||
|
{
|
||||||
|
m_varDB.Save("save.dat");
|
||||||
|
}
|
||||||
|
|
||||||
void App::SaveAllData()
|
void App::SaveAllData()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -924,7 +929,7 @@ void App::SaveAllData()
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetAudioManager()->StopMusic();
|
//GetAudioManager()->StopMusic();
|
||||||
m_varDB.Save("save.dat");
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::OnEnterBackground()
|
void App::OnEnterBackground()
|
||||||
|
|
|
@ -72,6 +72,7 @@ public:
|
||||||
Variant * GetVarWithDefault(const string &varName, const Variant &var) {return m_varDB.GetVarWithDefault(varName, var);}
|
Variant * GetVarWithDefault(const string &varName, const Variant &var) {return m_varDB.GetVarWithDefault(varName, var);}
|
||||||
int GetSpecial();
|
int GetSpecial();
|
||||||
void UpdateVideoSettings();
|
void UpdateVideoSettings();
|
||||||
|
void SaveSettings();
|
||||||
void SetUsingTouchScreen(bool bNew) { m_bUsingTouchScreen = bNew; }
|
void SetUsingTouchScreen(bool bNew) { m_bUsingTouchScreen = bNew; }
|
||||||
bool GetUsingTouchScreen() {return m_bUsingTouchScreen;}
|
bool GetUsingTouchScreen() {return m_bUsingTouchScreen;}
|
||||||
bool CanDownloadDMODS() {return m_bHasDMODSupport;}
|
bool CanDownloadDMODS() {return m_bHasDMODSupport;}
|
||||||
|
|
|
@ -252,7 +252,7 @@ void OnDMODInstallHTTPFinish(VariantList *pVList)
|
||||||
Entity *pMenu = pVList->m_variant[0].GetComponent()->GetParent();
|
Entity *pMenu = pVList->m_variant[0].GetComponent()->GetParent();
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
LogMsg("Finish signal received");
|
LogMsg("Download finished...");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DMODSetTitleLabel(pMenu, string("Installing ")+pMenu->GetVar("originalFileName")->GetString()+"...");
|
DMODSetTitleLabel(pMenu, string("Installing ")+pMenu->GetVar("originalFileName")->GetString()+"...");
|
||||||
|
|
|
@ -15,14 +15,8 @@
|
||||||
#include "Entity/ArcadeInputComponent.h"
|
#include "Entity/ArcadeInputComponent.h"
|
||||||
#include "Renderer/SoftSurface.h"
|
#include "Renderer/SoftSurface.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
#define AUTO_SAVE_MS (1000*8)
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define AUTO_SAVE_MS (1000*60*5)
|
#define AUTO_SAVE_MS (1000*60*5)
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void UpdatePauseMenuPosition(Entity *pBG);
|
void UpdatePauseMenuPosition(Entity *pBG);
|
||||||
|
|
||||||
void ShowQuickMessage(string msg)
|
void ShowQuickMessage(string msg)
|
||||||
|
|
|
@ -255,6 +255,7 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
|
||||||
ZoomToPositionEntity(pMenu, CL_Vec2f(GetScreenSizeXf(),0), 500); //slide up
|
ZoomToPositionEntity(pMenu, CL_Vec2f(GetScreenSizeXf(),0), 500); //slide up
|
||||||
KillEntity(pMenu, 500);
|
KillEntity(pMenu, 500);
|
||||||
AddFocusIfNeeded(pMenu->GetParent(), true, 500);
|
AddFocusIfNeeded(pMenu->GetParent(), true, 500);
|
||||||
|
GetApp()->SaveSettings();
|
||||||
SyncPersistentData();
|
SyncPersistentData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12863,25 +12863,19 @@ void StartScreenScrollTransition(int direction)
|
||||||
|
|
||||||
CheckTransitionSurface();
|
CheckTransitionSurface();
|
||||||
//remember this for later
|
//remember this for later
|
||||||
|
|
||||||
|
|
||||||
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
|
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
|
||||||
{
|
{
|
||||||
//no_transition = true;
|
//no_transition = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//remove the aspect ratio hack
|
//remove the aspect ratio hack
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
//g_transitionSurf.InitBlankSurface(GetPrimaryGLX(), GetPrimaryGLY());
|
|
||||||
|
|
||||||
UpdateFrameWithoutTransitionAndThinking();
|
UpdateFrameWithoutTransitionAndThinking();
|
||||||
|
|
||||||
|
|
||||||
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
|
if (GetApp()->GetVar("disable_glread")->GetUINT32() == 1)
|
||||||
{
|
{
|
||||||
g_transitionSurf.FillColor(glColorBytes(0, 0, 0, 255));
|
g_transitionSurf.FillColor(glColorBytes(0, 0, 0, 255));
|
||||||
|
@ -12890,6 +12884,7 @@ void StartScreenScrollTransition(int direction)
|
||||||
{
|
{
|
||||||
g_transitionSurf.CopyFromScreen();
|
g_transitionSurf.CopyFromScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplyAspectRatioGLMatrix();
|
ApplyAspectRatioGLMatrix();
|
||||||
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
|
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
|
||||||
{
|
{
|
||||||
|
@ -12946,8 +12941,6 @@ void ProcessTransition(void)
|
||||||
|
|
||||||
float inverseProg = 1.0f - g_dglo.m_transitionProgress;
|
float inverseProg = 1.0f - g_dglo.m_transitionProgress;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (g_dglo.m_transitionProgress >= 1)
|
if (g_dglo.m_transitionProgress >= 1)
|
||||||
{
|
{
|
||||||
g_bTransitionActive = false;
|
g_bTransitionActive = false;
|
||||||
|
@ -12961,7 +12954,6 @@ void ProcessTransition(void)
|
||||||
float fTemp = inverseProg;
|
float fTemp = inverseProg;
|
||||||
//fTemp = 1.0f;
|
//fTemp = 1.0f;
|
||||||
glTranslatef((g_dglo.m_transitionOffset.x*fTemp),(g_dglo.m_transitionOffset.y*fTemp), 0);
|
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);
|
//glScalef(G_TRANSITION_SCALE_TRICK,G_TRANSITION_SCALE_TRICK,1);
|
||||||
|
|
||||||
|
|
||||||
|
@ -12982,15 +12974,16 @@ void BlitSecondTransitionScreen()
|
||||||
|
|
||||||
if (g_bTransitionActive)
|
if (g_bTransitionActive)
|
||||||
{
|
{
|
||||||
|
|
||||||
CheckTransitionSurface();
|
CheckTransitionSurface();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
float offsetX = g_dglo.m_centeringOffset.x*(1.0f - ((float)GetFakePrimaryScreenSizeX() / (float)C_DINK_SCREENSIZE_X));
|
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));
|
float offsetY = g_dglo.m_centeringOffset.y*(1.0f - ((float)GetFakePrimaryScreenSizeY() / (float)C_DINK_SCREENSIZE_Y));
|
||||||
|
|
||||||
glTranslatef(-offsetX, -offsetY, 0);
|
glTranslatef(-offsetX, -offsetY, 0);
|
||||||
|
|
||||||
rtRectf dstRect = g_dglo.m_nativeGameArea;
|
rtRectf dstRect = g_dglo.m_nativeGameArea;
|
||||||
|
|
||||||
static rtRectf dstOffset;
|
static rtRectf dstOffset;
|
||||||
|
@ -13001,7 +12994,6 @@ void BlitSecondTransitionScreen()
|
||||||
//fix black lines due to antialiasing
|
//fix black lines due to antialiasing
|
||||||
dstOffset = rtRectf(-1, -1, 1, 1);
|
dstOffset = rtRectf(-1, -1, 1, 1);
|
||||||
srcOffset = rtRectf(1, 1, -1, -1);
|
srcOffset = rtRectf(1, 1, -1, -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -13009,13 +13001,16 @@ void BlitSecondTransitionScreen()
|
||||||
dstOffset = rtRectf(-0.05, -0.05f, 0.05f, 0.05);
|
dstOffset = rtRectf(-0.05, -0.05f, 0.05f, 0.05);
|
||||||
srcOffset = rtRectf(0.4, 0.4, -0.4, -0.4);
|
srcOffset = rtRectf(0.4, 0.4, -0.4, -0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
dstRect.AdjustPosition( ( -g_dglo.m_transitionOffsetNative.x*g_dglo.m_transitionProgress),
|
dstRect.AdjustPosition((-g_dglo.m_transitionOffsetNative.x*g_dglo.m_transitionProgress),
|
||||||
( -g_dglo.m_transitionOffsetNative.y*g_dglo.m_transitionProgress));
|
(-g_dglo.m_transitionOffsetNative.y*g_dglo.m_transitionProgress));
|
||||||
|
|
||||||
|
|
||||||
rtRectf srcRect = ConvertFakeScreenRectToReal(g_dglo.m_nativeGameArea);
|
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);
|
g_transitionSurf.BlitEx(dstRect+dstOffset, srcRect+ srcOffset);
|
||||||
|
|
||||||
|
|
||||||
|
@ -17097,7 +17092,7 @@ void DinkGlobals::SetView( eView view )
|
||||||
RecomputeAspectRatio();
|
RecomputeAspectRatio();
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17921,7 +17916,6 @@ void RecomputeAspectRatio()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float aspect_r = (float)GetPrimaryGLX() / (float)GetPrimaryGLY(); // aspect ratio
|
float aspect_r = (float)GetPrimaryGLX() / (float)GetPrimaryGLY(); // aspect ratio
|
||||||
|
|
||||||
const float correctAspectRatio = (float)C_DINK_SCREENSIZE_X / (float)C_DINK_SCREENSIZE_Y;
|
const float correctAspectRatio = (float)C_DINK_SCREENSIZE_X / (float)C_DINK_SCREENSIZE_Y;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -17958,7 +17952,6 @@ void DinkReInitSurfacesAfterVideoChange()
|
||||||
{
|
{
|
||||||
g_transitionSurf.HardKill();
|
g_transitionSurf.HardKill();
|
||||||
//CheckTransitionSurface();
|
//CheckTransitionSurface();
|
||||||
|
|
||||||
bool bHighColor = false;
|
bool bHighColor = false;
|
||||||
if (lpDDSBackGround && lpDDSBackGround->m_pSurf && lpDDSBackGround->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
|
if (lpDDSBackGround && lpDDSBackGround->m_pSurf && lpDDSBackGround->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
|
||||||
bHighColor = true;
|
bHighColor = true;
|
||||||
|
@ -17971,6 +17964,8 @@ void DinkReInitSurfacesAfterVideoChange()
|
||||||
lpDDSBackGround->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
|
lpDDSBackGround->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
|
||||||
|
|
||||||
g_onePixelSurf.HardKill();
|
g_onePixelSurf.HardKill();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RecomputeAspectRatio();
|
RecomputeAspectRatio();
|
||||||
|
@ -17987,7 +17982,9 @@ void DinkOnForeground()
|
||||||
//force reinit on windows even if using iphone or android mode
|
//force reinit on windows even if using iphone or android mode
|
||||||
bForceReinit = true;
|
bForceReinit = true;
|
||||||
#endif
|
#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
|
if (IsDesktop() || GetEmulatedPlatformID() == PLATFORM_ID_ANDROID || bForceReinit) //xoom needs this too after a suspend/resume from hitting the power button
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
|
||||||
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
<LocalDebuggerCommandArguments>../test_bad_dmoddir_changes.dmod</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>
|
||||||
|
</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
|
||||||
<LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue