diff --git a/OSX/Info.plist b/OSX/Info.plist index d2401e3..7cac52f 100644 --- a/OSX/Info.plist +++ b/OSX/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.8.3 + 1.8.4 CFBundleSignature ???? CFBundleVersion - 1.8.3 + 1.8.4 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSMainNibFile diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index c8aeec2..b70c693 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -2,7 +2,7 @@ diff --git a/script/win_installer/readme.txt b/script/win_installer/readme.txt index 9271bec..5b0a2fa 100644 --- a/script/win_installer/readme.txt +++ b/script/win_installer/readme.txt @@ -240,3 +240,11 @@ it so going with that * Added hardening to check valid input on many script functions, will stop "sometimes" crashes based on bad scripting as well as log them * Crash logging should show correct function names. I mean it this time! +------ Change log for 1.8.4 ---------- + +* Some changes to Dink's speed calculations, it's now basically locked at "you better get 60 fps or the whole game will slow down" - the +original system is REALLY bad and the timing of Dink vs monsters can vary wildly based on your framerate. So I sort of had to "choose" a correct +speed and go with that, I chose a pretty fast speed sort of arbitrarily because it "felt" ok. There isn't really a "correct" speed so I do expect problems with some dmods due to them expecting +a specific speed, but by choosing rather snappy speed hopefully mystery island and most of them will be finishable +* Related to the above, holding tab no longer lets you cheat by moving relatively faster than monsters +* Playing location aware sounds on a script not attached to a sprite will no longer cause crashes (should fix crash in malachi the jerk) diff --git a/source/App.cpp b/source/App.cpp index 8237f18..25fef35 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.83f; - m_versionString = "V1.8.3"; + m_version = 1.84f; + m_versionString = "V1.8.4"; m_build = 1; m_bCheatsEnabled = false; @@ -259,7 +259,6 @@ bool App::DoesCommandLineParmExist(string parm) { vector parms = GetBaseApp()->GetCommandLineParms(); parm = ToLowerCaseString(parm); - for (int i = 0; i < parms.size(); i++) { if (ToLowerCaseString(parms[i]) == parm) return true; @@ -276,7 +275,6 @@ bool App::Init() //GetBaseApp()->SetDisableSubPixelBlits(true); - SetDefaultButtonStyle(Button2DComponent::BUTTON_STYLE_CLICK_ON_TOUCH_RELEASE); SetManualRotationMode(false); @@ -621,8 +619,6 @@ GetApp()->SetCheatsEnabled(true); } #endif - - return true; } @@ -879,21 +875,8 @@ void App::OnMemoryWarning() void App::UpdateVideoSettings() { eVideoFPS v = (eVideoFPS)GetApp()->GetVarWithDefault("fpsLimit", Variant(uint32(VIDEO_FPS_LIMIT_OFF)))->GetUINT32(); - OSMessage o; - o.m_type = OSMessage::MESSAGE_SET_FPS_LIMIT; - - switch (v) - { - case VIDEO_FPS_LIMIT_ON: - o.m_x = 30; - break; - - case VIDEO_FPS_LIMIT_OFF: - o.m_x = 2000; - break; - } - - GetBaseApp()->AddOSMessage(o); + SetFPSLimit(60); + //SetFPSLimit(v); }; void App::SaveAllData() diff --git a/source/GUI/GameMenu.cpp b/source/GUI/GameMenu.cpp index 7741940..df8a04f 100644 --- a/source/GUI/GameMenu.cpp +++ b/source/GUI/GameMenu.cpp @@ -1040,6 +1040,20 @@ void OnGameMenuRender(VariantList *pVList) updateFrame(); + if (DinkGetSpeedUpMode()) + { + //3x speed + for (int i = 0; i < 2; i++) + { + GetApp()->SetGameTick(GetApp()->GetGameTick() + GetApp()->GetDeltaTick() * 3); + //GetApp()->GetGameTimer()->Update(); + + glClearColor(0, 0, 0, 1); + glClear(GL_COLOR_BUFFER_BIT); + updateFrame(); + } + + } glMatrixMode(GL_MODELVIEW); glPopMatrix(); //remove matrix diff --git a/source/dink/dink.cpp b/source/dink/dink.cpp index 0ca23b3..933178c 100644 --- a/source/dink/dink.cpp +++ b/source/dink/dink.cpp @@ -1082,7 +1082,10 @@ bool attach(void) if (compare((char*)"&cur_magic", g_dglos.g_playerInfo.var[i].name)) pcur_magic = &g_dglos.g_playerInfo.var[i].var; if (compare((char*)"&last_text", g_dglos.g_playerInfo.var[i].name)) plast_text = &g_dglos.g_playerInfo.var[i].var; if (compare((char*)"&magic_level", g_dglos.g_playerInfo.var[i].name)) pmagic_level = &g_dglos.g_playerInfo.var[i].var; - if (compare((char*)"&update_status", g_dglos.g_playerInfo.var[i].name)) pupdate_status = &g_dglos.g_playerInfo.var[i].var; + if (compare((char*)"&update_status", g_dglos.g_playerInfo.var[i].name)) + { + pupdate_status = &g_dglos.g_playerInfo.var[i].var; + } if (compare((char*)"&missile_target", g_dglos.g_playerInfo.var[i].name)) pmissile_target = &g_dglos.g_playerInfo.var[i].var; if (compare((char*)"&enemy_sprite", g_dglos.g_playerInfo.var[i].name)) penemy_sprite = &g_dglos.g_playerInfo.var[i].var; if (compare((char*)"&magic_cost", g_dglos.g_playerInfo.var[i].name)) pmagic_cost = &g_dglos.g_playerInfo.var[i].var; @@ -3544,7 +3547,7 @@ void decipher(char *crap, int script) { sprintf(crap, "%d",g_scriptInstance[script]->sprite); - LogMsg("cur sprite returning %s, ",crap); + //LogMsg("cur sprite returning %s, ",crap); return; } @@ -5937,6 +5940,12 @@ bool playing( int sound) int get_pan(int h) { + if (h < 0 || h > C_MAX_SPRITES_AT_ONCE) + { + LogMsg("ignoring get_pan (probably initiated by sound play command) as it's connected to an invalid sprite #"); + return 0; + } + int pan = 0; int x1 = 320; @@ -5959,6 +5968,11 @@ int get_pan(int h) int get_vol(int h) { + if (h < 0 || h > C_MAX_SPRITES_AT_ONCE) + { + LogMsg("ignoring get_vol (probably initiated by sound play command) as it's connected to an invalid sprite #"); + return 0; + } int pan = 0; int pan2 = 0; @@ -15917,20 +15931,7 @@ void updateFrame() #endif - bool bSpeedUp = false; - if (DinkGetSpeedUpMode()) - { - bSpeedUp = true; - } - - if (bSpeedUp) - { - if (!GetApp()->GetGameTickPause()) - { - GetApp()->SetGameTick(GetApp()->GetGameTick() + GetApp()->GetDeltaTick() * 5); - } - } byte state[256]; rtRect32 rcRect; bool bCaptureScreen = false; @@ -15970,7 +15971,8 @@ void updateFrame() #ifdef _WIN32 static int LastWindowsTimer = 0; -if (!bSpeedUp) +//if (!bSpeedUp) +if (0) { //Sleep(50); @@ -16000,15 +16002,22 @@ LastWindowsTimer = GetTickCount(); */ #endif + + //non-windows timer + + g_dglos.lastTickCount = g_dglos.g_dinkTick; g_dglos.g_dinkTick = GetBaseApp()->GetGameTick(); + /* int fps_final = g_dglos.g_dinkTick - g_dglos.lastTickCount; //redink1 changed to 12-12 from 10-15... maybe work better on faster computers? if (fps_final < 12) fps_final = 12; if (fps_final > 68) fps_final = 68; + fps_final = 24; //force it + g_dglos.base_timing = fps_final / 3; if (g_dglos.base_timing < 4) g_dglos.base_timing = 4; @@ -16016,6 +16025,7 @@ LastWindowsTimer = GetTickCount(); //redink1 added these changes to set Dink's speed correctly, even on fast machines. + if (g_dglos.dinkspeed <= 0) junk3 = 0; else if (g_dglos.dinkspeed == 1) @@ -16030,6 +16040,51 @@ LastWindowsTimer = GetTickCount(); junk3 *= (g_dglos.base_timing / 4); g_sprite[1].speed = junk3; + */ + + //assume we're locked at 60 fps + + g_dglos.base_timing = 18; + float junk3 = 1; + /* + if (g_dglos.dinkspeed <= 0) + junk3 = 0; + else if (g_dglos.dinkspeed == 1) + junk3 = 12; + else if (g_dglos.dinkspeed == 2) + junk3 = 6; + else if (g_dglos.dinkspeed == 3) + junk3 = 3; + */ + if (g_dglos.dinkspeed <= 0) + junk3 = 0; + else if (g_dglos.dinkspeed == 1) + junk3 = 12; + else if (g_dglos.dinkspeed == 2) + junk3 = 6; + else if (g_dglos.dinkspeed == 3) + junk3 = 3; + + //g_sprite[1].speed = (g_dglos.base_timing / 4); + //g_sprite[1].speed = 5; + bool bSpeedUp = false; + g_sprite[1].speed = (int)junk3*1.35f; + if (DinkGetSpeedUpMode()) + { + bSpeedUp = true; + } + + if (bSpeedUp) + { + + /* + if (!GetApp()->GetGameTickPause()) + { + GetApp()->SetGameTick(GetApp()->GetGameTick() + GetApp()->GetDeltaTick() * 5); + } + */ + } + if (g_dglos.g_bShowingBitmap.active) { diff --git a/windows_vs2017/winRTDink.vcxproj.user b/windows_vs2017/winRTDink.vcxproj.user index c012a85..468a14e 100644 --- a/windows_vs2017/winRTDink.vcxproj.user +++ b/windows_vs2017/winRTDink.vcxproj.user @@ -7,7 +7,8 @@ $(OutDir) WindowsLocalDebugger - -game dmods/tgka + + @@ -30,7 +31,7 @@ WindowsLocalDebugger - -game dmods/tdabeta + -game dmods/tbcb WindowsLocalDebugger