37034 Commits

Author SHA1 Message Date
teejusb 368c257e95 Rename to rate_scaling_enable_ + Expose functions to lua 2025-03-02 10:34:28 -08:00
Brandon W 9789ef9697 Give actors the ability to undo the rate change triggered by holding
tilde or tab.

This is gated by a new boolean, `tab_tilde_scaling_enabled_`, and
applied only to banners by default.
2025-03-02 10:34:28 -08:00
sukibaby 2feb9e784c RageSoundReader_Merge fixes
This is the fixed Merge from the 2025-1-26 test build. It will more strictly check the drift with each iteration of the m_aSounds loop, whereas the original implementation can allow small amounts of desync to accumulate over time if none of them exceed the threshold.
2025-03-02 09:13:31 -08:00
sukibaby 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
sukibaby 5673d84567 undo whitespace changes in Threads_Win32 2025-03-02 09:04:34 -08:00
sukibaby 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
sukibaby 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
sukibaby 3f348117e2 (Win32 refresh) GetFileInformation, DebugInfoHunt
DebugInfoHunt was also updated since GetFileInformation directly uses it.

- GetMemoryDebugInfo is updated as GlobalMemoryStatus is deprecated.
- GetWindowsVersionDebugInfo is updated to use RtlGetVersion.
- GetFileInformation updated to use vector and string, as well as const correctness and modern  Windows methods. Mostly removing Win9x-XP compatibility code.
- Also gets rid of some workarounds aimed at XP era versions of Visual Studio.

Fix a mistake in Windows version detection logic
2025-03-02 08:51:21 -08:00
Rafał Florczak 8f8064c8fa Add ARM builds to the pipeline 2025-03-02 08:41:35 -08:00
sukibaby a7477a6c56 Better type choices, comment improvements, adding missing braces, removal of dead code. 2025-03-02 08:40:36 -08:00
sukibaby 94eb8d2a7f Vector based RageSoundMixBuffer
Bringing in algorithm for std::copy, and vector for automatic memory management.

Initializing the buffer with zeroes in the same operation as resizing the buffer. Going back to using an unsigned int for realsize, to prevent the buffer from becoming an unreasonably large size.

The constructor and destructor can be empty since the vector<float>'s own destructor will take care of freeing allocated memory.

The static_cast to an int in read(int16_t *pBuf) is changed to a static_cast to an int16_t, as audio data is expressed in 16 bit integers, and the fractional part is inherently rounded towards zero by truncation.
2025-03-02 08:40:36 -08:00
teejusb 97c2f36491 Remove g_bInputLinuxOrderByLocation preference 2025-03-01 23:25:47 -08:00
din f0394b721e sort by location 2025-03-01 23:25:47 -08:00
sukibaby 4d8d22d223 be 32 bit 2025-02-26 11:07:54 -08:00
sukibaby 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
Crash Cringle b6a08130ab When using auto set style we need to ensure that we're showing all the songs that we're telling the user that they're able to see.
- If AutoSetStyle is true then we're showing all compatible styles at once (compatible styles determined by number of players joined)
- Sooooo if 1 player is joined then we'd see Singles, Doubles, & 3-panel charts. (Maybe solo as well?)
- If 2 players are joined we'll see Singles (versus), Routine, and couples charts.

This needs to be reflected in the music wheel so that we're seeing songs with compatible styles. Previously it was checking if the song had steps in the current style which doesnt really apply for AutoSetStyle being toggled.

