Commit Graph
494 Commits
Author SHA1 Message Date
sukibabyandteejusb d452ed9f21 Static cast m_FrameBuffer.size to int 2024-08-19 09:19:44 -07:00
sukibabyandteejusb 6b67a0c476 Fix two mutexes 2024-08-19 09:19:44 -07:00
Brandon Wandteejusb d74ad50707 Remove singlethreaded, old ffmpeg decoding code. 2024-08-10 15:44:06 -07:00
Brandon Wandteejusb eb8f76023e Allow frames that didn't decode to skip. 2024-08-10 11:48:20 -07:00
Brandon Wandteejusb d4ab7b12ed Consume background thread movie decoding. 2024-08-07 10:04:18 -07:00
sukibabyandteejusb b30bf85399 WaveOut: Reattempt to initialize on failure
If the device suddenly changes, like say an audio cable gets unplugged, this gives the game a chance to recover gracefully instead of just crashing.
2024-08-07 00:17:25 -07:00
sukibabyandteejusb a0d1198cc1 MixIntoBuffer optimization
Reduced risk of error as well, improved readability as well as improved performance due to removing a repeated calculation.
2024-08-07 00:15:22 -07:00
sukibabyandteejusb 5a0bfed42d Re-order Linux default audio driver list 2024-08-06 23:59:27 -07:00
Brandon Wandteejusb 10e4323e3e Add DecodeNextFrame and DecodeMovie functions to populate the
FrameBuffer.
2024-08-06 17:18:12 -07:00
sukibabyandteejusb 2fd1bff510 Threads_Win32 fixes
From top to bottom,

- Fix incorrect gcc implementation in `SetThreadName`
- Static Cast in `StartThread`
- Fix `MutexImpl_Win32::Lock()`
- Remove unnecessary pre-winXP methods in PortableSignalObjectAndWait()
- Static Cast in `EventImpl_Win32::Wait`
2024-08-06 15:31:24 -07:00
Brandon Wandteejusb 20452b244a Add FrameBuffer vector and decoding functions.
These functions are based on "DecodePacket" and "ReadPacket". This
PR does not consume the new buffer or decoding functions yet. It also
preps the class for adding a fast cancel to decoding, in the case that
the movie texture is destroyed while decoding is still happening.
2024-07-25 23:11:47 -07:00
Brandon Wandteejusb 23f7ebd476 Add FrameHolder struct and logic around finding totalFrames of movies. 2024-07-25 11:42:16 -07:00
Brandon Wandteejusb b2ada0ad61 Remove dshow movie rendering code.
It hasn't been built into the binary in years, not since before forking
itgmania.
https://github.com/itgmania/itgmania/blob/5d4f9dcb07493ed4c51d6be23e9b41978162305a/src/CMakeData-arch.cmake#L81-L91
https://github.com/stepmania/stepmania/blob/d55acb1ba26f1c5b5e3048d6d6c0bd116625216f/src/Makefile.am#L388

This helps to consolidate the movie rendering code into one main
rendering path.
2024-07-13 21:50:24 -07:00
sukibabyandteejusb 0447d9ae58 Consistency in Windows ifdefs/windows.h includes
Changing all defined(_WINDOWS) to defined(_WIN32)

Defining WIN32_LEAN_AND_MEAN in all files except those in Archutils/Win32
2024-06-24 15:48:05 -07:00
phantom10111andteejusb b365dcd65d PulseAudio: Hold mainloop lock during GetPosition() call
Mainloop lock needs to be held to access PulseAudio object from outside the
event loop thread, in particular in GetPosition() calls. Otherwise we might hit
a race condition and have the call fail. There's also a possibility that the
call might randomly fail if it's called before first timing data is received
for the stream, so handle that case as well.

Also fix the stream write callback to call Mix() with correct parameters, as
well as do the work in a loop in case pa_stream_begin_write() returns smaller
memory buffer than was requested.
2024-05-11 10:26:50 -07:00
phantom10111andteejusb bbf556450d X11: Don't call any X11 functions on fatal error
If X11 functions are called after a fatal error then it just triggers the fatal
error handler again eventually leading to stack overflow.
2024-05-11 09:46:26 -07:00
sukibabyandteejusb 3f8a7f5fd3 Run as "High Priority" on Windows
Enforcing HIGH_PRIORITY_CLASS is best for Win10+ where Windows Update can interrupt the game and it also prevents streaming apps (OBS/Discord) from causing stutter by taking rendering priority away from ITGMania.

Update ArchHooks_Win32.cpp
2024-05-10 00:33:36 -07:00
sukibabyandteejusb 3d63d80163 Always use CLOCK_MONOTONIC if it's available on Unix 2024-05-08 10:37:17 -07:00
sukibabyandteejusb f7a7252dbb Replace timeGetTime() with QueryPerformanceCounter()
Update ArchHooks_Win32Static.cpp

This code provided a 7x accuracy improvement over timeGetTime(). (0.2ms vs 1.4ms std dev*3)

