diff --git a/README.md b/README.md index 7bde865..a0dda1c 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,13 @@ Supports data files from Windows and Full Tilt versions of the game. ## Known source ports -| Platform | Author | URL | -| ------------------ | ---------- | ---------------------------------------------------------------------------------------------------------- | -| PS Vita | Axiom | | -| Emscripten | alula |
Play online: | -| Nintendo Switch | averne | | -| webOS TV | mariotaku | | -| Android (WIP) | Iscle | https://github.com/Iscle/SpaceCadetPinball | -| Nintendo Wii (WIP) | MaikelChan | https://github.com/MaikelChan/SpaceCadetPinball | +| Platform | Author | URL | +| --------------- | --------- | ---------------------------------------------------------------------------------------------------------- | +| PS Vita | Axiom | | +| Emscripten | alula |
Play online: | +| Nintendo Switch | averne | | +| webOS TV | mariotaku | | +| Android (WIP) | Iscle | https://github.com/Iscle/SpaceCadetPinball | Platforms covered by this project: desktop Windows, Linux and macOS. diff --git a/SpaceCadetPinball/TPlunger.cpp b/SpaceCadetPinball/TPlunger.cpp index eb289a3..dcbf324 100644 --- a/SpaceCadetPinball/TPlunger.cpp +++ b/SpaceCadetPinball/TPlunger.cpp @@ -54,6 +54,28 @@ int TPlunger::Message(int code, float value) PullbackTimer(0, this); } return 0; + case 1005: + case 1009: + case 1010: + { + Threshold = 0.0; + if (PullbackTimer_) + timer::kill(PullbackTimer_); + PullbackTimer_ = 0; + if (code == 1005) + loader::play_sound(SoundIndexP2); + auto bmp = ListBitmap->at(0); + auto zMap = ListZMap->at(0); + render::sprite_set( + RenderSprite, + bmp, + zMap, + bmp->XPosition - PinballTable->XOffset, + bmp->YPosition - PinballTable->YOffset); + + timer::set(Unknown4F, this, PlungerReleasedTimer); + break; + } case 1015: { auto ball = PinballTable->BallList.at(0); @@ -78,18 +100,11 @@ int TPlunger::Message(int code, float value) Boost = static_cast(MaxPullback); timer::set(0.2f, this, PlungerReleasedTimer); break; - case 1005: - case 1009: - case 1010: case 1024: { - if (code == 1024) - { - if (BallFeedTimer_) - timer::kill(BallFeedTimer_); - BallFeedTimer_ = 0; - } - + if (BallFeedTimer_) + timer::kill(BallFeedTimer_); + BallFeedTimer_ = 0; Threshold = 0.0; if (PullbackTimer_) timer::kill(PullbackTimer_); diff --git a/SpaceCadetPinball/control.cpp b/SpaceCadetPinball/control.cpp index 56d8a3b..5e401bb 100644 --- a/SpaceCadetPinball/control.cpp +++ b/SpaceCadetPinball/control.cpp @@ -1019,7 +1019,7 @@ void control::LaunchRampControl(int code, TPinballComponent* caller) { sound = control_soundwave21_tag.Component; } - else if (someFlag < 1 || someFlag > 3) + else if (someFlag <= 1 || someFlag > 3) { sound = control_soundwave24_tag.Component; } @@ -2148,7 +2148,7 @@ void control::HyperspaceKickOutControl(int code, TPinballComponent* caller) } else { - if (someFlag < 1 || someFlag > 3) + if (someFlag <= 1 || someFlag > 3) { auto duration = control_soundwave41_tag.Component->Play(); control_soundwave36_1_tag.Component->Play(); @@ -2919,7 +2919,7 @@ void control::GameoverController(int code, TPinballComponent* caller) if (missionMsg & 0x200) { - int highscoreId = missionMsg % 5; + int highscoreId = missionMsg % 4; int highScore = pb::highscore_table[highscoreId].Score; auto nextHidhscoreId = highscoreId + 1; if (highScore > 0) diff --git a/SpaceCadetPinball/fullscrn.cpp b/SpaceCadetPinball/fullscrn.cpp index 7b4be33..fa838c3 100644 --- a/SpaceCadetPinball/fullscrn.cpp +++ b/SpaceCadetPinball/fullscrn.cpp @@ -57,11 +57,10 @@ int fullscrn::enableFullscreen() { if (!display_changed) { - if (SDL_SetWindowFullscreen(winmain::MainWindow, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) - { - display_changed = 1; + SDL_SetWindowFullscreen(winmain::MainWindow, SDL_WINDOW_FULLSCREEN_DESKTOP); + display_changed = 1; + if (display_changed) return 1; - } } return 0; } @@ -70,8 +69,8 @@ int fullscrn::disableFullscreen() { if (display_changed) { - if (SDL_SetWindowFullscreen(winmain::MainWindow, 0) == 0) - display_changed = 0; + SDL_SetWindowFullscreen(winmain::MainWindow, 0); + display_changed = 0; } return 0; diff --git a/SpaceCadetPinball/midi.cpp b/SpaceCadetPinball/midi.cpp index a049a67..68a19a1 100644 --- a/SpaceCadetPinball/midi.cpp +++ b/SpaceCadetPinball/midi.cpp @@ -316,11 +316,7 @@ std::vector* midi::MdsToMidi(std::string file) while (false); delete[] fileBuf; - if (returnCode && midiOut) - { + if (returnCode && midiOut) delete midiOut; - midiOut = nullptr; - } - return midiOut; }