Commit Graph

40 Commits

Author SHA1 Message Date
Muzychenko Andrey 8e43d06e84 Improved console output: added version constants and message box texts. 2022-12-02 08:21:08 +03:00
Low-power f561cadf63
Allow loading data files with lowercase name (#164)
* Allow loading data files with lowercase name

* Added lower case support for all game data files.

Co-authored-by: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com>
2022-11-22 12:40:50 +03:00
Muzychenko Andrey 4ec30cf472 Render tweaks part 3: bitmap/zMap pairs. 2022-09-29 14:45:14 +03:00
Muzychenko Andrey 42226a14c9 Simplified get_rc_string, merged pinball and pb. 2022-08-31 15:18:22 +03:00
Muzychenko Andrey 5e42f37fba Fixed sound duration for missing sounds.
Issue #140.
2022-06-14 11:46:11 +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 97aea20586 Renamed some collision variables. 2022-05-20 11:51:00 +03:00
Muzychenko Andrey d23444b983 Cleaning up maths: part 1.
Vector3 inherited from vector2.
2022-05-11 16:42:45 +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 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 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 2fe6d6d33a Removed windows.h dependency.
Added support for music in MDS format.
2021-09-06 16:27:58 +03:00
Muzychenko Andrey 9a10d72e1f gdrv: simplified bitmap, fixed blit, improved SDL present.
Removed some Windows dependencies.
2021-09-01 11:02:57 +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 d5b44e44e1 Improved wav duration calculation - now supports sample rates other than 11025.
Bumped build tool version to VS2019.
2021-08-18 12:44:26 +03:00
Muzychenko Andrey 98f234fce3 Replaced GlobalAlloc with malloc.
WaveMix keeps GlobalAlloc for authenticity.
Fixed float to double casts.
Some cleanup.
2021-02-18 12:53:25 +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 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
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 49f6132d23 Added loader for Full Tilt .dat files, v1.
Works with some data hacks in lowest resolution.
Seems to work ok, even though BL is still 3DPB.
2021-01-31 17:29:53 +03:00
Muzychenko Andrey 6ff457eb68 Cleaned up objlist_class. 2021-01-30 14:19:25 +03:00
oz 6756c54d3b splash ready.
All subs ready, phase 1 complete.
2021-01-29 14:24:49 +03:00
oz 262b098610 Some renames, cleanup partman, loader. 2021-01-28 18:01:26 +03:00
oz b0080fd80a Sound ready. 2021-01-23 19:28:29 +03:00
oz 7d15427dd9 midi ready, TCollision cleanup. 2021-01-23 13:33:30 +03:00
oz a143b820af TBall, nudge v1, ready.
render occlude list.
2020-12-27 18:19:36 +03:00
oz 99fba56a34 TPinballTable v2. 2020-12-25 16:46:06 +03:00
oz 3097edf526 TTableLayer v1. 2020-12-20 14:13:12 +03:00
oz a1678120f8 vector_type is 3 x float, TCollisionComponent v1. 2020-11-28 14:39:12 +03:00
oz 79bb0adab8 zdrv v1, ready. 2020-11-14 18:13:00 +03:00
oz 989ba6cdb2 gdrv, render v1. 2020-11-08 18:37:59 +03:00
oz 473ed6b9d9 winmain, memory, options v1. 2020-11-05 18:44:34 +03:00
oz 5e94b5b513 Score, PinbalTable, PinballComponent v1
Placeholders for T piball component classes.
2020-11-01 18:45:29 +03:00
oz c55f6e5b98 Loader v2, ready. 2020-10-30 15:26:00 +03:00
oz b3b4fb39ef Loader v1. 2020-10-25 17:17:26 +03:00