* Changed "FPS lock:" to "Lock to 30 FPS:" in options, makes it more clear it's actually bad to use and not vsync

* (Windows) Handles alt-tab and clicking on a different monitor while in native fullscreen modes better
* Added "Ghost walk toggle" to in-game cheat menu.  Allows you to walk through solid objects and screenlocks
* (DinkC) Added support for Dan's load_tile() command
* Some junk removed from the debug log

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1482 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-09-15 14:10:37 +00:00
parent e0717ae8d1
commit ba5fb5abbf
18 changed files with 665 additions and 603 deletions

View file

@ -80,3 +80,9 @@ www.rtsoft.com
* Added redink1's "soft shadow improvement" patch
* (proton) Fixed issue with blitting alpha things to the background, fixed the soft shadows for things rendered into the background
------ Change log for 1.7.2 ----------
* Changed "FPS lock:" to "Lock to 30 FPS:" in options, makes it more clear it's actually bad to use and not vsync
* (Windows) Handles alt-tab and clicking on a different monitor while in native fullscreen modes better
* Added "Ghost walk toggle" to in-game cheat menu. Allows you to walk through solid objects and screenlocks
* (DinkC) Added support for Dan's load_tile() command

View file

@ -172,7 +172,7 @@ App::App()
{
http://www.rtsoft.com
m_bGhostMode = false;
#ifdef ANDROID_NDK
SetPreferSDCardForStorage(true);
#endif
@ -180,8 +180,8 @@ App::App()
m_bDidPostInit = false;
m_bHasDMODSupport = true;
//for mobiles
m_version = 1.71f;
m_versionString = "V1.7.1";
m_version = 1.72f;
m_versionString = "V1.7.2";
m_build = 1;
m_bCheatsEnabled = false;

View file

@ -83,6 +83,8 @@ public:
void RemoveAndroidKeyboardKeys();
void AddIcadeProvider();
bool GetForceAspectRatio();
bool GetGhostMode() {return m_bGhostMode;}
void SetGhostMode(bool bNew) { m_bGhostMode = bNew; }
private:
@ -93,6 +95,7 @@ private:
int m_special;
bool m_bUsingTouchScreen;
bool m_bForceAspectRatio;
bool m_bGhostMode; //lets dink walk anywhere and ignore screenlocks
void SaveAllData();
void OnPreEnterBackground(VariantList *pVList);

View file

@ -139,7 +139,7 @@ void AboutMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
}
*/
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
void AddBlurb(Entity* pParent, float x, float y, string fileName, string msg)

View file

@ -74,7 +74,7 @@ void BrowseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity s
}
*/
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}

View file

@ -44,7 +44,7 @@ void DMODInstallMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=ent
}
GetEntityRoot()->PrintTreeAsText(); //useful for Loading
//GetEntityRoot()->PrintTreeAsText(); //useful for Loading
}
void DMODInstallUpdateStatus(Entity *pMenu, string msg)

View file

@ -156,7 +156,7 @@ void DMODMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sen
}
*/
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
CL_Vec2f GetDMODBarIconOffset()

View file

@ -3,6 +3,7 @@
#include "Entity/EntityUtils.h"
#include "dink/dink.h"
#include "LogMenu.h"
#include "GameMenu.h"
void DebugMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from
{
@ -80,11 +81,26 @@ void DebugMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
DinkModGold(100);
}
if (pEntClicked->GetName() == "ghost_walk")
{
GetApp()->SetGhostMode(!GetApp()->GetGhostMode());
if (GetApp()->GetGhostMode())
{
ShowQuickMessage("Ghost walk enabled - can walk through hardness and screenlocks");
}
else
{
ShowQuickMessage("Ghost walk disabled");
}
}
if (pEntClicked->GetName() == "empty_cache")
{
DinkUnloadGraphicsCache();
LogMsg("Cache emptied");
}
if (pEntClicked->GetName() == "AddBow")
{
//slide it off the screen and then kill the whole menu tree
@ -92,7 +108,7 @@ void DebugMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
@ -118,6 +134,9 @@ if (GetApp()->GetCheatsEnabled())
pButtonEntity = CreateTextButtonEntity(pBG, "empty_cache", x, y, "Empty graphic cache"); y += ySpacer;
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
pButtonEntity = CreateTextButtonEntity(pBG, "ghost_walk", x, y, "Ghost walk toggle"); y += ySpacer;
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);
}
pButtonEntity = CreateTextButtonEntity(pBG, "log", x, y, "View log"); y += ySpacer;
pButtonEntity->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&DebugMenuOnSelect);

