Commit Graph
36634 Commits
Author SHA1 Message Date
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 856f6b3058 Revert to the old RadianToDegree method
Doesn't seem to be getting called, but prefer to maintain the original behavior to reduce uncertainty.
2024-10-01 01:50:16 -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 8d125f3951 pos_map_backlog_frames optimization
The value was determined by profiling the `Cleanup` function as well as monitoring how frequent "Audio frame out of range" errors occurred. This provides an ideal balance of low latency and prevention of out-of-range errors.
2024-09-30 22:24:32 -07:00
Brandon Wandteejusb 7b2f0338b8 Add centering back into edit/practice mode playback. 2024-09-30 17:20:11 -07:00
sukibabyandteejusb bcd7e8e1d2 put the enum class back 2024-09-30 17:17:02 -07:00
sukibabyandteejusb af33f7d5c9 Indicate fallthrough to prevent a GCC warning
Without this here, GCC 11 and 12 will print a warning during compilation about a possible fallthrough, but we're doing that on purpose, so this simply adds an indicator to the compiler that we know what we're doing.
2024-09-30 17:17:02 -07:00
sukibabyandteejusb d13740ce33 Rename the StretchType enum in Actor
The lowercase enum is confusing because it looks like a variable. This prefixes it with a class name so it's easier to understand its purpose.
2024-09-30 17:17:02 -07:00
sukibabyandteejusb 8804607be4 ActorFrame: replace a switch with an if/else
More of a stylistic change than an optimization, but makes it easier to understand what's happening.
2024-09-30 17:17:02 -07:00
sukibabyandteejusb 93c15f9b15 Change ARROW_SIZE to a constexpr int 2024-09-30 17:17:02 -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
Brandon Wandteejusb cff063cd21 Fix routine chart loading/playback in EditMode. 2024-09-30 13:59:47 -07:00
sukibabyandteejusb 25f1bebf0e Fix a regression in BitmapText
Shouldn't have made this namespace as it complicates matters and breaks debug builds.
2024-09-27 20:25:39 -07:00
sukibabyandteejusb f5cb958f78 Delete src/archutils/Win32/ThreadPriorityHelper
unused
2024-09-27 12:47:44 -07:00
sukibabyandteejusb 01795ef948 fixes 2024-09-22 11:00:41 -07:00
sukibabyandteejusb b000887f76 Remove some macros related to Rainbow Mode
Should help allowing the compiler to properly optimize this operation, as these macros are only used here.
2024-09-22 11:00:41 -07:00
sukibabyandteejusb 080f95bf97 Expand BitmapText::UpdateBaseZoom()
The macro here is unnecessary.
2024-09-22 11:00:41 -07:00
sukibabyandteejusb 3b69a3179e Undefine CPY macro 2024-09-22 11:00:41 -07:00
sukibabyandteejusb 506adb80ba Standardize use of size_t
Instead of a mix of std::size_t and size_t. Not using the std prefix is more modern.
2024-09-22 11:00:41 -07:00
sukibabyandteejusb 934fc54b8a BitmapText::DrawPrimitives noexcept
This function indirectly determines the amount of average audio latency, this is why changes to BitmapText can affect global offset significantly. Aim to make the function as fast as possible to minimize latency.

1) make BitmapText::DrawPrimitives noexcept
   -  note: RollingNumbers::DrawPrimitives has to also become noexcept as a consequence

2) Define repeated calculations as constexpr functions defined within an anonymous namespace

3) Fix some formatting stuff
2024-09-22 11:00:41 -07:00
Brandon Wandteejusb 5bb277b5de Optionally load in P2 during PracticeMode playback.
Use the first PlayerNumber that comes in under export options, this fixes P2
loading by itself in PracticeMode.
2024-09-22 10:59:06 -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 221752215c Clean up RageSoundReader_Resample_Good
Increasing security and efficiency of math in order to prevent potential errors from occurring.

1.  L is a macro made to equal 8. It's only used in conjunction with other `int`'s, so it's safe to make into a constant called FILTER_LENGTH.

2.  Define a very tiny number to avoid a potential mistake in ApplyKaiserWindow.

3.  Define constants for BesselI0, making the functions easier to read but also improve security of the math.

4.  Make some variables const and prevent redundant calculations or variable creations in ApplyKaiserWindow and GenerateSincLowPassFilter.

