Commit Graph

234 Commits

Author SHA1 Message Date
Muzychenko Andrey 44d5fd5097 Message code enum part 1: global messages and some hacks. 2022-09-05 10:17:37 +03:00
Harmann Gabrielian 69fd91f003
Russian translation overhaul (#154)
* Russian translation overhaul

Most of strings were renamed according to the official localisation (bundled with russian WinXP distros, manual only), some of them I had to adapt myself.

* Rollback wormhole translation.

Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
2022-09-02 07:34:54 +03:00
Muzychenko Andrey 42226a14c9 Simplified get_rc_string, merged pinball and pb. 2022-08-31 15:18:22 +03:00
Muzychenko Andrey 88f835d068 Removed unused translated texts.
Fixed translation.h include leak.
Added TTextBox font color support.
2022-08-31 11:11:21 +03:00
Alexis Murzeau 66a868083a
Add translations (#153)
* Add translations from v1

* Add font configuration (to be able to use non-latin languages)

* translations: remove includes that are already in pch.h

* translations: rename enums and avoid macros

* Fix crash when the font file doesn't exist

* translations: avoid u8 to avoid reencoding by MSVC

MSVC will read the file as ASCII and reconvert characters as UTF-8, this will corrupt characters as the file is in fact already in UTF-8.

* translations: remove NUMBER in enums

* translations: handle non existing translations gracefuly (don't crash)

Fallback to english if available, else return empty string

* Testing pull collaboration.

* Rollback: remove NUMBER in enums.

* Get rid of namespace, use header instead.

* Collapsed translated text struct and array.

* Fixed build errors and warnings.

* Simplified language list.

* All new types, locals and globals should use CamelCase.

* Removed unnecessary ImGui patch.

* Rearranged TTextBox immediate mode draw.

* Final touches: removed unused declaration in gdrv.
Removed unused Msg entries and added new check.

* Remove placeholder english texts from missing translations

Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
2022-08-31 07:58:03 +03:00
Muzychenko Andrey c1c74878df Multiball part 1: control and component changes from FT.
The result is 3DPB/FT hybrid, with control closer to 3DPB and components closer to FT.
2022-08-25 17:09:17 +03:00
Muzychenko Andrey 14a8d64b67 TLight: cleanup, code from FT, new test commands. 2022-08-24 13:32:35 +03:00
Muzychenko Andrey acd1ad34b2 Code from FT: simplified TFlipper sprite update.
TFlipperEdge moving geometry stored in object.
2022-08-23 08:14:28 +03:00
Muzychenko Andrey 7feba1e947 Code from FT: simplified score access in TPinballComponent. 2022-08-18 16:23:29 +03:00
Alexis Murzeau a2567c1fea
Fix flipper animation and angle calculation (#150)
Checked with a slowed down flipper (reduced retractTime and extendTime)
to ensure the flipper position is correct even when not finished while
pressing the flipper control.
2022-08-09 10:04:51 +03:00
Alexis Murzeau 367f4538a3
fix gui not responding when the game is paused (#151) 2022-08-09 08:26:15 +03:00
Muzychenko Andrey 54a217c27b Fixed build with new SDL_mixer versions.
Issue #145.
2022-07-18 09:45:46 +03:00
sasodoma 6f00b57eb9
Change strings from Commation to Commendation, as it is in the original game (#144) 2022-07-11 10:09:57 +03:00
Muzychenko Andrey eed3662592 Fixed HardHit detection in DefaultCollision.
Issue #141.
2022-06-15 09:10:24 +03:00
Muzychenko Andrey 5e42f37fba Fixed sound duration for missing sounds.
Issue #140.
2022-06-14 11:46:11 +03:00
Muzychenko Andrey 8017734de4 Switched positional audio to collision coordinate system.
Refactored positional audio.
2022-06-01 16:19:27 +03:00
Muzychenko Andrey c93e11ee6b Added sprite positions to debug overlay. 2022-05-31 11:34:04 +03:00
Muzychenko Andrey 5d7d7c0822 Cleaned up positional sound. 2022-05-30 11:23:47 +03:00
Patrice Levesque a4c6165094
Implement stereo sound. (#138)
* Implement stereo sound.

Original Space Cadet has mono sound.  To achieve stereo, the following
steps were accomplished:

- Add a game option to turn on/off stereo sound.  Default is on.

- TPinballComponent objects were extended with a method called
  get_coordinates() that returns a single 2D point, approximating the
  on-screen position of the object, re-mapped between 0 and 1 vertically
  and horizontally, {0, 0} being at the top-left.

    - For static objects like bumpers and lights, the coordinate refers
      to the geometric center of the corresponding graphic sprite, and
      is precalculated at initialization.

    - For ball objects, the coordinate refers to the geometric center of
      the ball, calculated during play when requested.

- Extend all calls to sound-playing methods so that they include a
  TPinballComponent* argument that refers to the sound source, e.g.
  where the sound comes from.  For instance, when a flipper is
  activated, its method call to emit a sound now includes a reference to
  the flipper object; when a ball goes under a SkillShotGate, its method
  call to emit a sound now includes a reference to the corresponding
  light; and so on.

  For some cases, like light rollovers, the sound source is taken from
  the ball that triggered the light rollover.

  For other cases, like holes, flags and targets, the sound source is
  taken from the object itself.

  For some special cases like ramp activation, sound source is
  taken from the nearest light position that makes sense.

  For all game-progress sounds, like mission completion sounds or ball
  drain sounds, the sound source is undefined (set to nullptr), and the
  Sound::PlaySound() method takes care of positioning them at a default
  location, where speakers on a pinball machine normally are.

- Make the Sound::PlaySound() method accept a new argument, a
  TPinballComponent reference, as described above.

  If the stereo option is turned on, the Sound::PlaySound() method calls
  the get_coordinates() method of the TPinballComponent reference to get
  the sound position.

  This project uses SDL_mixer and there is a function called
  Mix_SetPosition() that allows placing a sound in the stereo field, by
  giving it a distance and an angle.

  We arbitrarily place the player's ears at the bottom of the table; we
  set the ears' height to half a table's length.  Intensity of the
  stereo effect is directly related to this value; the farther the
  player's ears from the table, the narrowest the stereo picture gets,
  and vice-versa.

  From there we have all we need to calculate distance and angle; we do
  just that and position all the sounds.

* Copy-paste typo fix.
2022-05-30 10:35:29 +03:00
Muzychenko Andrey cfe2691892 Optimized SDL_RenderDrawCircle.
Change mouse warping strategy in hidden test cheat.
2022-05-27 13:54:36 +03:00
Muzychenko Andrey 4183e7f0bf Refactored midi multiple track support.
Cleaned up TCollisionComponent.
Issue #129.
2022-05-23 12:45:18 +03:00
Muzychenko Andrey e283a643b3 Added support for multiple music tracks in FT mode.
Note that taba3 is not currently played as it needs multiball support.
Issue #129.
2022-05-20 19:32:09 +03:00
Muzychenko Andrey 97aea20586 Renamed some collision variables. 2022-05-20 11:51:00 +03:00
Muzychenko Andrey 5461483bb5 Added debug overlay v1.
It features various collision info perspective projected and overlayed on the table.
2022-05-19 14:17:31 +03:00
Muzychenko Andrey 0cb75ecf7f Cleaned up Bresenham line in TLine and TEdgeManager. 2022-05-17 12:36:46 +03:00
Muzychenko Andrey 2d2ca0ab2a Cleaning up maths: part 4.
More by ref args, cleaned up distance_to_flipper, ramp init.
2022-05-16 09:28:35 +03:00
Muzychenko Andrey fdf1f6c9f1 Cleaning up maths: part 3.
Demangled methods, vectors args by ref, added comments, more accurate ray_intersect_line.
2022-05-13 11:15:30 +03:00
Muzychenko Andrey 2d0da712e3 Cleaning up maths: part 2.
Renamed vector2.
2022-05-11 16:47:13 +03:00
Muzychenko Andrey d23444b983 Cleaning up maths: part 1.
Vector3 inherited from vector2.
2022-05-11 16:42:45 +03:00
guijan 3f7526ba12
fix X11 include leak (#136)
This fixes the build on OpenBSD.
2022-05-06 07:58:53 +03:00
Muzychenko Andrey cc06d35bc7 Fixed high score insertion for multiple players.
Refactored high_score.
Issue #131.
2022-04-11 10:28:20 +03:00
Muzychenko Andrey b20e13ee97 control: reduced component indirection.
cheats: hidden test with tab, FT style.
2022-02-10 16:29:31 +03:00
Muzychenko Andrey a626572da3 Fixed wormhole lights reset on mission abort.
Issue #124.
2022-02-07 16:57:04 +03:00
Muzychenko Andrey 8f34829b1e High score: rank starts from 1, table borders. 2022-01-12 17:26:31 +03:00
Muzychenko Andrey 0a2d6847ba Added sound and music volume control.
Issue #120.
2022-01-12 17:17:38 +03:00
Muzychenko Andrey 43af97127b Simplified game mode, pause. 2022-01-05 11:38:50 +03:00
Muzychenko Andrey 9acd3dbc9b Bumped version to 2.0.1.
Added Flathub link.
2021-12-29 09:46:09 +03:00
Muzychenko Andrey a6e2a433c4 Added secondary clear hack.
Issue #88
2021-12-26 13:25:25 +03:00
Kowalski Dragon ad4a17c2f2
Add assets (#113)
* Add 128x128 icon needed for Flathub submission

* Add screenshot

* Align metainfo to use screenshot in the upstream repository

* Edit CMake to install 128x128 icon in correct folder

* Add jpg screenshots
2021-12-26 13:06:31 +03:00
Kowalski Dragon 4db4e5fbcb
Improve linux building (#111)
* Improve Linux platform by adding metadata and improve description

* Improve readme

* Improve metainfo

* Fix wrong desktop file

* Improve readme

* Improve readme

* Appstream doesn't like h1

* Add CMake and Ninja to .gitignore

* Fix issues




3


4

* Revert readme keeping only Linux part

* Change comment on desktop file

* Align metainfo

* Decouple Readme from Linux building instructions
2021-12-24 09:09:40 +03:00
Muzychenko Andrey 3400ea4576 Added WD and Linux-specific /usr/* to game data search paths.
Improved data not found error message.
Ref #100.
2021-12-08 15:55:49 +03:00
Martin Ligabue 389122182e
typo (#102)
pause/ resume to pause/resume
2021-12-03 15:35:23 +03:00
Nicola Smaniotto de13d4e326
Add linux desktop file and install (#100)
* extract png icons from the ico

* add desktop file

* add linux install option to cmake

* use 32bit icons
2021-12-02 08:07:27 +03:00
Muzychenko Andrey 4e8dbd0b86 TKickout: fixed z reset with demo data. 2021-11-24 17:37:37 +03:00
Muzychenko Andrey 919b537e28 Added FT demo data support.
Tested with .006 ,.020 RC2, there might be more versions out there.
Fixed mds2midi.
Ref #22.
2021-11-24 17:25:23 +03:00
Muzychenko Andrey 95007c9253 partman: improved bad zMap skip. 2021-11-23 15:23:11 +03:00
Muzychenko Andrey 37198f1b99 Added integer scaling option.
Useful for getting exact upscale in combination with nearest neighbor.
Ref issue #97.
2021-11-22 09:32:17 +03:00
Muzychenko Andrey 64c3f2031b Added “Prefer 3DPB game data” option.
Useful for quickly switching between the two datasets.
3DPB and FT data can be stored in one folder without collisions.
2021-11-21 15:40:56 +03:00
Muzychenko Andrey 3b7dc0dae2 Added centered text in textboxes in FT mode. 2021-11-20 19:03:22 +03:00
Muzychenko Andrey 2229f9b70e Added hybrid sleep/spin wait mode. 2021-11-18 17:58:53 +03:00
Muzychenko Andrey 545af17b3b Merge from classic: better frame time tool, negative sleep remainder. 2021-11-18 12:11:25 +03:00
Muzychenko Andrey 200a7dbf79 Enabled ImGui navigation with keyboard and game controller.
Ref issue #92.
2021-11-15 17:32:18 +03:00
Muzychenko Andrey 8ab50ea7b7 ColorRgba: replaced union with bit shifts.
Fixed bad clamping in frame time tool.
2021-11-13 09:00:58 +03:00
Muzychenko Andrey f3e4211226 Improved frame time diagnostic tool.
Split overdraw palette from frame time tool.
2021-11-11 14:30:56 +03:00
Muzychenko Andrey 683204519c Added UTF-8 path support on Windows.
Ref issue #82.
2021-11-06 19:22:56 +03:00
Muzychenko Andrey ecdf802d68 Added game data loading from user folder (SDL_GetPrefPath).
Ref issue #80.
2021-11-05 10:16:27 +03:00
Muzychenko Andrey dc00dbde0d Fixed bug with mission accept scores.
Ref issue #81.
2021-11-04 18:46:04 +03:00
Muzychenko Andrey 862fe13dcd Added game controller exit shortcut: back/select when paused.
Ref issue #79.
2021-11-01 09:09:19 +03:00
Muzychenko Andrey fc1975a607 Fixed bug: dialogs not shown when main menu is hidden.
Ref issue #76.
2021-10-30 12:34:17 +03:00
Muzychenko Andrey e61bbd634c Added fallback to SW SDL renderer. 2021-10-30 10:12:30 +03:00
Muzychenko Andrey 917b68d630 Added NN scaling for PINBALL2.MID.
It does not scale well.
Wii port should rather use non-compressed PB_MSGFT_bin.
2021-10-28 13:03:05 +03:00
Iscle d27740bd38
Fix compiler warnings (#73) 2021-10-26 17:15:45 +03:00
Muzychenko Andrey cfd30419c2 Added Windows XP build configuration.
Removed unused SDL inits.
2021-10-26 17:11:53 +03:00
Muzychenko Andrey 3ec96b84ad PresentVScreen: fixed sub pixel offset.
SDL<2.0.10 uses crude approximation.
2021-10-25 08:03:30 +03:00
MaikelChan 34cb964ea5
Change texture filtering without restarting. (#67) 2021-10-25 06:42:36 +03:00
MaikelChan 5789492021
Adjusted screen coordinates so menu doesn't overlap (#66)
* Optimized final blit to the screen render target.

When bumping the table, instead of offseting the table pixels by CPU, just memcpy all the pixels to vScreenTex once, and then render two separate quads from that texture: one for the board and the other for the sidebar. Then change the coordinates of the board quad when bumping.

* Main menu bar doesn't cover game area

* Forgot to also take into account changing UI scale.
2021-10-24 18:38:23 +03:00
MaikelChan 38cf08e298
Optimized final blit to the screen render target. (#65)
When bumping the table, instead of offseting the table pixels by CPU, just memcpy all the pixels to vScreenTex once, and then render two separate quads from that texture: one for the board and the other for the sidebar. Then change the coordinates of the board quad when bumping.
2021-10-24 07:13:51 +03:00
Muzychenko Andrey 5cd01807b2 winmain: converted int to bool.
Cleaned up some of the PR changes.
2021-10-23 09:02:51 +03:00
toxie 57af3af800
Increase precision of mode_countdown_ handling (#52)
* fix harmless warnings and properly try/catch allocations via new

otherwise the error handling will never be triggered

* increase precision of mode_countdown_ handling

potentially there could be modes running a bit too long, depending on passed in ms (which were implicitly truncated before when passing in)

also fix some harmless warnings

* document warnings that i cannot handle on my own

* revert changes to have a new cleaner PR after review/cherry picks

* increase precision of mode_countdown_ handling

potentially there could be modes running a bit too long, depending on passed in ms (which were implicitly truncated before when passing in)

also fix some harmless warnings and add comments where original code is 'correct' but weird
2021-10-23 07:33:04 +03:00
Desgging 8e07b7fc3f
Full Tilt hack - ball doesn't delay at ramp hole (#63) 2021-10-23 07:31:25 +03:00
Muzychenko Andrey 685dfe78c2 TPlunger: removed duplicated code.
Ref PR#52.
2021-10-18 10:52:13 +03:00
Muzychenko Andrey 348d79ef38 Bugs and suggestions from PR# 48. 2021-10-18 09:31:47 +03:00
Muzychenko Andrey 06b760e8dd Player controls: added mouse and game controller remapping.
Fixed duplicate button id.
2021-10-17 18:18:29 +03:00
Muzychenko Andrey d06aa1c736 Changed SDL_mixer version guard.
SDL_MIXER_COMPILEDVERSION is not in Windows release of mixer v2.0.1, so it is back to basics with SDL_MIXER_PATCHLEVEL.
MIX_INIT_FLUIDSYNTH was renamed in 2.0.2, according to headers from Windows releases.
Ref PR #42, #46
2021-10-17 12:00:30 +03:00
Mariotaku 787c623cfe
Backward compatibility for mixer version check (#46)
SDL_MIXER_VERSION_ATLEAST isn't available in SDL Mixer 2.0.1, which will cause build errors.
2021-10-17 09:00:49 +03:00
Mariotaku f56abf0596
Compatibility and game controller patches (#42)
* Compatibility for old CMake versions (3.0)
Compatibility for SDL Mixer 2.0.1
Basic controller support: LB, RB for flippers, A for plunger, DPAD for table bump

* Update SpaceCadetPinball/Sound.cpp

Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
2021-10-17 07:52:05 +03:00
Muzychenko Andrey f302687c7f high_score: fixed new score not shifting older scores.
Issue #33.
2021-10-15 13:30:55 +03:00
Muzychenko Andrey 5947727f80 Tweaked ball mouse control cheat. 2021-10-10 17:13:43 +03:00
Muzychenko Andrey 69ecce88df Score: inject 3DPB msg font into dat struct.
Fixed double free in sound.
2021-10-10 12:22:21 +03:00
Muzychenko Andrey 43593b168d Sound: added channel recycling.
Added sound channel count (aka voices) user option.
Added 3DPB font to sprite viewer.
Added version number to about dialog.
2021-10-09 17:28:30 +03:00
Muzychenko Andrey d80074b9b6 Added Windows subsystem entry point for release builds. 2021-10-09 12:33:33 +03:00
Muzychenko Andrey ac289c7f48 Fixed TLightGroup message 45 and 46, used by TLightBargraph.
Issue #25.
2021-10-07 14:17:43 +03:00
Nixola 87e44b700b
Mingw cross compilation (#24)
* Fixed icon filename capitalization

* Created mingw cmake toolchain

* Adjusted CMakeLists.txt for compatibility

* Small mingwcc.cmake cleanup

* Added cross-compilation instructions to readme

* Update README.md

Fixed typo

Co-authored-by: Nicola Orlando <nicolaorlando24@gmail.com>
Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
2021-10-07 12:53:56 +03:00
Muzychenko Andrey 48721e5811 Fixed flipper animation frame skip bug.
It is from original 3DPB, not present in FT.
2021-10-07 08:01:34 +03:00
Muzychenko Andrey 7ee508118c Fixed TKickout temporary Z in FT mode. 2021-10-06 12:42:22 +03:00
Muzychenko Andrey 8c4f38c0af Cheats: flipped literals, made some toggle, added GUI. 2021-10-05 16:48:13 +03:00
Muzychenko Andrey 167a2c2bd1 Demangled and simplified pbctrl_bdoor_controller. 2021-10-04 17:04:09 +03:00
Muzychenko Andrey f1c6c48b36 Enabled icon in Windows build. 2021-10-03 18:57:19 +03:00
Muzychenko Andrey 8d2745fc33 Added support for sub-millisecond frame times. 2021-10-03 18:06:19 +03:00
Muzychenko Andrey 261457a959 TPinballComponent: replaced calloc operator new with member initialization. 2021-10-02 18:58:54 +03:00
oz 93de90b680 Replaced memory with new.
Cleaned up gdrv, zdrv, render.
2021-10-02 17:45:31 +03:00
Muzychenko Andrey c3b6daefc9 Added uncapped UPS option.
Issue #18.
2021-10-02 07:42:08 +03:00
Muzychenko Andrey 81c2034a16 Replaced objlist_class with std::vector.
Fixed minor bug in TLightGroup.
Cleaned up some warnings.
2021-10-01 18:55:44 +03:00
Muzychenko Andrey 8a421a2623 Implemented player controls dialog.
This last missing major feature brings v2 into feature parity with the original and closer to release.
Ref issues #16, #17.
2021-10-01 09:05:38 +03:00
Muzychenko Andrey a281000308 midi: added support for FULLTILT16 music. 2021-09-30 08:51:48 +03:00
Muzychenko Andrey 03deda2f9d Added event wait timeout when idle.
Added show menu button to prevent lockout; this somewhat ruins no menu aesthetic.
Cleaned up 3DPB vs. FT methods in midi.
2021-09-29 17:53:49 +03:00
Muzychenko Andrey ba5a0f3044 Compressed and encoded embedded 3DPB font.
Exposed ImGui function for decompressing embedded data.
2021-09-29 10:08:45 +03:00
Muzychenko Andrey b37f5d6d76 Fixed ShowMenu option interrupting ImGui::NewFrame. 2021-09-29 07:46:13 +03:00
Muzychenko Andrey 593b4d161c
Merge pull request #14 from prototux/option_nogui
Add an option to show or hide the menu
2021-09-29 07:32:01 +03:00
prototux 7c29c05d64 Fixed the keyboard shortcut for show menu 2021-09-29 06:09:24 +02:00