View file

@ -163,7 +163,7 @@ void GameOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent fr
return;
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
void GameOnStopSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent from
@ -203,7 +203,7 @@ void GameOnStopSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sen
return;
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}

View file

@ -42,7 +42,7 @@ void LoadMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sen
}
}
GetEntityRoot()->PrintTreeAsText(); //useful for Loading
//GetEntityRoot()->PrintTreeAsText(); //useful for Loading
}
void SetupLoadButton(Entity *pParent, int x, float *pY, int gameID)

View file

@ -27,7 +27,7 @@ void LogMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity sent
LogEnd(pMenu);
}
GetEntityRoot()->PrintTreeAsText(); //useful for Log
//GetEntityRoot()->PrintTreeAsText(); //useful for Log
}

View file

@ -279,7 +279,7 @@ void OptionsMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
return;
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
@ -479,7 +479,7 @@ void OptionsMenuAddScrollContent(Entity *pParent)
//fps limit
pEnt = CreateTextLabelEntity(pBG, "", startX, y, "FPS lock:");
pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Lock to 30 FPS:");
SetupTextEntity(pEnt,fontID);
offsetX = iPhoneMapX(columnX);
pEnt = CreateTextButtonEntity(pBG, "fps_limit_0", offsetX, y, "On", false);

View file

@ -232,7 +232,7 @@ void PauseMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
}
GetEntityRoot()->PrintTreeAsText(); //useful for Pause
//GetEntityRoot()->PrintTreeAsText(); //useful for Pause
}

View file

@ -138,7 +138,7 @@ void PopUpMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity se
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}
void PopUpCreate(Entity *pEnt, string msg, string url, string button1Action, string button1Label, string button2Action, string button2Label,
@ -247,5 +247,5 @@ void PopUpCreate(Entity *pEnt, string msg, string url, string button1Action, str
}
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}

View file

@ -11,7 +11,7 @@ void QuickTipMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
GetAudioManager()->Play("audio/tip_end.wav");
LogMsg("Clicked %s entity at %s", pEntClicked->GetName().c_str(),pVList->m_variant[1].Print().c_str());
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
Entity *pDarken = GetEntityRoot()->GetEntityByName("pop_up_darken");
FadeScreen(pDarken, 0, 0, 400, true);
KillEntity(pDarken, 400);
@ -114,7 +114,7 @@ Entity * CreateQuickTip(Entity *pParentEnt, string tipFileName, bool bRequireMov
//pButtonEntity = CreateOverlayButtonEntity(pBG, "continue", "interface/quicktips/tip_continue.rttex", 178, 184);
pButtonEntity->GetFunction("OnButtonSelected")->sig_function.connect(&QuickTipMenuOnSelect);
SlideScreen(pBG, true);
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//FadeInEntity(pBG, true, 300);
GetAudioManager()->Play("audio/tip_start.wav");

View file

@ -30,7 +30,7 @@ void ReadTextMenuOnSelect(VariantList *pVList) //0=vec2 point of click, 1=entity
return;
}
GetEntityRoot()->PrintTreeAsText(); //useful for debugging
//GetEntityRoot()->PrintTreeAsText(); //useful for debugging
}

View file

