From 75d2d98a46329a3d21816a2a72ad4f52ce2a22c6 Mon Sep 17 00:00:00 2001 From: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:37:54 +0300 Subject: [PATCH] Fixed plunger pullback speed in 3DPB mode. Issue #193 --- SpaceCadetPinball/TPlunger.cpp | 18 ++++++++++++------ SpaceCadetPinball/winmain.h | 2 +- build-mac-app.sh | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/SpaceCadetPinball/TPlunger.cpp b/SpaceCadetPinball/TPlunger.cpp index 01bef73..6f0f48e 100644 --- a/SpaceCadetPinball/TPlunger.cpp +++ b/SpaceCadetPinball/TPlunger.cpp @@ -24,15 +24,21 @@ TPlunger::TPlunger(TPinballTable* table, int groupIndex) : TCollisionComponent(t HardHitSoundId = visual.Kicker.HardHitSoundId; Threshold = 1000000000.0; - // In FT, default max pullback is 50. - if (pb::FullTiltMode) - MaxPullback = 50; - else - MaxPullback = 100; + // FT:MaxPullback = 50; 3DPB: MaxPullback = 100, PullbackIncrement is floored. + if (pb::FullTiltMode) + { + MaxPullback = 50; + PullbackIncrement = MaxPullback / (ListBitmap->size() * 8.0f); + } + else + { + MaxPullback = 100; + PullbackIncrement = std::floor(MaxPullback / (ListBitmap->size() * 8.0f)); + } Elasticity = 0.5f; Smoothness = 0.5f; - PullbackIncrement = MaxPullback / (ListBitmap->size() * 8.0f); + PullbackDelay = 0.025f; float* floatArr = loader::query_float_attribute(groupIndex, 0, 601); table->PlungerPosition = {floatArr[0], floatArr[1]}; diff --git a/SpaceCadetPinball/winmain.h b/SpaceCadetPinball/winmain.h index 31bdb20..104636a 100644 --- a/SpaceCadetPinball/winmain.h +++ b/SpaceCadetPinball/winmain.h @@ -66,7 +66,7 @@ class winmain using TimePoint = std::chrono::time_point; public: - static constexpr const char* Version = "2.1.0"; + static constexpr const char* Version = "2.1.1 DEV"; static bool single_step; static SDL_Window* MainWindow; static SDL_Renderer* Renderer; diff --git a/build-mac-app.sh b/build-mac-app.sh index 9b2baee..aec1e48 100755 --- a/build-mac-app.sh +++ b/build-mac-app.sh @@ -39,7 +39,7 @@ cd .. cmake . cmake --build . -sw_version='2.1.0' +sw_version='2.1.1' mkdir -p SpaceCadetPinball.app/Contents/MacOS mkdir -p SpaceCadetPinball.app/Contents/Resources