* Timing fixes, some Android work

git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1515 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
seth 2017-09-29 22:57:00 +00:00
parent 4174db5427
commit 63adc575a8
11 changed files with 135 additions and 19 deletions

View file

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

View file

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

87
android/jni/Android.mk Normal file
View file

@ -0,0 +1,87 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := RTDink
SHARED := ../../../shared
APP := ../../source
LOCAL_ARM_MODE := arm
COMPPATH := ../../../shared/Entity
CLANMATH := $(SHARED)/ClanLib-2.0/Sources/Core/Math
ZLIBPATH := $(SHARED)/util/zlib
PPATH := ../../../shared/Renderer/linearparticle/sources
PNGSRC := $(SHARED)/Irrlicht/source/Irrlicht/libpng
JPGSRC := $(SHARED)/Irrlicht/source/Irrlicht/jpeglib
LZMASRC := $(SHARED)/Irrlicht/source/Irrlicht/lzma
LOCAL_CPP_FEATURES += exceptions
LOCAL_CPP_FEATURES += rtti
#release flags
#-DRT_CHARTBOOST_ENABLED -DRT_MOGA_ENABLED
SHARED_FLAGS := -DANDROID_NDK -DBUILD_ANDROID -DNDEBUG -DRT_JPG_SUPPORT
#debug flags
#-DRT_CHARTBOOST_ENABLED -DRT_MOGA_ENABLED
#SHARED_FLAGS := -DANDROID_NDK -DBUILD_ANDROID -D_DEBUG -DRT_JPG_SUPPORT
LOCAL_CFLAGS := -DGC_BUILD_ANDROID $(SHARED_FLAGS)
LOCAL_CPPFLAGS := -DGC_BUILD_C $(SHARED_FLAGS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SHARED) \
$(LOCAL_PATH)/$(APP) $(LOCAL_PATH)/$(SHARED)/ClanLib-2.0/Sources $(LOCAL_PATH)/$(SHARED)/util/boost
LOCAL_SRC_FILES := \
$(SHARED)/PlatformSetup.cpp $(SHARED)/android/AndroidUtils.cpp ../temp_final_cpp_src/AndroidApp.cpp $(SHARED)/Audio/AudioManagerAndroid.cpp \
\
$(SHARED)/Audio/AudioManager.cpp \
$(CLANMATH)/angle.cpp $(CLANMATH)/mat3.cpp $(CLANMATH)/mat4.cpp $(CLANMATH)/rect.cpp $(CLANMATH)/vec2.cpp $(CLANMATH)/vec3.cpp $(CLANMATH)/vec4.cpp \
$(SHARED)/Entity/Entity.cpp $(SHARED)/Entity/Component.cpp $(SHARED)/GUI/RTFont.cpp $(SHARED)/Manager/Console.cpp $(SHARED)/FileSystem/FileManager.cpp \
$(SHARED)/Manager/GameTimer.cpp $(SHARED)/Manager/MessageManager.cpp $(SHARED)/Manager/ResourceManager.cpp $(SHARED)/Manager/VariantDB.cpp $(SHARED)/Math/rtPlane.cpp \
$(SHARED)/Math/rtRect.cpp $(SHARED)/Renderer/RenderBatcher.cpp $(SHARED)/Renderer/SoftSurface.cpp $(SHARED)/Renderer/Surface.cpp $(SHARED)/Renderer/SurfaceAnim.cpp \
$(SHARED)/util/CRandom.cpp $(SHARED)/util/GLESUtils.cpp $(SHARED)/util/MathUtils.cpp $(SHARED)/util/MiscUtils.cpp $(SHARED)/util/RenderUtils.cpp $(SHARED)/util/ResourceUtils.cpp \
$(SHARED)/util/Variant.cpp $(SHARED)/util/boost/libs/signals/src/connection.cpp $(SHARED)/util/boost/libs/signals/src/named_slot_map.cpp $(SHARED)/util/boost/libs/signals/src/signal_base.cpp \
$(SHARED)/util/boost/libs/signals/src/slot.cpp $(SHARED)/util/boost/libs/signals/src/trackable.cpp $(SHARED)/BaseApp.cpp $(SHARED)/FileSystem/FileSystem.cpp $(SHARED)/FileSystem/FileSystemZip.cpp \
$(SHARED)/util/unzip/unzip.c $(SHARED)/util/unzip/ioapi.c $(SHARED)/util/TextScanner.cpp $(SHARED)/Entity/EntityUtils.cpp \
$(SHARED)/Network/NetHTTP.cpp $(SHARED)/Network/NetSocket.cpp $(SHARED)/Network/NetUtils.cpp $(SHARED)/FileSystem/StreamingInstance.cpp \
$(SHARED)/FileSystem/StreamingInstanceZip.cpp $(SHARED)/FileSystem/StreamingInstanceFile.cpp $(SHARED)/util/archive/TarHandler.cpp $(SHARED)/util/bzip2/blocksort.c \
$(SHARED)/util/bzip2/bzlib.c $(SHARED)/util/bzip2/compress.c $(SHARED)/util/bzip2/crctable.c $(SHARED)/util/bzip2/decompress.c $(SHARED)/util/bzip2/huffman.c \
$(SHARED)/util/bzip2/randtable.c \
\
$(SHARED)/Gamepad/GamepadManager.cpp $(SHARED)/Gamepad/Gamepad.cpp $(SHARED)/Gamepad/GamepadiCade.cpp $(SHARED)/Gamepad/GamepadProvider.cpp $(SHARED)/Gamepad/GamepadProvideriCade.cpp \
$(SHARED)/Gamepad/GamepadProviderMoga.cpp $(SHARED)/Gamepad/GamepadMoga.cpp \
\
$(SHARED)/Manager/AdManager.cpp $(SHARED)/Ad/AdProvider.cpp $(SHARED)/Ad/AdProviderChartBoost.cpp \
\
$(SHARED)/Renderer/JPGSurfaceLoader.cpp \
\
$(JPGSRC)/jcapimin.c $(JPGSRC)/jcapistd.c $(JPGSRC)/jccoefct.c $(JPGSRC)/jccolor.c $(JPGSRC)/jcdctmgr.c $(JPGSRC)/jchuff.c $(JPGSRC)/jcinit.c $(JPGSRC)/jcmainct.c \
$(JPGSRC)/jcmarker.c $(JPGSRC)/jcmaster.c $(JPGSRC)/jcomapi.c $(JPGSRC)/jcparam.c $(JPGSRC)/jcphuff.c $(JPGSRC)/jcprepct.c $(JPGSRC)/jcsample.c $(JPGSRC)/jctrans.c \
$(JPGSRC)/jdapimin.c $(JPGSRC)/jdapistd.c $(JPGSRC)/jdatadst.c $(JPGSRC)/jdatasrc.c $(JPGSRC)/jdcoefct.c $(JPGSRC)/jdcolor.c $(JPGSRC)/jddctmgr.c \
$(JPGSRC)/jdhuff.c $(JPGSRC)/jdinput.c $(JPGSRC)/jdmainct.c $(JPGSRC)/jdmarker.c $(JPGSRC)/jdmaster.c $(JPGSRC)/jdmerge.c $(JPGSRC)/jdphuff.c $(JPGSRC)/jdpostct.c \
$(JPGSRC)/jdsample.c $(JPGSRC)/jdtrans.c $(JPGSRC)/jerror.c $(JPGSRC)/jfdctflt.c $(JPGSRC)/jfdctfst.c $(JPGSRC)/jfdctint.c $(JPGSRC)/jidctflt.c $(JPGSRC)/jidctfst.c \
$(JPGSRC)/jidctint.c $(JPGSRC)/jidctred.c $(JPGSRC)/jmemmgr.c $(JPGSRC)/jmemnobs.c $(JPGSRC)/jquant1.c $(JPGSRC)/jquant2.c $(JPGSRC)/jutils.c \
\
$(COMPPATH)/Button2DComponent.cpp $(COMPPATH)/FilterInputComponent.cpp $(COMPPATH)/FocusInputComponent.cpp $(COMPPATH)/FocusRenderComponent.cpp $(COMPPATH)/FocusUpdateComponent.cpp \
$(COMPPATH)/HTTPComponent.cpp $(COMPPATH)/InputTextRenderComponent.cpp $(COMPPATH)/InterpolateComponent.cpp $(COMPPATH)/OverlayRenderComponent.cpp $(COMPPATH)/ProgressBarComponent.cpp \
$(COMPPATH)/RectRenderComponent.cpp $(COMPPATH)/ScrollBarRenderComponent.cpp $(COMPPATH)/ScrollComponent.cpp $(COMPPATH)/TapSequenceDetectComponent.cpp $(COMPPATH)/TextBoxRenderComponent.cpp \
$(COMPPATH)/TextRenderComponent.cpp $(COMPPATH)/TouchStripComponent.cpp $(COMPPATH)/TrailRenderComponent.cpp $(COMPPATH)/TyperComponent.cpp $(COMPPATH)/UnderlineRenderComponent.cpp \
$(COMPPATH)/TouchHandlerComponent.cpp $(COMPPATH)/SelectButtonWithCustomInputComponent.cpp $(COMPPATH)/CustomInputComponent.cpp $(COMPPATH)/SliderComponent.cpp $(COMPPATH)/RenderClipComponent.cpp \
$(COMPPATH)/UnpackArchiveComponent.cpp $(COMPPATH)/ArcadeInputComponent.cpp $(COMPPATH)/EmitVirtualKeyComponent.cpp $(COMPPATH)/RenderScissorComponent.cpp \
\
\
$(PPATH)/L_Defination.cpp $(PPATH)/L_DroppingEffect.cpp $(PPATH)/L_EffectEmitter.cpp $(PPATH)/L_ExplosionEffect.cpp $(PPATH)/L_MotionController.cpp $(PPATH)/L_Particle.cpp \
$(PPATH)/L_ParticleEffect.cpp $(PPATH)/L_ParticleMem.cpp $(PPATH)/L_ParticleSystem.cpp $(PPATH)/L_ShootingEffect.cpp $(PPATH)/L_EffectManager.cpp \
\
$(APP)/App.cpp $(APP)/Component/ActionButtonComponent.cpp $(APP)/Component/CursorComponent.cpp $(APP)/Component/DragControlComponent.cpp \
$(APP)/Component/FPSControlComponent.cpp $(APP)/Component/InventoryComponent.cpp $(APP)/dink/dink.cpp $(APP)/dink/FFReader.cpp $(APP)/dink/misc_util.cpp $(APP)/dink/ScriptAccelerator.cpp \
$(APP)/video_gl.cpp \
$(APP)/GUI/AboutMenu.cpp $(APP)/GUI/BrowseMenu.cpp $(APP)/GUI/DebugMenu.cpp $(APP)/GUI/DMODInstallMenu.cpp \
$(APP)/GUI/EnterURLMenu.cpp $(APP)/GUI/DMODMenu.cpp $(APP)/GUI/GameMenu.cpp $(APP)/GUI/LoadMenu.cpp $(APP)/GUI/LogMenu.cpp $(APP)/GUI/MainMenu.cpp $(APP)/GUI/OptionsMenu.cpp \
$(APP)/GUI/PauseMenu.cpp $(APP)/GUI/PopUpMenu.cpp $(APP)/GUI/QuickTipMenu.cpp $(APP)/GUI/ReadTextMenu.cpp $(APP)/GUI/ExpiredMenu.cpp
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lz
include $(BUILD_SHARED_LIBRARY)

