Commit Graph

54 Commits

Author SHA1 Message Date
Muzychenko Andrey a937ff5c80 FT control part1: mission and control scores, jackpot handling, hyperspace. 2023-06-25 10:35:04 +03:00
Muzychenko Andrey 34a1e32843 Added in-game credits from Full Tilt.
This was kind-of requested a long time ago.
2023-03-17 16:38:08 +03:00
Muzychenko Andrey 4b86fe2aa7 FT collision part3: cleanup. 2023-03-05 14:16:07 +03:00
Muzychenko Andrey ba470e8727 FT collision part2: added most of the FT collision system.
Aka "World's most expensive flippers".
This is an aggregate of collision-related changes made during 3DPB->FT transition.
The most important part is in flipper collision - a shift from monolithic iterative solver in TFlipperEdge::EdgeCollision to a distributed non-iterative solver.
Both 3DPB and FT data sets use FT collision, keeping two collision systems does not make much sense.
From user perspective, FT/3DPB systems should not have any major differences.
2023-03-04 17:31:23 +03:00
Muzychenko Andrey 1391eeba81 Reordered pch includes in Sound.
This might help with #162.
Fixed switch warning.
2022-11-21 10:02:56 +03:00
Muzychenko Andrey ea32c08c4f Added “easy mode” cheat, aka frustration-free mode.
It involves always on center post and never closing kicker gates.
Issue #161.
2022-11-21 09:49:15 +03:00
Natty e7ddebd16c
Add FullTilt lane light behavior (#157)
* Add FullTilt lane light behavior

* Replaced spaces with tabs
2022-09-23 07:42:19 +03:00
Muzychenko Andrey 9f0ae0434e Render tweaks part 1: refactored sprite struct.
Optimized sprite handling in render.
Fixed switch warning in control.
2022-09-21 16:43:45 +03:00
Muzychenko Andrey 40672845e4 Message code enum part 6: final touches + control light cleanup.
MessageField is often used as int, so it stays unchanged.
2022-09-08 10:51:33 +03:00
Muzychenko Andrey 22603aa126 Message code enum part 5: control codes. 2022-09-07 16:01:38 +03:00
Muzychenko Andrey dfe1665ba1 Message code enum part 4: finalized transition of Message to enum class. 2022-09-06 16:57:56 +03:00
Muzychenko Andrey e80010e3c6 Message code enum part 3: light and light group. 2022-09-06 16:48:09 +03:00
Muzychenko Andrey 803ca14ef2 Message code enum part 2: all components except for lights. 2022-09-06 11:58:35 +03:00
Muzychenko Andrey 44d5fd5097 Message code enum part 1: global messages and some hacks. 2022-09-05 10:17:37 +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 7feba1e947 Code from FT: simplified score access in TPinballComponent. 2022-08-18 16:23:29 +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 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 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 43af97127b Simplified game mode, pause. 2022-01-05 11:38:50 +03:00
Muzychenko Andrey dc00dbde0d Fixed bug with mission accept scores.
Ref issue #81.
2021-11-04 18:46:04 +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
Muzychenko Andrey 348d79ef38 Bugs and suggestions from PR# 48. 2021-10-18 09:31:47 +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 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 4c196a9290 Added table resolution and UI scale options.
gdrv: blit directly to backing store of vScreen texture.
Added missing cheat_bump_rank sub, oops.
Fixed some warnings.
2021-09-22 15:50:07 +03:00
Muzychenko Andrey c63c6701ac gdrv: RGBA buffers, pre-applied palettes, SDL bitmap origin.
Refactored partman.
Added sprite viewer.
2021-09-21 13:14:39 +03:00
Muzychenko Andrey c5b7c0ad16 Fixed some of the memory leaks and Clang warnings.
DrMemory and Valgrind work with regular debug builds.
2021-09-14 15:33:18 +03:00
Muzychenko Andrey 28e2417ef9 Made it compile with GCC on Linux.
Fixed GCC warnings and Windows specifics.
Restored C++11, switch to 14 was not supposed to happen.
Not 100% sure about my Find* module section.
2021-09-09 11:40:54 +03:00
Muzychenko Andrey a09ea75d80 SDL port v1, Windows only for now.
Working: graphics, sound, music (3dpb only).
Not working: GUI, user settings.
2021-08-27 13:29:41 +03:00
Muzychenko Andrey 55984fbb08 Fixed x64 build warnings.
Replaced __intN with intN_t.
Some cleanup.
2021-02-16 19:03:45 +03:00
Muzychenko Andrey d594f5fdb7 Converted memory to direct pointers.
Fixed memory leaks in uninit.
Fixed some of the code analysis warnings.
Enabled /MP build.
Cleaned up the code.
2021-02-02 18:29:54 +03:00
Muzychenko Andrey 6ff457eb68 Cleaned up objlist_class. 2021-01-30 14:19:25 +03:00
oz 262b098610 Some renames, cleanup partman, loader. 2021-01-28 18:01:26 +03:00
oz 683e823193 control ready. 2021-01-23 09:57:16 +03:00
oz 847eb15d02 control: removed tag casts. 2021-01-22 12:53:16 +03:00
oz bdf2d930fd control v3. 2021-01-21 17:58:05 +03:00
oz d4febb4082 control v2. 2021-01-20 17:28:48 +03:00
oz f22077d8c8 TSink, TDemo ready. 2021-01-18 18:30:19 +03:00
oz 7e8f52c156 TDrain, TKickout, TLightBargraph, TPopupTarget, TSoloTarget ready. 2021-01-17 18:26:03 +03:00
oz d19fb0476a TRollover, TOneway, TLightRollover, TTripwire, TEdgeManager ready. 2021-01-08 18:50:12 +03:00
oz 9bd064bf15 TPlunger ready. TEdgeManager v1. 2021-01-07 19:00:38 +03:00