(cherry picked from commit 1fc4a805b497aa93a965547c688844a30018527a)
2025-02-12 20:04:53 -08:00
Rafał Florczak 0d32709f76 Revert "Migrate to universal build for macOS"
This reverts commit b938ac449f.
2025-02-11 23:37:59 -08:00
sukibaby 4601da4ab9 Update RageUtil::power_of_two
Replacing the SM5 power-of-two code with the implementation from Bit Twiddling Hacks, since the current implementation isn't correctly handling the edge case where the input is 0, and is a little overcomplicated.
2025-02-11 22:55:29 -08:00
D.J. Rideout f2809028de Refactor SwitchToDifficulty/SwitchToPreferredDifficulty 2025-02-11 21:48:54 -08:00
D.J. Rideout ae2f4060f5 If sort order is SORT_METER, select the highest difficulty matching the meter of the current section when scrolling to a song. 2025-02-11 21:48:54 -08:00
Michael Votaw 9fd4c38efd Keep a temporary State object around instead of allocating and deleting one nearly every time initResultState is called 2025-02-11 19:39:03 -08:00
Michael Votaw 46c3442018 non-void functions should return values! 2025-02-11 19:39:03 -08:00
Michael Votaw b52ea2257b wrap global function in anonymous namespace 2025-02-11 19:39:03 -08:00
Michael Votaw 97cefc6d71 Reduce the precision of nps to 3 decimal places, and don't use ssprint to join all of it together (very very long charts would cause a stack overflow on Windows) 2025-02-11 19:39:03 -08:00
Michael Votaw 6a7dd95212 Removed ASSERTs. StepParityGenerator::analyzeNoteData() now returns a boolean to indicate whether it succeeded at analyzing the note data.
Fixed issue where getFootPlacementPermutations would return no permutations in some circumstances
2025-02-11 19:39:03 -08:00
Michael Votaw 4e7432a5a0 Several "structural" changes, and some memory optimizations:
- Replaced use of bare '-1' values with StepParity::INVALID_COLUMN
- Removed StepParityGraph object, moved its responsibilities to StepParityGenerator
- Removed some unnecessary data from State object, added 'combinedColumns' and 'whatNoteTheFootIsHitting'
- Created stateCache to allow reuse of state objects
- Fixed a very small bug with TechCounts (missing 'previousPreviousHeel != INVALID_COLUMN')
2025-02-11 19:39:03 -08:00
Michael Votaw 61ee3bc329 Replaced costs array with just a single cost value 2025-02-11 19:39:03 -08:00
Michael Votaw cbfd09658f Check that previousPreviousRightHeel is a valid column placement 2025-02-11 19:39:03 -08:00
Michael Votaw e5ccaca5f1 Removed use of this. Added additional comments from SL implementation. 2025-02-11 19:39:03 -08:00
Michael Votaw a2a2684d0f Remove VERSION_TECH_STATS, because we're not actually updating SSC version 2025-02-11 19:39:03 -08:00
Michael Votaw ea35af311e Reset FILE_CACHE_VERSION to 228 2025-02-11 19:39:03 -08:00
Michael Votaw 6917d51d4d Replacing spaces with tabs 2025-02-11 19:39:03 -08:00
teejusb 49263f3c3e Mostly stylistic changes 2025-02-11 19:39:03 -08:00
Michael Votaw 53ebe4cce1 Removed now unnecessary tracking of previous/current foot placements (we can get this from row.whereTheFootIs).
Add full and half crossovers
2025-02-11 19:39:03 -08:00
Michael Votaw c9af5d78a3 fix typo (missing comma) 2025-02-11 19:39:03 -08:00
Michael Votaw c7af0a4436 Integrated noteCount, whereTheFeetAre, and columns into Row object (makes tech counts a little cleaner) 2025-02-11 19:39:03 -08:00
Michael Votaw 212b99a4c5 Changed StageLayout into a struct and consolidated layout math functions into it.
Added convenience methods for determining if a given column is an up, down, or side arrow.
Added explicit tech counts for up footswitches and down footswitches
2025-02-11 19:39:03 -08:00
Michael Votaw 36c4223a38 Destroy array of costs after we're done with them 2025-02-11 19:39:03 -08:00
Michael Votaw d5817b6264 Fixed typo (missing semicolon) 2025-02-11 19:39:03 -08:00
Michael Votaw 5f7720a8b8 Added costs for "slow" bracketing (to prioritize jumps), twisted backwards foot.
Removed costs for JUMP, CROWDED_BRACKET, and OTHER
Added cutoffs for counting footswitches and doublesteps below a certain speed as tech
2025-02-11 19:39:03 -08:00
Michael Votaw f70cb4c6aa Jacks and Doublesteps don't count if they're preceded by a jump 2025-02-11 19:39:03 -08:00
Michael Votaw 033cb10f17 Footswitches don't count if it's just using a different part of the same foot. 2025-02-11 19:39:03 -08:00
Michael Votaw 9c959d7dee Cutoff for jacks is 170bpm 1/8th notes, and not after jumps 2025-02-11 19:39:03 -08:00
Michael Votaw ed2b5f8d5e Removing accidentally duplicated lua methods, un-needed SetGrooveStatsHash method (that's getting handled in a different PR) 2025-02-11 19:39:03 -08:00
Michael Votaw 905e44330a Added methods to load/write tech counts to cache. 2025-02-11 19:39:03 -08:00
Michael Votaw bd897b676a Replacing use of CalculateRadarValues with CalculateStepStats, and ReCalculateRadarValuesAndLastSecond with ReCalculateStepStatsAndLastSecond 2025-02-11 19:39:03 -08:00
Michael Votaw afa44ee4df Added methods for calculating and caching tech counts 2025-02-11 19:39:03 -08:00
Michael Votaw 6109105f97 Added TechCounts and all of the StepParity classes 2025-02-11 19:39:03 -08:00
Michael Votaw 10a4a972b0 Added method to NoteData to get number of mines at given row. 2025-02-11 19:39:03 -08:00
Michael Votaw 28270cee31 Made StepsTypeToString publicly available 2025-02-11 19:39:03 -08:00