View file

@ -0,0 +1,12 @@
# The ARMv7 is significanly faster due to the use of the hardware FPU
APP_STL := gnustl_static
#APP_STL := stlport_static
APP_CPPFLAGS = -fexceptions
APP_CPPFLAGS += -Wno-error=format-security
APP_CPPFLAGS += -std=c++11
#APP_LDFLAGS = -latomic
#STLPORT_FORCE_REBUILD := true
APP_OPTIM:=release
#APP_OPTIM:=debug
APP_ABI := armeabi armeabi-v7a

View file

@ -248,3 +248,7 @@ speed and go with that, I chose a pretty fast speed sort of arbitrarily because
a specific speed, but by choosing rather snappy speed hopefully mystery island and most of them will be finishable 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 * 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) * Playing location aware sounds on a script not attached to a sprite will no longer cause crashes (should fix crash in malachi the jerk)
------ Change log for 1.8.5 ----------
* Tweaked speed a bit, sort of aligned it so the cutscenes in Initiation play right

View file

@ -184,8 +184,8 @@ App::App()
m_bDidPostInit = false; m_bDidPostInit = false;
m_bHasDMODSupport = true; m_bHasDMODSupport = true;
//for mobiles //for mobiles
m_version = 1.84f; m_version = 1.85f;
m_versionString = "V1.8.4"; m_versionString = "V1.8.5";
m_build = 1; m_build = 1;
m_bCheatsEnabled = false; m_bCheatsEnabled = false;
@ -876,6 +876,11 @@ void App::UpdateVideoSettings()
{ {
eVideoFPS v = (eVideoFPS)GetApp()->GetVarWithDefault("fpsLimit", Variant(uint32(VIDEO_FPS_LIMIT_OFF)))->GetUINT32(); eVideoFPS v = (eVideoFPS)GetApp()->GetVarWithDefault("fpsLimit", Variant(uint32(VIDEO_FPS_LIMIT_OFF)))->GetUINT32();
SetFPSLimit(60); SetFPSLimit(60);
#ifdef _DEBUG
//SetFPSLimit(20);
#endif
//SetFPSLimit(v); //SetFPSLimit(v);
}; };
@ -1042,6 +1047,7 @@ void App::AddTextToLog(const char *tex, const char *filename)
} }
#ifdef WINAPI
//our custom LogMsg that isn't slow as shit //our custom LogMsg that isn't slow as shit
void LogMsg(const char* traceStr, ...) void LogMsg(const char* traceStr, ...)
{ {
@ -1072,3 +1078,5 @@ void LogMsg(const char* traceStr, ...)
} }
} }
#endif

