Commit Graph

41 Commits

Author SHA1 Message Date
Muzychenko Andrey e2f3ae66f8 Added hide mouse cursor option.
Issue #181.
2023-07-11 15:34:51 +03:00
Muzychenko Andrey 466c875f8a Added a way to reset all game options.
Fixed some of the fragmented translations.
Improved input rejection in control dialog.
2023-02-17 13:35:18 +03:00
Muzychenko Andrey 9454e11fd9 Adjusted exit key: added shortcut binding, confirmation dialog. 2023-02-12 08:43:08 +03:00
Muzychenko Andrey 215599684c Options refactor part 3: added key bindings for menu shortcuts.
Issue #168.
2023-02-11 13:18:29 +03:00
Muzychenko Andrey 8df996f452 Options refactor part 2.1: fixed control option labels. 2023-02-10 08:46:09 +03:00
Muzychenko Andrey d99fbb092e Options refactor part 2: input bindings. 2023-01-27 16:25:47 +03:00
Muzychenko Andrey 10ff1143cc Refactored options: symmetric save/load. 2023-01-03 16:42:34 +03:00
Muzychenko Andrey 2d6f2c14e5 FT collision part1: AABB. 2022-12-28 08:47:44 +03:00
Muzychenko Andrey cfaab257ed Added debug overlay for ball sprite size cutoff points. 2022-10-11 12:45:03 +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 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
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 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 0a2d6847ba Added sound and music volume control.
Issue #120.
2022-01-12 17:17:38 +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 2229f9b70e Added hybrid sleep/spin wait mode. 2021-11-18 17:58:53 +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 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
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 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 b37f5d6d76 Fixed ShowMenu option interrupting ImGui::NewFrame. 2021-09-29 07:46:13 +03:00
prototux b843e9a6cb Added an option to show or hide the menu. 2021-09-29 02:21:21 +02:00
Muzychenko Andrey b4cb827d73 winmain: reworked main loop for smoother frame times.
imgui_sdl: added handling for device lost.
midi: load PINBALL.MID in uppercase and using absolute path.
Added UPS/FPS options, by default 120/60.
2021-09-28 08:14:18 +03:00
Muzychenko Andrey fd9de493e6 Added linear filter option for vScreen texture.
Rollback blit to backing storage – its persistence is not guaranteed.
Added project URL to About dialog.
Added source ports table to readme.
2021-09-23 12:16:58 +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 8bae7a5b05 Added user settings persistence.
Using ImGui .ini writer.
2021-09-16 10:57:46 +03:00
Muzychenko Andrey 2fe6d6d33a Removed windows.h dependency.
Added support for music in MDS format.
2021-09-06 16:27:58 +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 debe52c1e0 Added scalable window, mouse controls. 2021-02-09 18:09:44 +03:00
Muzychenko Andrey 1c5256a4c6 Added table resolution support.
Only works with FT .dat file.
FT music does not work - different format.
2021-02-06 16:53:47 +03:00
oz cd4679194c x64 build - no collision bug found(
Either lost in decompilation or introduced in x64 port.
2021-01-29 16:42:05 +03:00
oz 12066963f0 key mapper dialog, ready. 2020-12-13 16:05:19 +03:00
oz 090beefd07 timer v1, ready.
winmain uninit.
message_handler tweaks.
2020-12-04 18:35:47 +03:00
oz 9ffab95d8e winmain message_handler v1. 2020-12-02 20:12:34 +03:00
oz 7db64ae1c6 winmain v2.
fullscrn, pb v1.
2020-11-06 16:56:32 +03:00
oz 473ed6b9d9 winmain, memory, options v1. 2020-11-05 18:44:34 +03:00