Commit Graph

36996 Commits

Author SHA1 Message Date
Patrik Nilsson 039bede4d1 Remove one trailing whitespace 2025-06-01 08:37:19 -07:00
Patrik Nilsson 7d398919a0 Address review feedback and improve code style
- Moved end-of-line comments to preceding lines for better readability and to avoid potential line length issues across various files modified in previous commits.
- In the RageSoundReader_Chain constructor: Removed redundant initialization of m_iPreferredSampleRate. Replaced hardcoded 44100 with kFallbackSampleRate. Removed an unnecessary comment.
- Added braces consistently to single-statement if/else blocks across all recently modified sound system files. This enhances code clarity and maintainability by explicitly defining block scopes.
2025-06-01 08:37:19 -07:00
Patrik Nilsson 72c7316671 Centralize fallback sample rate with kFallbackSampleRate
Replaces hardcoded 44100Hz values (used as fallbacks or for the "Default" sample rate preference) with a new constant `constexpr int kFallbackSampleRate = 44100;` defined in RageSound.h.

This constant is now used in:
- RageSoundReader_Silence
- RageSoundManager (for unloaded driver scenarios)
- All sound drivers' initialization logic for the "Default (0)" preference (DSound, WaveOut, AU, PulseAudio, OSS, WDMKS, Null)
- DSound primary buffer setup.
2025-06-01 08:37:19 -07:00
Patrik Nilsson c42501ba65 Add "Audio Sample Rate" option with translations
The English display name for the option has been updated to "Audio Sample Rate" for better clarity. Translations for this new option title have been added for Spanish, French, German, Japanese, Korean, Dutch, Polish, Slovak, and Traditional Chinese.
2025-06-01 08:37:19 -07:00
Patrik Nilsson 2e18b57da0 Implement configurable Sample Rate in options
Key changes:
- Added "Sample Rate" to `ScreenOptionsGraphicsSound` with choices:
    - "Default" (resolves to 44100 Hz for now)
    - "44100 Hz"
    - "48000 Hz"
- Created a new ConfOption "PreferredSampleRate" in `ScreenOptionsMasterPrefs.cpp` mapping UI choices to the integer values (0, 44100, 48000) for the existing `m_iSoundPreferredSampleRate` preference.
- Updated relevant sound drivers:
    - DirectSound (RageSoundDriver_DSound_Software): Primary buffer now attempts to use the preferred rate. Secondary buffers already handled it correctly.
    - WaveOut (RageSoundDriver_WaveOut): Already handled 0 as 44.1kHz correctly.
    - PulseAudio (RageSoundDriver_PulseAudio): Ensured m_InitStream uses the constructor-initialized rate based on preference.
    - AudioUnit (RageSoundDriver_AU): Already handled 0 as 44.1kHz and attempts to set hardware rate.
    - OSS (RageSoundDriver_OSS): Updated to read and apply the preferred sample rate.
    - WDMKS (RageSoundDriver_WDMKS): Updated to pass the resolved preferred rate to its stream opening logic.
    - Null (RageSoundDriver_Null): Already handled 0 as 44.1kHz correctly.
- Updated `RageSoundReader_Chain` constructor to use the preferred system sample rate for its internal default.
- Added English localization for the new option title and explanation.

The implementation ensures that if the preference is 0 (Default), the system currently defaults to 44100 Hz across all drivers. This lays the groundwork for future dynamic hardware rate detection. A game restart is recommended for the new sample rate to take full effect.
2025-06-01 08:37:19 -07:00
Patrik Nilsson af127ca23b Audio: Update default sample rate to 48kHz to mitigate sync issues 2025-06-01 08:37:19 -07:00
Sergio Perez Fernandez 2517959050 do not write any logs in disk when LogToDisk=0 2025-05-30 13:51:09 -07:00
sukibaby b3c43c9dea link to the simply love repo from the readme 2025-05-30 13:49:03 -07:00
sukibaby 1e667de589 Use a range-based for loop to avoid manual iterator handling 2025-05-28 14:56:29 -07:00
sukibaby 281cd8cb51 Change the video looping log to Info level.
Doesn't need to be written to disk right away every time a video loops.
2025-05-27 22:27:21 -07:00
Scott Brenner 7a3fa88c7a Update src/RageSoundReader_ChannelSplit.cpp 2025-05-25 21:09:54 -07:00
Scott Brenner 6cdf64afc8 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:54 -07:00
Scott Brenner 24fce53629 Update src/RageSurfaceUtils.cpp 2025-05-25 21:09:32 -07:00
Scott Brenner 146702430b Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:32 -07:00
Scott Brenner fc2d5dbf17 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:09:01 -07:00
Scott Brenner 7ff2002bec Update src/RageSurfaceUtils.cpp 2025-05-25 21:08:36 -07:00
Scott Brenner f0908b58ad Fix for code scanning alert no. 479: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 21:08:36 -07:00
sukibaby b0acfb362e don't upload VS2022 Code Analysis indicators
Visual Studio filetype; is an empty file.
2025-05-25 10:48:59 -07:00
Scott Brenner 57d54a0c89 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:31:23 -07:00
Scott Brenner 90176a1f1c Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:29:25 -07:00
Scott Brenner 72b3590097 Fix for code scanning alert: Multiplication result converted to larger type
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-25 00:28:38 -07:00
Scott Brenner f4da59e7e3 Update nightly.yml 2025-05-25 00:27:18 -07:00
Scott Brenner 6e4974f7f1 Update ci.yml 2025-05-25 00:27:18 -07:00
teejusb 44f5d8932a Include <utility> for std::swap 2025-05-23 23:39:55 -05:00
sukibaby 7792a82e7a OS-agnostic log warning for invalid sound driver entry. 2025-05-23 19:49:42 -07:00
teejusb 8edc14febf Update libpng and zlib to fix Mac builds 2025-05-23 19:48:00 -07:00
sukibaby 45925badfd Update Windows build flags
/MP2 limits the build processes to a maximum of 2. Many CPU's nowadays have more than two cores, so the integer specifier is removed so that the build is not artificially constrained to two cores.

