Commit Graph
524 Commits
Author SHA1 Message Date
sukibabyandteejusb cc5670e8d1 Remove GotoURL
"Report" button has not been removed from CrashHandlerChild / Crash.mm / DialogDriver_Win32, but functionality has been removed.
2025-01-25 23:53:44 -08:00
Rafał Florczakandteejusb 96ee25800a Use size_t and the respective %zu specifier for size-related variables
This change eliminates various compilation warnings and extra casts.
2025-01-15 08:22:21 -08:00
Brandon Wandteejusb ff8e018fbf Fix a case where we receive no hints on the number of frames in a file. 2024-12-08 08:07:20 -08:00
Yauhen Artsiukhouandteejusb ada419f1ff Fix lights driver regression after restart button added
Relates pull: #347
2024-12-04 12:59:20 -08:00
sukibabyandteejusb 7b45a5f599 RageTimer bug fix
Fast data types are good for audio processing, but not so much for timekeeping. This PR should resolve a number of smaller issues.
2024-12-04 09:41:26 -08:00
Brandon Wandteejusb 98b7f28c26 Fixes for Google style guide. 2024-11-06 01:20:31 -08:00
Brandon Wandteejusb 1626398244 Fix for movies shorter than the buffer size. 2024-10-22 16:45:24 -07:00
sukibabyandteejusb a6a60e2e56 Remove std prefix from int types
std::int* -> int*
2024-10-08 20:52:52 -07:00
Yauhen Artsiukhouandteejusb 59e6e94cf3 Embed libusb 1.0 into project 2024-10-06 17:43:13 -07:00
sukibabyandteejusb 659cd549a2 Remove std prefix from uint types
std::uint*  ->  uint*
2024-10-05 19:25:41 -07:00
sukibabyandteejusb 584fca49b7 Remove low_sample_count_workaround
No longer needed now that hardware clamping methods are corrected.
2024-10-01 13:03:06 -07:00
sukibabyandteejusb c297f73f69 Revert "Run as "High Priority" on Windows"
Revert "Run as "High Priority" on Windows"

This reverts commit 3f8a7f5fd3.
2024-10-01 01:49:22 -07:00
sukibabyandteejusb e0b254968d std::size_t -> size_t
Removing std prefix from all size_t.
2024-10-01 01:46:26 -07:00
sukibabyandteejusb abf89ec2b1 Replace SAFE_DELETE / SAFE_DELETE_ARRAY macros
SAFE_DELETE -> RageUtil::SafeDelete
SAFE_DELETE_ARRAY -> RageUtil::SafeDeleteArray

Update JsonUtil.h to include RageUtil.h - MSVC doesn't need it included for some reason, but GCC and XCode does.
2024-09-30 15:13:32 -07:00
sukibabyandteejusb 0aa41b305d Make static vectors of default driver lists
Currently we are storing the default driver lists as a macro, and splitting them into RString vectors every time they are needed. This commit changes the macros in `arch_default.h` into vectors of RStrings, so that they do not need to be split each time.

I have updated all references where the default driver lists are being called so that the vector is used directly.

A new function is added to RageUtil to make a compatible vector of RStrings from user input which may be separated with a comma.

RageSoundDriver was refactored to check user input in Preferences.ini against the default driver list, and in case of incorrect spelling or failure, provides a detailed error message (including a list of valid options) in logs so the user can resolve the problem.

`fix_bogus_sound_driver_pref` is no longer needed, since we are now telling the user what their valid options are if the user provides an incorrect entry for the `SoundDrivers` preference, instead of silently attempting to guess what the user wanted. Since I think it's rare that someone wants to specify a driver to begin with, we should let them know their exact options if they put something wrong here, instead of silently failing or using an unwanted driver.

I tested this on Windows by specifying `DirectSound-sw` in Preferences.ini, and it worked as expected. I also tried putting an unusable value in, and got the error in logs letting me know what my valid driver options were. Of course, input and movies all work as expected too.
2024-09-22 10:51:58 -07:00
Brandon Wandteejusb 804b15959d Implement sliding window between AVPackets and AVFrames, to save memory. 2024-09-22 10:51:01 -07:00
sukibabyandteejusb eb35a9b9af Switch from Float to Integer Time Values
- Use fast data types where possible so the compiler can optimize for speed based on platform
    - for example, 128 bits might be fastest on ARM
    - good future-proofing

