* 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)


git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1514 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-09-29 13:13:36 +00:00
parent ed55a08ab2
commit 4174db5427
7 changed files with 103 additions and 42 deletions

View file

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.3</string>
<string>1.8.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.3</string>
<string>1.8.4</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>

View file

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rtsoft.rtdink"
android:versionCode="9"
android:versionName="1.8.3"
android:versionName="1.8.4"
android:installLocation="preferExternal"
>

View file

@ -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)

View file

@ -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<string> 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()

View file

@ -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

View file

@ -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)
{

View file

@ -7,7 +7,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>-game dmods/tgka</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
<LocalDebuggerCommandArguments>
@ -30,7 +31,7 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GL|Win32'">
<LocalDebuggerCommandArguments>-game dmods/tdabeta</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>-game dmods/tbcb</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GL AkikoBox|Win32'">