From 0bf781e005bcb8010f670097d0936f04912f2b29 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 18 Sep 2017 01:41:26 +0000 Subject: [PATCH] * (Bugfix) Fixed a script crash. This bug was also in the legacy dink * (Windows) "Tap to continue" is no longer shown when waiting for a keypress, but will still be shown on touch-devices * Fixed bug where any DMOD directory starting with "dink" was ignored from the internal DMOD listing screen. Oops, that was a pretty bad one, sorry dinkcrft. git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1489 353e56fe-9613-0410-8469-b96ad8e6f29c --- script/win_installer/readme.txt | 9 ++++++++- source/App.cpp | 4 ++-- source/GUI/DMODMenu.cpp | 17 +++++++++++++++-- source/GUI/GameMenu.cpp | 7 +++++-- source/dink/dink.cpp | 26 ++++++++++++++++++++++++-- windows_vs2017/winRTDink.vcxproj | 12 +++++++++--- windows_vs2017/winRTDink.vcxproj.user | 2 +- 7 files changed, 64 insertions(+), 13 deletions(-) diff --git a/script/win_installer/readme.txt b/script/win_installer/readme.txt index 92c8589..ac5eadd 100644 --- a/script/win_installer/readme.txt +++ b/script/win_installer/readme.txt @@ -109,4 +109,11 @@ www.rtsoft.com * (Bugfix) Fixed horrible issue where the last line in a script might not get run. This fixed the intro screen to Lost Forest Romp * (Bugfix) Rewrote some nasty code that I could no longer understand, THE LAST QUEST (part 2)'s cool room slide/warp effect now works right * Added "Debug DinkC Toggle" to cheat menu, it shows collision boxes and causes the log (log.txt or choose view log from debug menu) -- Note: Save state format has been changed again, so old save states won't load \ No newline at end of file +* If fullscreen is at a weird size it will now just force it to 1024X768. If that fails, well, it won't be good +- Note: Save state format has been changed again, so old save states won't load + +------ Change log for 1.7.4 ---------- + +* (Bugfix) Fixed a script crash. This bug was also in the legacy dink +* (Windows) "Tap to continue" is no longer shown when waiting for a keypress, but will still be shown on touch-devices +* Fixed bug where any DMOD directory starting with "dink" was ignored from the internal DMOD listing screen. Oops, that was a pretty bad one, sorry dinkcrft. \ No newline at end of file diff --git a/source/App.cpp b/source/App.cpp index c7bfd4b..c23ada2 100644 --- a/source/App.cpp +++ b/source/App.cpp @@ -180,8 +180,8 @@ App::App() m_bDidPostInit = false; m_bHasDMODSupport = true; //for mobiles - m_version = 1.72f; - m_versionString = "V1.7.2"; + m_version = 1.74f; + m_versionString = "V1.7.4"; m_build = 1; m_bCheatsEnabled = false; diff --git a/source/GUI/DMODMenu.cpp b/source/GUI/DMODMenu.cpp index 7355ff7..b65ca72 100644 --- a/source/GUI/DMODMenu.cpp +++ b/source/GUI/DMODMenu.cpp @@ -372,6 +372,18 @@ void GetParsedDMODInfo(string dmodPath, string &nameOut, float versionOut, strin } +bool EndsWith(std::string const &fullString, std::string const &ending) +{ + if (fullString.length() >= ending.length()) + { + return (0 == fullString.compare(fullString.length() - ending.length(), ending.length(), ending)); + } + else + { + return false; + } +} + void DMODMenuAddScrollContent(Entity *pParent) { pParent = pParent->GetEntityByName("scroll_child"); @@ -427,8 +439,9 @@ void DMODMenuAddScrollContent(Entity *pParent) { #ifdef WIN32 - if ( IsInString(files[i], "/audio") || IsInString(files[i],"/dink" )|| IsInString(files[i] ,"/game") || IsInString(files[i],"/interface")) continue; - if (IsInString(files[i] ,"/develop") ) continue; + + if (EndsWith(files[i], "/audio") || EndsWith(files[i],"/dink" )|| EndsWith(files[i] ,"/game") || EndsWith(files[i],"/interface")) continue; + if (EndsWith(files[i] ,"/develop") ) continue; #else if (IsInString(files[i],"/Snapshot") || IsInString(files[i], "/Snapshots")) continue; #endif diff --git a/source/GUI/GameMenu.cpp b/source/GUI/GameMenu.cpp index eab2755..ec53d0f 100644 --- a/source/GUI/GameMenu.cpp +++ b/source/GUI/GameMenu.cpp @@ -537,8 +537,11 @@ void BuildShowingBMPControls(float fadeTimeMS) pButtonEntity->GetFunction("OnOverEnd")->sig_function.connect(&GameOnStopSelect); SetButtonClickSound(pButtonEntity, ""); //no sound - Entity *pLabel = CreateTextLabelEntity(pBG, "label", GetScreenSizeXf()/2, iPhoneMapY(285), "(tap to continue)"); - SetAlignmentEntity(pLabel, ALIGNMENT_CENTER); + if (!IsDesktop()) + { + Entity *pLabel = CreateTextLabelEntity(pBG, "label", GetScreenSizeXf() / 2, iPhoneMapY(285), "(tap to continue)"); + SetAlignmentEntity(pLabel, ALIGNMENT_CENTER); + } } diff --git a/source/dink/dink.cpp b/source/dink/dink.cpp index b23cee3..37a28c3 100644 --- a/source/dink/dink.cpp +++ b/source/dink/dink.cpp @@ -1558,7 +1558,7 @@ bool LoadSpriteSingleFrame(string fNameBase, int seq, int oo, int picIndex, eTra //assert(!g_dglos.g_picInfo[g_cur_sprite].pSurface); SAFE_DELETE(g_pSpriteSurface[picIndex]); #ifdef _DEBUG - if (seq == 471) + if (seq == 60 && oo == 2) { LogMsg("Woah, "); } @@ -1909,7 +1909,7 @@ void ReadFromLoadSequenceString(char ev[15][100] ) strcpy(g_dglos.g_seq[seqID].m_fileName, ev[2]); #ifdef _DEBUG - if (seqID == 423) + if (seqID == 59) { LogMsg("He"); } @@ -3064,6 +3064,22 @@ void kill_script(int k) if (g_script_debug_mode) LogMsg("Killed script %s. (num %d)", g_scriptInstance[k]->name, k); + //tell associated sprite that it no longer has a script + assert(C_MAX_SPRITES_AT_ONCE < 1000 && "I think 1000 has a special meaning so you better not do that? Or was that -1000. I dunno"); +/* + //NOTE: This would fix a bug where a script doesn't properly remove itself from an owner sprite but.. could cause behavior differences so not enabling it for now + if (g_scriptInstance[k]->sprite > 0 && g_scriptInstance[k]->sprite < C_MAX_SPRITES_AT_ONCE) + { + if (g_sprite[g_scriptInstance[k]->sprite].active && g_sprite[g_scriptInstance[k]->sprite].script == k) + { + //um.. guess we should tell the sprite it no longer has an associated script, right?! + g_sprite[g_scriptInstance[k]->sprite].script = 0; + } + + } + */ + g_scriptInstance[k] = NULL; + free(g_scriptInstance[k]); g_scriptInstance[k] = NULL; free(g_scriptBuffer[k]); @@ -9491,6 +9507,12 @@ LogMsg("%d scripts used", g_dglos.g_returnint); LogMsg("Compare sprite script says: Sprite %d has no script.",g_nlist[0]); return(0); } + + if (!g_scriptInstance[g_sprite[g_nlist[0]].script]) + { + LogMsg("Compare sprite script says: Sprite %d says it has script %d, but actually it's null, so no?", g_nlist[0], g_sprite[g_nlist[0]].script); + return(0); + } if (compare(slist[1], g_scriptInstance[g_sprite[g_nlist[0]].script]->name)) { g_dglos.g_returnint = 1; diff --git a/windows_vs2017/winRTDink.vcxproj b/windows_vs2017/winRTDink.vcxproj index 48983e8..b8de760 100644 --- a/windows_vs2017/winRTDink.vcxproj +++ b/windows_vs2017/winRTDink.vcxproj @@ -3674,7 +3674,9 @@ - + + Designer + @@ -3739,8 +3741,12 @@ - - + + Designer + + + Designer + diff --git a/windows_vs2017/winRTDink.vcxproj.user b/windows_vs2017/winRTDink.vcxproj.user index 287c7bd..a0f8d68 100644 --- a/windows_vs2017/winRTDink.vcxproj.user +++ b/windows_vs2017/winRTDink.vcxproj.user @@ -7,6 +7,6 @@ $(ProjectDir) WindowsLocalDebugger - -game dmods/mayhem + -game dmods/dinkcrft \ No newline at end of file