Commit Graph
553 Commits
Author SHA1 Message Date
Brandon Wandteejusb 5c2d745302 Fix looping logic when the final frame can't display.
Additionally, adjust the destruction order of the movie texture and
improve logging.
2025-04-03 23:00:06 -07:00
dinandteejusb ecf7757bd3 swap to pragma for MSVC 2025-03-30 08:05:37 -07:00
dinandteejusb ae294e7cfb bitstruct pacdrive fix 2025-03-30 08:05:37 -07:00
dando92andteejusb 44c156f8cf Removed TODO in pacdrive 2025-03-27 22:36:29 -07:00
dando92andteejusb 871e25c5a8 Cleaned log and converted int ptr to vector. 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb a6c2a5bc2a Added list of pids instead of single pid. Read returns back -1 when in error 2025-03-27 22:36:29 -07:00
dinandteejusb 0b13eb17f2 pacdrive hidapi implementation 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb 63a68ae38a do not evaluate driver logic when HidDevice has not found at least once (bluedot, snek and stac) 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb 35714a0a04 Fixed bluedot driver 2025-03-27 22:36:29 -07:00
dando92andteejusb 762041be69 Bugfix: Always setting light, woops 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb cf453007e0 Moved everything to initializer list 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb 1259c0e318 Modified HidDevice after some testing. Added HidDevice to snek and stac 2025-03-27 22:36:29 -07:00
dando92andteejusb 1568305353 Modified bluedot driver to use HidDevice class 2025-03-27 22:36:29 -07:00
dinandteejusb 1e62bec650 hidapi: snek & stac support 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb d3f985fbee WIP Modified stac light driver. testing needed and it is not linux only anymore 2025-03-27 22:36:29 -07:00
DANDO\Alessandteejusb 288c1e527e Added bluedot light drivers 2025-03-27 22:36:29 -07:00
teejusb ad2f895df1 Reset the clock_ to 0 instead of 0.5 2025-03-23 10:07:27 -07:00
Luca Silvaandteejusb 91eccae6c7 fixed sextestream for windows 2025-03-21 03:38:38 -07:00
sukibabyandteejusb 5326808f38 Revert "(Win32 refresh) LoadingWindow_Win32"
This reverts commit afc3083b3e.

Revert "be 32 bit"

This reverts commit 4d8d22d223.
2025-03-02 15:05:31 -08:00
Thomas Calvertandteejusb 1409bbcadf fixup: fix memory leak 2025-03-02 11:41:43 -08:00
Thomas Calvertandteejusb fe3e73ae0d Linux: Detect joystick hotplug
Interface with libudev to get notified when a new joystick appears.

The code is in IH_Linux_Event rather than IH_Linux_Joystick because it
seemed like the former uses evdev (standard for most devices nowadays)
whereas the latter uses the old joydev API. The result should be the
same in any case...

Implementation is a bit messy due to LinuxInputManager only scanning for
devices from its constructor, this forces RageInput to have an exception
for LinuxInputManager. Possibly with more involved surgery a cleaner
solution could be devised...
2025-03-02 11:41:43 -08:00
sukibabyandteejusb 4f4167e3c7 Fix DirectSound and set it to default on Windows.
I've fixed the issues with the DirectSound driver which a number of commits from 2016 attempted to address. Additionally, build testers strongly prefer the fixed DirectSound to WaveOut (the current default driver for Windows) in terms of both game stability and sync stability, so I'm making it the default driver as well.

StepMania commit 75a9532 from 2006 had a subtle error, the declaration of len and locked_buf will hide the previous local declaration of these variables. The issues causing the DirectSound driver to be unreliable in terms of sync were due to this. This PR renames the variables from the 2006 commit to prevent this, and also ensures all variables are properly initialized.

Renamed `locked_buf` and `len` in `MixerThread` to `locked_buf_init` and `len_init` to avoid shadowing.

Prevent use of uninitialized member variables by initializing `m_pPCM`, `m_iSampleRate`, and `m_bShutdownMixerThread` in the constructor.
2025-03-02 09:11:25 -08:00
sukibabyandteejusb 5673d84567 undo whitespace changes in Threads_Win32 2025-03-02 09:04:34 -08:00
sukibabyandteejusb 1b258a4a00 use ExitThread instead of TerminateThread
Preferred in Windows, especially when we can't guarantee that we are able to perform a proper clean-up before terminating. Halt may be called with the Kill flag which indicates everything must shut down. This is the preferred approach in the Windows API.

Another preferred option is to use WaitForSingleObject with a timeout, but Halt with the Kill flag is being called when the game is about to crash, so that's not a realistic option and may cause the program to hang indefinitely.
2025-03-02 09:04:34 -08:00
sukibabyandteejusb 1da7f6167f (Win32 refresh) Threads_Win32
This file handles OS side interaction as well as the creation of threads within the game -  std::unique_ptr and std::mutex are introduced here for their safety and memory management benefits.

A custom wrapper PortableSignalObjectAndWait was removed in favor of directly calling SignalObjectAndWait.

In SetThreadName, we change from EXCEPTION_CONTINUE_EXECUTION to EXCEPTION_EXECUTE_HANDLER as suggested by the compiler to avoid a potential infinite loop.

ThreadImpl_Win32::Halt has been refactored to unequivocably call SuspendThread instead of TerminateThread, as TerminateThread doesn't allow for proper thread cleanup.

Don't bother with the try-catch in SetThreadName unless this is a debug build (since exceptions are disabled in ITGm, so it won't work as expected).
2025-03-02 09:04:34 -08:00
teejusb 97c2f36491 Remove g_bInputLinuxOrderByLocation preference 2025-03-01 23:25:47 -08:00
dinandteejusb f0394b721e sort by location 2025-03-01 23:25:47 -08:00
sukibabyandteejusb 4d8d22d223 be 32 bit 2025-02-26 11:07:54 -08:00
sukibabyandteejusb afc3083b3e (Win32 refresh) LoadingWindow_Win32
Speed up the loading window. SetPixelV is slow.  No perceptible difference in loading window behavior, but is faster.  The goal here is to alleviate the case where the loading window is the bottleneck when loading songs on a fast computer.
2025-02-26 11:07:54 -08:00
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