Commit Graph

233 Commits

Author SHA1 Message Date
Muzychenko Andrey a845d0d630 Rearranged TTextBox immediate mode draw. 2022-08-29 13:54:06 +03:00
Muzychenko Andrey e8b0102bfb Removed unnecessary ImGui patch. 2022-08-29 13:30:44 +03:00
Muzychenko Andrey 78c8acc31e All new types, locals and globals should use CamelCase. 2022-08-29 13:01:16 +03:00
Muzychenko Andrey 17c059b6f7 Simplified language list. 2022-08-29 12:46:19 +03:00
Muzychenko Andrey 339021a11b Fixed build errors and warnings. 2022-08-29 11:19:52 +03:00
Muzychenko Andrey 9f17e0dd0a Collapsed translated text struct and array. 2022-08-29 11:01:19 +03:00
Muzychenko Andrey dae4b1bf20 Get rid of namespace, use header instead. 2022-08-29 08:29:22 +03:00
Muzychenko Andrey a489c7d897 Rollback: remove NUMBER in enums. 2022-08-29 08:10:38 +03:00
Muzychenko Andrey 0092343861 Testing pull collaboration. 2022-08-29 08:02:13 +03:00
Alexis Murzeau dc828b01b8 translations: handle non existing translations gracefuly (don't crash)
Fallback to english if available, else return empty string
2022-08-27 22:36:44 +02:00
Alexis Murzeau 4f25a25802 translations: remove NUMBER in enums 2022-08-27 22:36:44 +02:00
Alexis Murzeau ab1b3d400f 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.
2022-08-27 22:36:43 +02:00
Alexis Murzeau d8ae03d281 Fix crash when the font file doesn't exist 2022-08-27 22:36:42 +02:00
Alexis Murzeau ea4e143405 translations: rename enums and avoid macros 2022-08-27 22:36:37 +02:00
Alexis Murzeau ead8ac2c18 translations: remove includes that are already in pch.h 2022-08-27 22:36:13 +02:00
Alexis Murzeau 95ed735269 Add font configuration (to be able to use non-latin languages) 2022-08-27 22:36:13 +02:00
Alexis Murzeau aa58379c56 Add translations from v1 2022-08-27 22:36:06 +02: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
stech11 (SoftOrange Tech) e9a4791322
Update README.md (#147) 2022-08-09 10:21:01 +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
Federico Matteoni 1a610ba831
Added fexed's Android port (#143)
Forked from iscle's port
2022-07-06 09:47:47 +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
guijan cdf0216136
cmake: use ${CMAKE_SOURCE_DIR} in install() (#137) 2022-05-04 08:48:42 +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
Stefan 0f88e43ba2
AmigaOS 4 port (#132) 2022-03-31 12:44:03 +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
Stefan 29c84c37c8
MorphOS port (#128) 2022-01-26 08:15:41 +03:00