@ -20,6 +20,8 @@ const float SAVE_FORMAT_VERSION = 1.9f;
const int C_DINK_FADE_TIME_MS = 300;
const float G_TRANSITION_SCALE_TRICK = 1.01f;
bool g_forceRebuildBackground = false;
float g_dinkFadeAlpha = 0;
DinkGlobals g_dglo;
@ -528,11 +530,15 @@ byte get_hard(int h,int x1, int y1)
}
if (x1 < 0 || y1 < 0 || x1 > 599 || y1 > 399) return(0);
value = g_dglos.g_hitmap.x[x1].y[y1];
//if (GetApp()->GetGhostMode() && value != 100) return 0; //cheat enabled
return(value);
}
byte get_hard_play(int h,int x1, int y1)
{
int value;
x1 -= 20;
@ -557,6 +563,9 @@ byte get_hard_play(int h,int x1, int y1)
value = 0;
}
}
//if (GetApp()->GetGhostMode() && value != 100) return 0; //cheat enabled
return(value);
}
@ -762,6 +771,11 @@ bool LoadTileScreenIfNeeded(int h, bool &bRequireRebuild)
fName += toString(h)+".bmp";
if (g_dglos.g_playerInfo.tile[h].file[0] != 0)
{
//LogMsg("We should load %s", g_dglos.g_playerInfo.tile[h].file);
fName = ToLowerCaseString(g_dglos.g_playerInfo.tile[h].file);
}
if (g_tileScreens[h])
{
@ -4823,7 +4837,7 @@ void check_midi(void)
bool StopMidi()
{
g_dglo.m_lastMusicPath = "";
LogMsg("Stopping midi");
//LogMsg("Stopping midi");
GetAudioManager()->StopMusic();
// Yahoo!
return true;
@ -6112,6 +6126,12 @@ void BuildScreenBackground( bool bFullRebuild )
int pa, cool;
*pvision = 0;
if (g_forceRebuildBackground)
{
bFullRebuild = true;
g_forceRebuildBackground = false;
}
if (bFullRebuild)
{
#ifdef _DEBUG
@ -9529,8 +9549,16 @@ LogMsg("%d scripts used", g_dglos.g_returnint);
int32 p[20] = {2,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
assert(!"Unsupported");
LogMsg("Command load_tile unsupported");
string fName = ToLowerCaseString(slist[0]);
int tileIndex = g_nlist[1];
//force a reload of this tile screen (Dink loads all graphics "on demand")
SAFE_DELETE(g_tileScreens[tileIndex]); //logically
//remember this change
strncpy(g_dglos.g_playerInfo.tile[tileIndex].file, fName.c_str(), 50); //this 50 is hardcoded in the player data
g_forceRebuildBackground = true;
//BuildScreenBackground(true); //trigger full rebuild, this could be optimized by setting a flag and only doing it once...
}
strcpy(pLineIn, h);
@ -12086,6 +12114,8 @@ int check_if_move_is_legal(int u)
if (u == 1) if (in_this_base(g_sprite[u].seq, g_dglos.mDinkBasePush)) return(0);
if (u == 1) if (!no_cheat) if (debug_mode) return(0);
int hardness = 0;
if (g_sprite[u].moveman > 0)
{
@ -12099,8 +12129,16 @@ int check_if_move_is_legal(int u)
return(0);
}
if (u == 1)
{
//it's dink, should we cheat and walk through stuff?
if (GetApp()->GetGhostMode()) return 0;
}
if (hardness > 0)
{
g_sprite[u].x = g_sprite[u].lpx[i - 1];
g_sprite[u].y = g_sprite[u].lpy[i - 1];
g_sprite[u].moveman = 0;
@ -12116,10 +12154,13 @@ int check_if_move_is_legal(int u)
g_dglos.g_playerInfo.push_timer = g_dglos.g_dinkTick;
}
} else
}
else
{
if (g_dglos.g_playerInfo.push_dir != g_sprite[1].dir) g_dglos.g_playerInfo.push_active = false;
}
return(hardness);
}
}
@ -12478,11 +12519,14 @@ void did_player_cross_screen(bool bCheckWithoutMoving, int playerID)
{
bool move_gonna = false;
bool bNotScreenLocked = (g_dglos.screenlock == 0);
if (GetApp()->GetGhostMode()) bNotScreenLocked = true;
if (g_dglos.walk_off_screen == 1) return;
//DO MATH TO SEE IF THEY HAVE CROSSED THE SCREEN, IF SO LOAD NEW ONE
if ((g_sprite[playerID].x) < g_gameAreaLeftOffset)
{
if ((g_MapInfo.loc[*pmap-1] > 0) && (g_dglos.screenlock == 0) )
if ((g_MapInfo.loc[*pmap-1] > 0) && bNotScreenLocked)
{
//move one map to the left
if (bCheckWithoutMoving)
@ -12508,7 +12552,7 @@ bool move_gonna = false;
if ((g_sprite[playerID].x) > 619)
{
if ((g_MapInfo.loc[*pmap+1] > 0) && (g_dglos.screenlock == 0) )
if ((g_MapInfo.loc[*pmap+1] > 0) && bNotScreenLocked)
{
//move one map to the right
if (bCheckWithoutMoving)
@ -12535,7 +12579,7 @@ bool move_gonna = false;
if (g_sprite[playerID].y < 0)
{
if ((g_MapInfo.loc[*pmap-32] > 0) && (g_dglos.screenlock == 0) )
if ((g_MapInfo.loc[*pmap-32] > 0) && bNotScreenLocked)
{
//move one map up
if (bCheckWithoutMoving)
@ -12562,7 +12606,7 @@ bool move_gonna = false;
if ( (g_sprite[playerID].y > 399 ) )
{
if ( (g_MapInfo.loc[*pmap+32] > 0) && (g_dglos.screenlock == 0) )
if ( (g_MapInfo.loc[*pmap+32] > 0) && bNotScreenLocked)
{
//move one map down
if (bCheckWithoutMoving)
@ -15899,16 +15943,6 @@ LastWindowsTimer = GetTickCount();
if (g_dglos.screenlock == 1)
{
#ifdef _DEBUG
/*
if (debug_mode)
{
//CHEAT - ignore screenlocks
g_dglos.screenlock = 0;
}
*/
#endif
drawscreenlock();
}

View file

@ -386,7 +386,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\source;..\..\shared;..\..\shared\win\;..\..\shared\util\boost;..\..\shared\ClanLib-2.0\Sources;..\..\shared\win\include;..\..\shared\FliteTTS\include;..\..\shared\Irrlicht\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;C_GL_MODE;_HAS_ITERATOR_DEBUGGING=0;_SECURE_SCL=0;_NO_DEBUG_HEAP=1;RT_JPG_SUPPORT;RT_DONT_DO_MOVE_TIMER_TRICK;RT_RUNS_IN_BACKGROUND;RT_IPV6;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;C_GL_MODE;_HAS_ITERATOR_DEBUGGING=0;_SECURE_SCL=0;_NO_DEBUG_HEAP=1;RT_JPG_SUPPORT;RT_DONT_DO_MOVE_TIMER_TRICK;RT_RUNS_IN_BACKGROUND_DISABLED;RT_IPV6;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -431,7 +431,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release GL|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\source;..\..\shared;..\..\shared\win\;..\..\shared\util\boost;..\..\shared\ClanLib-2.0\Sources;..\..\shared\win\include;..\..\shared\FliteTTS\include;..\dxsdk\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;_USE_32BIT_TIME_T;C_GL_MODE;RT_JPG_SUPPORT;RT_DONT_DO_MOVE_TIMER_TRICK;RT_IPV6;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;BOOST_ALL_NO_LIB;_USE_32BIT_TIME_T;C_GL_MODE;RT_JPG_SUPPORT;RT_DONT_DO_MOVE_TIMER_TRICK;RT_IPV6;RT_RUNS_IN_BACKGROUNDD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PlatformPrecomp.h</PrecompiledHeaderFile>