5. Use `double` interally in GenerateSincLowPassFilter
2024-09-20 21:56:32 -07:00
sukibabyandteejusb 5b0323b0e3 Update README.md for GPLv3 2024-09-20 21:37:52 -07:00
sukibabyandteejusb efa835c448 Update Licenses.txt for GPL v3 2024-09-20 21:37:32 -07:00
sukibabyandteejusb b1089f54c3 Remove Copying.MAD since it confuses GitHub
GitHub mistakenly thinks this is the project license. the copyright and licensing details for libmad already exists in extern/libmad, so it's not needed to keep it here as well.
2024-09-20 21:37:09 -07:00
sukibabyandteejusb e4ce86b6c9 Change lots of macros to constexpr in Actor.h
For the purposes of type safety,  allowing the compiler to further optimize, and preventing possible name collisions, I've converted these 13 macros to constexpr's.
2024-09-20 21:37:08 -07:00
sukibabyandteejusb aa7c71c766 Update INSTALL.md with Visual Studio instructions 2024-09-20 15:45:53 -07:00
sukibabyandteejusb 9a288e1b73 Change license to GPL v3 2024-09-20 15:45:53 -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
sukibabyandteejusb 9737482f7c Fix an issue breaking compilation in GCC12 and up
Users attempting to build the beta branch with GCC 12, 13 or 14 have a failure here due to the std::uint_8 data type.

The reason I changed it to an unsigned instead of including <cstdint> is because behavior on versions of GCC 12 and up were not consistent. I changed it to an unsigned because all versions of GCC were happy with that.
2024-09-17 07:57:28 -07:00
sukibabyandteejusb 0351ba6693 Use SetWindowPos to prevent interruptions on fullscreen 2024-09-17 00:00:34 -07:00
sukibabyandteejusb 322ec7b231 Removing bApproximate (part 1)
bApproximate is left over from long ago when the method to retrieve the system time might be 32-bit only or need correction. This is no longer needed, and already commented out of several sections of the sm5.1 base code. It can't be removed all at once just by deleting every instance of bApproximate, because it often refers to pointers that go elsewhere. so, this is the first part of a multi-stage removal process.

Other changes: remove samplerate() macro from RageSound, change some implicit casts to explicit.
2024-09-12 23:05:58 -07:00
sukibabyandteejusb a8fa4bab87 Delete _assets/NoteSkins/common/_Editor directory
82MB of psd files we don't really need to distribute, also the contents of the readme here are really weird.
2024-09-08 21:46:50 -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 803dc1309a Optimize avoiding CheckGameLoopTimerSkips
Implements a static boolean to track the CheckGameLoopTimerSkips preference, so that it isn't calling PREFSMAN via CheckGameLoopTimerSkips in a tight loop. Since this setting is rarely used, and isn't expected to be changed while the game is open, it doesn't need to be continuously checked.
2024-09-06 11:31:46 -07:00
sukibabyandteejusb b698eb5f0c Simplify the input device check
Reduce the input device check from every 500 frames to every 255 frames by way of replacing the modulo 500 with a wrapping uint8_t. A bit faster reaction during device plug-in is nice, and using a simple pre-increment instead of doing a modulo is a little more efficient.
2024-09-06 11:31:46 -07:00
sukibabyandteejusb 6b2a439aa5 Clean up Windows filesystem mount code 2024-09-05 12:09:58 -07:00
sukibabyandteejusb 45a7c967dd Add sdk license to w32 ddk directory 2024-09-05 08:51:36 -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 2eeee03211 Remove timer from text_glow math
text_glow is part of DrawPrimitives(), and is used just about everywhere, so it is a huge burden taken off the timer to instead increment a counter.
2024-09-04 20:15:35 -07:00
sukibabyandteejusb a0dbb32c2f Declare a NoteData template as noexcept 2024-09-04 11:07:45 -07:00
sukibabyandteejusb b58f4f3d1d Clear out Translations.xml
This commit removes old translations from Translations.xml which are probably unneeded and unwanted, but also improves commentary so people will be better equipped to write their own translations.

Thanks @bkirz  for pointing this out 👍
2024-09-03 21:19:57 -07:00
sukibabyandteejusb 93a9db10b7 ci.yml: Don't cache windows build
Attempt to fix the failing CI for the short term.

The existing workflow file still works on my personal fork, but for some reason doesn't on the main project.
2024-09-03 21:02:52 -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