diff --git a/script/win_installer/readme.txt b/script/win_installer/readme.txt
index 7a374da..2c51f8e 100644
--- a/script/win_installer/readme.txt
+++ b/script/win_installer/readme.txt
@@ -218,5 +218,13 @@ I also added the CD and splash.bmp that were missing
* Default resolution is now 1024X768 fullscreen instead of 640X480
* dmod listing is packed tighter and now sorted alphabetically by dmod name, not directory name
+------ Change log for 1.8.2 ----------
-
+* Changed release compiling a bit to enable C7 compatible debug info, may help with stack traces
+* Oops, turned max sprites back up to 300 from 100, don't ask me how I managed that one
+* (DinkC) A line of over 200 characters won't corrupt memory (new limit is 512) - this fixed a crash in Grasp of Darkness
+* (DinkC) external commands no longer generate bogus errors in the log.txt due to how 1.08 added weird overloading stuff
+* Now shows the dmod's splash.bmp during loading
+* Fixed issue where music might not play on the title screen
+* Raised "memory of dead background sprites" to 300 from 100 for Windows, up to 200 for mobile
+* Doubled memory Dink is allowed to use before uncaching graphics not used recently (could probably be disabled entirely for Windows but whatever)
diff --git a/source/App.cpp b/source/App.cpp
index 98f82a2..134bcd4 100644
--- a/source/App.cpp
+++ b/source/App.cpp
@@ -184,8 +184,8 @@ App::App()
m_bDidPostInit = false;
m_bHasDMODSupport = true;
//for mobiles
- m_version = 1.81f;
- m_versionString = "V1.8.1";
+ m_version = 1.82f;
+ m_versionString = "V1.8.2";
m_build = 1;
m_bCheatsEnabled = false;
diff --git a/source/GUI/GameMenu.cpp b/source/GUI/GameMenu.cpp
index c3749a7..7741940 100644
--- a/source/GUI/GameMenu.cpp
+++ b/source/GUI/GameMenu.cpp
@@ -13,6 +13,7 @@
#include "QuickTipMenu.h"
#include "Entity/SelectButtonWithCustomInputComponent.h"
#include "Entity/ArcadeInputComponent.h"
+#include "Renderer/SoftSurface.h"
#ifdef _DEBUG
#define AUTO_SAVE_MS (1000*8)
@@ -1442,14 +1443,58 @@ Entity * GameCreate(Entity *pParentEnt, int gameIDToLoad, string stateToLoad, st
{
Entity *pBG = pParentEnt->AddEntity(new Entity("GameMenu"));
AddFocusIfNeeded(pBG);
+ Entity *pLoading = CreateOverlayEntity(pBG, "game_loading", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0, 0);
+
- Entity *pLoading = CreateOverlayEntity(pBG, "game_loading", ReplaceWithDeviceNameInFileName("interface/iphone/bkgd_stone.rttex"), 0,0);
+ //setup the splash too
+ string splashBmp;
+ if (!g_dglo.m_dmodGamePathWithDir.empty() && FileExists(g_dglo.m_dmodGamePathWithDir + "tiles\\splash.bmp"))
+ {
+ splashBmp = g_dglo.m_dmodGamePathWithDir + "tiles\\splash.bmp";
+ }
+ else
+ {
+ splashBmp = g_dglo.m_gamePathWithDir + "tiles\\splash.bmp";
+ }
+
+ SoftSurface s8bit;
+ if (!s8bit.LoadFile(splashBmp, SoftSurface::COLOR_KEY_NONE, false))
+ {
+ //give uop
+ }
+ else
+ {
+ //if it was 8bit, this will convert it to 32
+
+ SoftSurface s;
+ s.Init(s8bit.GetWidth(), s8bit.GetHeight(), SoftSurface::SURFACE_RGBA);
+ s.Blit(0, 0, &s8bit);
+ s.FlipY();
+
+ SurfaceAnim *pSurf;
+
+ pSurf = new SurfaceAnim;
+
+ pSurf->SetTextureType(Surface::TYPE_DEFAULT); //insure no mipmaps are created
+ pSurf->InitBlankSurface(s.GetWidth(), s.GetHeight());
+ pSurf->UpdateSurfaceRect(rtRect(0, 0, s.GetWidth(), s.GetHeight()), s.GetPixelData());
+
+ //add the icon
+ Entity *pEnt = CreateOverlayEntity(pLoading, "icon", "", GetScreenSizeXf()/2, GetScreenSizeYf()/2);
+ OverlayRenderComponent *pOverlay = (OverlayRenderComponent*)pEnt->GetComponentByName("OverlayRender");
+ pOverlay->SetSurface(pSurf, true);
+ SetAlignmentEntity(pEnt, ALIGNMENT_CENTER);
+ //EntitySetScaleBySize(pEnt, GetDMODBarIconSize());
+ }
+
+
+ //*********************
if (msgToShow.empty())
{
msgToShow = "Loading...";
}
- Entity *pLabel = CreateTextLabelEntity(pLoading, "load_label", GetScreenSizeXf()/2, GetScreenSizeYf()/2, msgToShow);
+ Entity *pLabel = CreateTextLabelEntity(pLoading, "load_label", GetScreenSizeXf()/2, GetScreenSizeYf()-30, msgToShow);
SetupTextEntity(pLabel, FONT_LARGE);
SetAlignmentEntity(pLabel, ALIGNMENT_CENTER);
pBG->GetFunction("GameLoadPiece")->sig_function.connect(&GameLoadPiece);
@@ -1459,7 +1504,7 @@ Entity * GameCreate(Entity *pParentEnt, int gameIDToLoad, string stateToLoad, st
Entity *pProgressBar = pLoading->AddEntity(new Entity("bar"));
EntityComponent *pBar = pProgressBar->AddComponent(new ProgressBarComponent);
- pProgressBar->GetVar("pos2d")->Set(CL_Vec2f(iPhoneMapX(80),iPhoneMapY(120)));
+ pProgressBar->GetVar("pos2d")->Set(CL_Vec2f(iPhoneMapX(80),iPhoneMapY(280)));
pProgressBar->GetVar("size2d")->Set(CL_Vec2f(iPhoneMapX(310),iPhoneMapY(15)));
pProgressBar->GetVar("color")->Set(MAKE_RGBA(200,200,0,60));
pBar->GetVar("interpolationTimeMS")->Set(uint32(1)); //update faster
diff --git a/source/dink/dink.cpp b/source/dink/dink.cpp
index 377ecf0..dd280d7 100644
--- a/source/dink/dink.cpp
+++ b/source/dink/dink.cpp
@@ -16,7 +16,7 @@ bool pre_figure_out(const char *line, int load_seq, bool bLoadSpriteOnly);
#define C_DINK_SCREEN_TRANSITION_TIME_MS 400
-const float SAVE_FORMAT_VERSION = 2.8f;
+const float SAVE_FORMAT_VERSION = 2.9f;
const int C_DINK_FADE_TIME_MS = 300;
const float G_TRANSITION_SCALE_TRICK = 1.01f;
@@ -31,8 +31,9 @@ DinkGlobalsStatic g_dglos; //static data, made to write/read from disk
int32 g_spriteRank[C_MAX_SPRITES_AT_ONCE];
-int32 C_DINK_MEM_MAX_ALLOWED = (1024*1024*10);
-int32 C_DINK_TEX_MEM_MAX_ALLOWED = (1024*1024*30);
+
+int32 C_DINK_MEM_MAX_ALLOWED = (1024*1024*20);
+int32 C_DINK_TEX_MEM_MAX_ALLOWED = (1024*1024*60);
//avoid texture thrashing with this
int32 C_DINK_MEM_CACHE_MAX_ALLOWED_AFTER_A_DUMP = (1024*1024*8);
@@ -154,7 +155,14 @@ bool check_pic_status(int picID);
bool get_box (int spriteID, rtRect32 * box_crap, rtRect32 * box_real );
void fill_screen(int num);
-#define C_MAX_BACKGROUND_SPRITES_AT_ONCE 100 //too many and it will slow down
+#ifdef WINAPI
+#define C_MAX_BACKGROUND_SPRITES_AT_ONCE 300 //too many and it will slow down
+
+#else
+#define C_MAX_BACKGROUND_SPRITES_AT_ONCE 200 //too many and it will slow down
+
+#endif
+
void BackgroundSpriteManager::Clear()
{
m_sprites.clear();
@@ -3151,7 +3159,7 @@ void kill_script(int k)
}
*/
SAFE_FREE(g_scriptInstance[k]);
- SAFE_DELETE_ARRAY(g_scriptBuffer[k]);
+ SAFE_FREE(g_scriptBuffer[k]);
g_scriptAccelerator[k].Kill();
}
@@ -3362,7 +3370,7 @@ if (g_script_debug_mode)
g_scriptInstance[script]->end = (strlen(pMemBuffer) );
//LogMsg("length of %s is %d!", fileName.c_str(), g_scriptInstance[script]->end);
- g_scriptBuffer[script] = (char *) malloc( g_scriptInstance[script]->end );
+ g_scriptBuffer[script] = (char *) malloc( g_scriptInstance[script]->end+1 );
if (g_scriptBuffer[script] == NULL)
{
@@ -3373,7 +3381,7 @@ if (g_script_debug_mode)
// LogMsg("Copying script");
memcpy(g_scriptBuffer[script], pMemBuffer, g_scriptInstance[script]->end);
-
+ g_scriptBuffer[script][g_scriptInstance[script]->end] = 0; //add a
SAFE_DELETE_ARRAY(pMemBuffer);
@@ -3500,7 +3508,7 @@ bool locate_goto(char proc[50], int script)
return true;
}
- char line[200];
+ char line[512];
// Msg("locate is looking for %s", proc);
@@ -3688,7 +3696,7 @@ bool recurse_var_replace(int i, int script, char* line, char* prevar)
return false;
}
-void decipher_string(char line[200], int script)
+void decipher_string(char line[512], int script)
{
char crap[255];
char buffer[255];
@@ -3888,7 +3896,15 @@ bool get_parms(char proc_name[20], int32 script, char *h, int32 p[10])
} else
{
- LogMsg("Procedure %s does not take %d parms in %s, offset %d. (%s?)", proc_name, i+1, g_scriptInstance[script]->name, g_scriptInstance[script]->current, h);
+ if (strcmp("external", proc_name) != 0)
+ {
+ LogMsg("Procedure %s does not take %d parms in %s, offset %d. (%s?)", proc_name, i + 1, g_scriptInstance[script]->name, g_scriptInstance[script]->current, h);
+ }
+ else
+ {
+ //fake error, external commands always generate this error because of Dan's weird user-function overloading thing
+ return true;
+ }
//set it to zero to be "safe"?
//(p[i]
return(false);
@@ -4011,7 +4027,7 @@ int add_sprite(int x1, int y, int brain,int pseq, int pframe )
}
}
-
+ LogMsg("Out of sprites, can't create!");
return(0);
}
@@ -4152,7 +4168,7 @@ void check_sprite_status_full(int spriteID)
}
-int say_text(char text[200], int h, int script)
+int say_text(char text[512], int h, int script)
{
int crap2;
//Msg("Creating new sprite with %s connect to %d.",text, h);
@@ -4187,7 +4203,7 @@ int say_text(char text[200], int h, int script)
}
-int say_text_xy(char text[200], int mx, int my, int script)
+int say_text_xy(char text[512], int mx, int my, int script)
{
int crap2;
//Msg("Creating new sprite with %s connect to %d.",text, h);
@@ -4523,9 +4539,9 @@ done:
//Msg("word %d of %s is %s.", word, line, crap);
}
-int var_figure(char h[200], int script)
+int var_figure(char h[512], int script)
{
- char crap[200];
+ char crap[512];
int ret = 0;
int n1 = 0, n2 = 0;
//Msg("Figuring out %s...", h);
@@ -4693,7 +4709,7 @@ void kill_returning_stuff( int script)
bool talk_get(int script)
{
- char line[200], check[200], checker[200];
+ char line[512], check[512], checker[512];
int cur = 1;
char *p;
int retnum = 0;
@@ -4960,7 +4976,7 @@ bool StopMidi()
return true;
}
-void get_right(char line[200], char thing[100], char *ret)
+void get_right(char line[512], char thing[100], char *ret)
{
char *dumb;
int pos = strcspn(line, thing );
@@ -5130,7 +5146,7 @@ void draw_sprite_game(LPDIRECTDRAWSURFACE lpdest,int h)
if (g_sprite[h].pseq == 133)
{
- LogMsg("Drawing a wall");
+ //LogMsg("Drawing a wall");
}
#endif
@@ -5603,8 +5619,15 @@ void place_sprites_game(bool bBackgroundOnly )
//bScaledBackgroundSpritesRequired = true;
//continue;
}
+
+ if (g_dglos.g_smallMap.sprite[j].vision != 0)
+ {
+ LogMsg("Found sprite %d with vision %d",
+ j, g_dglos.g_smallMap.sprite[j].vision);
+ }
#endif
+
if (g_dglos.g_smallMap.sprite[j].active == true) if ( ( g_dglos.g_smallMap.sprite[j].vision == 0) || (g_dglos.g_smallMap.sprite[j].vision == *pvision))
{
check_seq_status(g_dglos.g_smallMap.sprite[j].seq, g_dglos.g_smallMap.sprite[j].frame);
@@ -6602,12 +6625,12 @@ int process_line (int script, char *pLineIn, bool doelse)
{
char * h, *p;
int i;
- char line[200];
+ char line[512];
char ev[15][100];
- char temp[255];
+ char temp[512];
char first[2];
int sprite = 0;
-
+ ev[0][0] = 0;
if (g_scriptInstance[script]->level < 1) g_scriptInstance[script]->level = 1;
for (int kk =1; kk < 15; kk++) ev[kk][0] = 0;
@@ -10271,7 +10294,7 @@ LogMsg("%d scripts used", g_dglos.g_returnint);
{
h = &h[strlen(ev[1])];
int32 p[20] = {2,2,1,1,1,1,1,1,1,1};
- memset(slist, 0, 10 * 200);
+ for (int i = 0; i < 10; i++) slist[i][0] = 0;
get_parms(ev[1], script, h, p);
if (slist[0][0] && slist[1][0])
{
@@ -10386,7 +10409,10 @@ good:
void run_script (int script)
{
int result;
- char line[200];
+ char line[512];
+
+ line[0] = 0;
+
if (g_dglos.bKeepReturnInt)
{
g_dglos.bKeepReturnInt = false;
@@ -10686,7 +10712,7 @@ void init_font_colors(void)
void text_draw(int h)
{
- char crap[200];
+ char crap[512];
char *cr;
rtRect32 rcRect;
int color = 15;
@@ -16630,9 +16656,9 @@ progressOut = 0.8f;
break;
case 6:
- StopMidi();
+ //StopMidi();
- progressOut = 0.9f;
+ progressOut = 0.9f;
script = load_script("main", 0, true);
locate(script, "main");
run_script(script);
diff --git a/source/dink/dink.h b/source/dink/dink.h
index 84c1304..0346fb5 100644
--- a/source/dink/dink.h
+++ b/source/dink/dink.h
@@ -169,7 +169,7 @@ const int C_MAX_SCRIPTS = 400;
#else
const int32 C_MAX_SEQUENCES = 1300; //Max # of sprite animations
const int32 C_MAX_SPRITES = 6000;
-const int32 C_MAX_SPRITES_AT_ONCE = 100; //don't change, there are still hardcoded numbers elsewhere and some weird stuff with screen lock and "flub" stuff whatever that is
+const int32 C_MAX_SPRITES_AT_ONCE = 300; //don't change, there are still hardcoded numbers elsewhere and some weird stuff with screen lock and "flub" stuff whatever that is
const int32 C_MAX_SCRIPT_CALLBACKS = 100;
const int32 max_vars = 250;
diff --git a/source/dink/misc_util.cpp b/source/dink/misc_util.cpp
index 63cafa8..0fa101b 100644
--- a/source/dink/misc_util.cpp
+++ b/source/dink/misc_util.cpp
@@ -261,7 +261,7 @@ void replace(const char *this1, char *that, char *line)
{
char hold[500];
- char thisup[200],lineup[500];
+ char thisup[512],lineup[512];
int u,i;
int checker;
diff --git a/windows_vs2017/winRTDink.vcxproj b/windows_vs2017/winRTDink.vcxproj
index 1681fd9..7c4f312 100644
--- a/windows_vs2017/winRTDink.vcxproj
+++ b/windows_vs2017/winRTDink.vcxproj
@@ -436,7 +436,7 @@
Use
PlatformPrecomp.h
Level3
- ProgramDatabase
+ OldStyle
4267;4244;4244;%(DisableSpecificWarnings)
diff --git a/windows_vs2017/winRTDink.vcxproj.user b/windows_vs2017/winRTDink.vcxproj.user
index 9bdf7a0..f415f84 100644
--- a/windows_vs2017/winRTDink.vcxproj.user
+++ b/windows_vs2017/winRTDink.vcxproj.user
@@ -7,8 +7,7 @@
$(OutDir)
WindowsLocalDebugger
-
-
+ -game dmods/tgka