Rename variables to fit with existing naming mechanism
2024-05-07 17:57:47 -07:00
Gareth Francisandteejusb 99e3d10775 Reduce rate of X11 screensave interrupt to once/minute 2024-04-19 00:29:35 -07:00
Arthur Eubanksandteejusb bdafbd4660 Fix some clang warnings
-Wunqualified-std-cast-call and -Wsign-compare.
2024-04-17 00:20:03 -07:00
phantom10111andteejusb 481161574e PulseAudio: Report actual audio playback position
PulseAudio driver used to report position of last frame written to audio stream
instead of actual playback position. This kind of worked, since on average the
write position doesn't diverge too much from actual elaped time, but it can
result in note stuttering and in general isn't very accurate. Change the
implementation to use actual playback position from PulseAudio stream.

Remove some compatibity code with old PulseAudio, since version 0.9.10 was
released in 2008.

Also, as an optimization to avoid unnecessary memory copying, use
pa_stream_begin_write() to mix audio directly into PulseAudio memory.
2024-04-12 22:40:41 -07:00
Gareth Francisandteejusb befae57e73 InputHandler_Linux_Joystick cleanup 2024-04-10 20:17:11 -07:00
Gareth Francisandteejusb ef86cbbda3 Remove limit of 4 joysticks in InputHandler_Linux_Joystick 2024-04-10 20:17:11 -07:00
glitchbearandteejusb ad5f3e0653 Windows support for fullscreen borderless window mode 2024-03-02 23:47:12 -08:00
Sergio Pérez Fernándezandteejusb ec33a08ca5 Renamed LinuxInputJoysticks to InputDeviceOrder 2024-02-21 12:29:26 -08:00
Sergio Pérez Fernándezandteejusb 5753ecdc1c Add LinuxInputJoysticks parameter to Preferences.ini to ensure pad order consistency 2024-02-21 12:29:26 -08:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Martin Natano aa87f85eef Decouple <cstdint> 2023-04-21 22:13:41 +02:00
Martin Natano 0b0787f344 Replace COMPILE_ASSERT() with standard static_assert() 2023-04-20 11:21:29 +02:00
Martin Natano 78fb2e9fc3 Decouple <cstddef> 2023-04-20 11:21:29 +02:00
Martin Natano 093675cdc3 Use attributes where possible 2023-04-20 11:21:29 +02:00
Martin Natano b68ca517e6 Clean up math functions
- Remove checking for standard functions from the build system
- Prefix all invocations with std::
- Replace suffixed functions with unprefixed versions
- Include <cmath> in all files that use it and remove the global include

e.g. floorf(x) -> std::floor(x)
2023-04-19 19:31:40 +02:00
teejusb 20854530ed Rename the file to LightsDriver_LinuxPacDrive 2023-03-15 22:20:02 -07:00
dinandteejusb 2feaa6a90e PacDrive Order added w/information 2023-03-15 22:20:02 -07:00
teejusb 4e19ce0d5d Add Linux Pacdrive 2023-03-10 10:19:08 -08:00
teejusb c2b9b09418 Allow Windows users to select a device to use with WaveOut 2023-02-18 09:00:58 -08:00
Brian Phlipotandteejusb d079940fea Address PR feedback. 2023-02-02 11:54:17 -08:00
Brian Phlipotandteejusb 4a6b1a743c Enable more compiler warnings and treat them as errors. 2023-02-02 11:54:17 -08:00
teejusbandcamsta4 bdb067764a mmmagic.dll -> mmmagic64.dll
Co-authored-by: camsta4 <[email protected]>
2022-12-19 20:19:16 -08:00
teejusb ef144a7f9d Remove WITH_MINIMAID CMake option
Always build ITGmania with Minimaid

There's no harm in always having this built as it's configurable based on the LightsDriver field.

Update mmmagic.dll -> mmmagic64.dll to conform with the new dll filename

Also fix PacDrive.h header
2022-12-19 20:19:16 -08:00
Brian Phlipotandteejusb a0e805e511 Add std:: prefixes to all shuffle calls. Use unique_ptr instead of shared_ptr. 2022-10-03 16:21:19 -07:00
Brian Phlipotandteejusb 95e55f5cdd Last RString MSVC compiler error. Eliminate gotos to fix more MSVC compiler errors. 2022-10-03 16:21:19 -07:00
Michael SundqvistandMartin Natano 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
Martin Natano 61f12e8165 Prevent out-of-bounds array access
Fixes https://github.com/itgmania/itgmania/issues/27
2022-06-27 20:10:52 +02:00
teejusb 7d88febd51 Switch to loading the PacDrive64.dll + Update Default 2022-06-21 12:22:29 -07:00
Martin Natano 2e8f906aa8 Return AVERROR_EOF in case of EOF to prevent game freeze 2022-06-08 12:13:51 +02:00
Martin Natano c40985122e Remove workarounds for ancient MSVC versions 2022-06-07 22:49:05 +02:00
Martin Natano 838de6fb81 Remove support for mingw
MSVC works fine and the bundled mingw libraries are outdated.
2022-06-07 22:49:05 +02:00
Martin Natano 1da34b9ba2 Remove WITH_TTY build option
TTY input doesn't seem very useful and the code is broken (requires SDL,
which is not picked up by cmake). The option was disabled by default
too. I doubt anyone is using this.
2022-06-07 22:49:05 +02:00