View file

@ -463,7 +463,7 @@ void DMODMenuAddScrollContent(Entity *pParent)
|| EndsWith(entries[i].m_files, "/develop") || EndsWith(entries[i].m_files, "/develop")
)continue; )continue;
#else #else
if (IsInString(files[i],"/Snapshot") || IsInString(files[i], "/Snapshots")) continue; if (IsInString(entries[i].m_files,"/Snapshot") || IsInString(entries[i].m_files, "/Snapshots")) continue;
#endif #endif
GetParsedDMODInfo(entries[i].m_files, entries[i].dmodName, entries[i].version, entries[i].dmodCopyright, entries[i].dmodwebsite, entries[i].description ); GetParsedDMODInfo(entries[i].m_files, entries[i].dmodName, entries[i].version, entries[i].dmodCopyright, entries[i].dmodwebsite, entries[i].description );

View file

@ -1035,9 +1035,6 @@ void OnGameMenuRender(VariantList *pVList)
//apply scale offset //apply scale offset
ApplyAspectRatioGLMatrix(); ApplyAspectRatioGLMatrix();
updateFrame(); updateFrame();
if (DinkGetSpeedUpMode()) if (DinkGetSpeedUpMode())
@ -1045,7 +1042,7 @@ void OnGameMenuRender(VariantList *pVList)
//3x speed //3x speed
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
GetApp()->SetGameTick(GetApp()->GetGameTick() + GetApp()->GetDeltaTick() * 3); //GetApp()->SetGameTick(GetApp()->GetGameTick() + GetApp()->GetDeltaTick() * 3);
//GetApp()->GetGameTimer()->Update(); //GetApp()->GetGameTimer()->Update();
glClearColor(0, 0, 0, 1); glClearColor(0, 0, 0, 1);
@ -1054,6 +1051,9 @@ void OnGameMenuRender(VariantList *pVList)
} }
} }
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glPopMatrix(); glPopMatrix();
//remove matrix //remove matrix