- Refactor GetTimeSinceStart() to be a bit faster
    - multiplication is much faster than division

- Implement a RageTimer method to get the seconds value as a plain int, for the places which cast the seconds value to an int

- Changing from GetTimeSinceStartFast() to GetTimeSinceStart() where accuracy is important

- Changing from GetTimeSinceStart() to GetUsecsSinceStart() for timestamp diffs

- Adjust RageThreads to accomodate an unsigned timestamp value
   - a constant for the maximum value of `uint_fast64_t` replaces `-1` to accommodate the change from signed to unsigned for the `locked_at` variable
   - i have separate constants for `std::numeric_limits<std::uint_fast64_t>::max()` and `static_cast<std::uint_fast64_t>(-1)`, so the reader understands -1 represents an error code, though they evaluate to the same value, so i could remove one of the two

- Add two methods to calculate the MMSSMsMs / MMSSMsMsMs time value from usecs directly instead of inferring it from a seconds value, in RageUtil

- Use a similar counter/modulo based method for WheelNotifyIcon, similar to what i did for text_glow in NoteField in 2eeee03

- Make `g_iStartTime` static const for safety

Rename two timer functions:
GetUsecsSinceStart -> GetTimeSinceStartMicroseconds
GetMicrosecondsSinceStart -> GetSystemTimeAsMicroseconds

Remove std prefix from uint_fast64_t
2024-09-22 01:27:45 -07:00
sukibabyandteejusb 53cd968b90 Removing bApproximate (part 2)
This should wrap up removing this flag from the code base.
2024-09-20 22:03:15 -07:00
sukibabyandteejusb 17a5823f45 Cease distributing Windows SDK files
1) Remove Win SDK headers directory (src/archutils/Win32/ddk)

2) Update files including Win SDK headers to instead use the version installed by Visual Studio Installer

3) Update INSTALL.md

Note: this commit does not enforce using a specific version of the Windows SDK, but does everything needed to use the locally installed Windows SDK instead of files distributed with the source code to enforce using a particular version.
2024-09-20 15:45:53 -07:00
dinandteejusb 44b2493046 off by one 2024-09-07 21:25:52 -07:00
dinandteejusb d3138b883f gamepad event rollover fix 2024-09-07 21:25:52 -07:00
sukibabyandteejusb 6b2a439aa5 Clean up Windows filesystem mount code 2024-09-05 12:09:58 -07:00
sukibabyandteejusb 241317ff29 Revert to 5.0.12's ClampHardwareFrame
Also adds `cinttypes` to support PRId64 / PRIu64 format specifiers, and switches to system-clock based time measurement in GetHardwareFrame
2024-09-04 20:17:20 -07:00
sukibabyandteejusb 21088502b9 Remove clamp macro
Doesn't really need to exist since  all it's doing is inlining std::clamp.
2024-09-03 20:50:48 -07:00
sukibabyandteejusb c2cd37fdd2 WaveOut 16x512 buffer instead of 8x1024
Both come out to the same amount of target latency (as does 32x256, etc) however RageSoundDriver.h defines samples_per_block as 512, so this aims to have chunksize_frames equal 512.

It also defines a constant to define the quantity of buffers so it's not hardcoded in various places and puts the variables in an anonymous namespace.
2024-08-26 17:59:59 -07:00
sukibabyandteejusb 7cf2501214 Update LightsDriver_SextetStream.cpp
Changes to SextetStream were necessary, as the define and class name caused name colissions.
2024-08-26 08:52:41 -07:00
sukibabyandteejusb 8872a6a5e3 Update InputHandler_DirectInput.cpp 2024-08-26 08:48:03 -07:00
Brandon Wandteejusb a3f3587c19 Fix style in MovieTexture_FFMpeg to match Google C++ style guide. 2024-08-25 12:52:34 -07:00
Brandon Wandteejusb 88511c59cb Use avcodec builtins for constructing and destroying AVFrame and
AVPacket, and switch FrameHolder to unique_ptr.
2024-08-20 21:09:25 -07:00
sukibabyandteejusb 5c847dbe45 Fix ArchHooks_Win32Static.cpp
1)   move file scope variables into an anonymous namespace

2)   properly bracket functions

3)   fix GetMicrosecondsSinceStart calculation
2024-08-20 21:00:00 -07:00
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