/FS allows multiple compiler processes to write to the .pdb file; it should be used in conjunction with /MP to speed up the build.

/permissive- disables certain MSVC-specific extensions and follows the C standard more closely. Using this flag should help to ensure behavior matches gcc & clang a little more closely.

Note, /utf-8 does NOT build the program with Unicode support. It merely indicates to the compiler that the source files are using UTF-8 encoding.
2025-05-23 19:47:21 -07:00
sukibaby 71cb44bde3 Make SetThreadPrecedence return a std::string 2025-05-22 20:08:56 -07:00
sukibaby 6a29f651c7 Remove implicit conversion operator from RString to const char* (macOS)
Tested via CI (don't have a Mac).
2025-05-22 20:08:56 -07:00
Scott Brenner 7405eea171 Remove architecture from artifact name 2025-05-22 18:43:37 -07:00
din 0e00f57e45 sample udev rules to include hidapi 2025-05-22 11:42:50 -07:00
din 69f6a14935 additional HidDevice logging error conditions 2025-05-22 11:42:50 -07:00
Yauhen Artsiukhou 0a08f8175e Run nightly builds only for the beta branch 2025-05-22 11:41:56 -07:00
Yauhen Artsiukhou 36e2dcbce8 Bring LinuxPacDrive back as GenericHID lights driver
This is actually generalized old LinuxPacDrive driver. It kept here for backward
compatibility. So people have time to migrate on better new implementation.

Set LightsDriver to "PacDrive" to test the new driver.

GenericHID uses USB libusb_control_transfer to send data (4 bytes) over the wire where first 2 are
lights state. So any HID-like usb device can read the data and control lights.
2025-05-22 11:40:50 -07:00
Scott Brenner b77a6af416 Set fail-fast: false 2025-05-22 09:07:48 -07:00
Scott Brenner a72bcd867e Note access for nightly builds 2025-05-17 16:59:00 -07:00
teejusb c18e7a68ae Add pack.ini file paths to error messages 2025-05-17 14:08:13 -07:00
Arthur Eubanks 995f0ea8c1 Change some RString methods to free functions
These ones aren't a std::string method. Doing this helps the RString to
std::string migration.
2025-05-17 14:02:12 -07:00
teejusb 9449317430 Update Cel's BottomCaps 2025-05-17 13:43:07 -07:00
teejusb 8a1a71b099 Update enchantment mine graphic 2025-05-17 13:37:40 -07:00
teejusb eaf6a24acf Ensure CodeNames sizes are the same even on invalid codes 2025-05-17 13:03:41 -07:00
teejusb 82e4d201d4 Add Robot and ITG Vivid noteskins 2025-05-17 12:52:03 -07:00
teejusb e1c91e66f0 Remove the +Alt message for autoplay -- this feature had been removed 2025-05-17 12:22:18 -07:00
teejusb a780bdb7be Add Assist Clap text to the overlay 2025-05-17 12:19:21 -07:00
Arthur Eubanks ecfcb11a00 Remove implicit conversion operator from RString to const char*
This is required for the RString to std::string migration.

Mostly automated from https://github.com/aeubanks/rewriter/blob/main/c_str.cc, with some manual intervention required for fixing up `a + b.c_str()` to `(a + b).c_str()`.

Added some overloads for some common global functions like sm_crash to reduce the number of changes required here.
2025-05-15 21:14:54 -07:00
Scott Brenner 6a981ac5f7 CI - replace Windows installation step with microsoft/setup-msbuild 2025-05-13 21:41:27 -07:00
sukibaby 25b57c13d5 Replace some lrint's with GetTimeSinceStartSeconds()
Optimization to avoid several stages of integer-to-float and float-to-integer by making use of GetTimeSinceStartSeconds().
2025-05-10 10:09:44 -07:00
sukibaby d3ff9a0683 Replace GetRandomInt()
RageUtil already had a RandomInt function, this wasn't needed after all.
2025-05-10 09:27:05 -07:00
Michael Votaw b7bafbef93 Added note about checking dwi chart length of at least 2 characters 2025-05-10 09:22:01 -07:00
Michael Votaw 977f83a16f Bail out earlier when dealing with certain types of malformed DWI charts. 2025-05-10 09:22:01 -07:00