View file

@ -482,7 +482,7 @@ void OptionsMenuAddScrollContent(Entity *pParent)
y += GetSize2DEntity(pEnt).y; y += GetSize2DEntity(pEnt).y;
y += spacerY; y += spacerY;
/*
//fps limit //fps limit
pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Lock to 30 FPS:"); pEnt = CreateTextLabelEntity(pBG, "", startX, y, "Lock to 30 FPS:");
SetupTextEntity(pEnt,fontID); SetupTextEntity(pEnt,fontID);
@ -499,7 +499,8 @@ void OptionsMenuAddScrollContent(Entity *pParent)
uint32 videoFPS = GetApp()->GetVar("fpsLimit")->GetUINT32(); uint32 videoFPS = GetApp()->GetVar("fpsLimit")->GetUINT32();
SetupLightBarSelect(pBG, "fps_limit_", videoFPS, MAKE_RGBA(190, 0, 35, 255)); SetupLightBarSelect(pBG, "fps_limit_", videoFPS, MAKE_RGBA(190, 0, 35, 255));
*/
if (GetPlatformID() != PLATFORM_ID_IOS) if (GetPlatformID() != PLATFORM_ID_IOS)
{ {
y += spacerY; y += spacerY;

View file

@ -11330,7 +11330,7 @@ int autoreverse_diag(int j)
} }
#ifdef _DEBUG #ifdef _DEBUG
LogMsg("Auto Reverse Diag was sent a dir %d sprite, base %d walk.",g_sprite[j].dir, g_sprite[j].base_walk); //LogMsg("Auto Reverse Diag was sent a dir %d sprite, base %d walk.",g_sprite[j].dir, g_sprite[j].base_walk);
#endif #endif
return(0); return(0);
} }
@ -16007,7 +16007,8 @@ LastWindowsTimer = GetTickCount();
g_dglos.lastTickCount = g_dglos.g_dinkTick; g_dglos.lastTickCount = g_dglos.g_dinkTick;
g_dglos.g_dinkTick = GetBaseApp()->GetGameTick(); //g_dglos.g_dinkTick = GetBaseApp()->GetGameTick();
g_dglos.g_dinkTick += (1000.0f / 60.0f); //FPS lock at 60 fps
/* /*
int fps_final = g_dglos.g_dinkTick - g_dglos.lastTickCount; int fps_final = g_dglos.g_dinkTick - g_dglos.lastTickCount;
@ -16044,7 +16045,7 @@ LastWindowsTimer = GetTickCount();
//assume we're locked at 60 fps //assume we're locked at 60 fps
g_dglos.base_timing = 18; g_dglos.base_timing = 7;
float junk3 = 1; float junk3 = 1;
/* /*
if (g_dglos.dinkspeed <= 0) if (g_dglos.dinkspeed <= 0)
@ -16068,7 +16069,7 @@ LastWindowsTimer = GetTickCount();
//g_sprite[1].speed = (g_dglos.base_timing / 4); //g_sprite[1].speed = (g_dglos.base_timing / 4);
//g_sprite[1].speed = 5; //g_sprite[1].speed = 5;
bool bSpeedUp = false; bool bSpeedUp = false;
g_sprite[1].speed = (int)junk3*1.35f; g_sprite[1].speed = (int)junk3*1.0f;
if (DinkGetSpeedUpMode()) if (DinkGetSpeedUpMode())
{ {
bSpeedUp = true; bSpeedUp = true;
@ -16100,9 +16101,13 @@ LastWindowsTimer = GetTickCount();
if (g_dglos.g_dinkTick > g_dglos.g_DinkUpdateTimerMS+100) if (g_dglos.g_dinkTick > g_dglos.g_DinkUpdateTimerMS+100)
{ {
g_dglos.mbase_timing = (g_dglos.mbase_count / 100); // g_dglos.mbase_timing = (g_dglos.mbase_count / 100);
g_dglos.mbase_timing = 135; //hardcoded now to avoid fluctuations
g_dglos.g_DinkUpdateTimerMS = g_dglos.g_dinkTick; g_dglos.g_DinkUpdateTimerMS = g_dglos.g_dinkTick;
if (g_dglos.g_bowStatus.active) g_dglos.g_bowStatus.hitme = true; if (g_dglos.g_bowStatus.active) g_dglos.g_bowStatus.hitme = true;
if (*pupdate_status == 1) update_status_all(); if (*pupdate_status == 1) update_status_all();
update_sound(); update_sound();

View file

@ -7,8 +7,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GL|Win32'">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory> <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-game dmods/init</LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Common Debug|Win32'">
<LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>