Commit Graph

151 Commits

Author SHA1 Message Date
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
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 dddba8bbda Potential fix for code scanning alert no. 93: Unsigned difference expression compared to zero
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-04-25 16:55:35 -07:00
Arthur Eubanks 7e3ce11658 Clarify confusing RString comparison
This was actually a nullptr that got converted to an empty string
because of RString-specific code.
2025-04-23 22:34:16 -07:00
teejusb 906cb93d55 Prevent some parsing warnings 2025-03-05 08:35:09 -08:00
sukibaby e0b254968d std::size_t -> size_t
Removing std prefix from all size_t.
2024-10-01 01:46:26 -07:00
sukibaby 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
sukibaby 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
Michael Votaw eeb2528612 If a song has any time signatures defined, but doesn't include for for beat 0, add one.
(Fixes a crash that can occur with some songs if functions like TimingData::NoteRowToMeasureAndBeat are called for rows that don't have a time signature defined)
2024-02-08 01:35:06 -08:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Martin Natano 78fb2e9fc3 Decouple <cstddef> 2023-04-20 11:21:29 +02:00
Martin Natano 093675cdc3 Use attributes where possible 2023-04-20 11:21:29 +02:00
Brian Phlipot 4a6b1a743c Enable more compiler warnings and treat them as errors. 2023-02-02 11:54:17 -08:00
Michael Sundqvist 0cba3579de Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
2022-07-31 22:14:38 +02:00
Crystal Squirrel 5d4a6cf903 Fix std::stoi bad behaviour closes #2130
Patched with outfox upstream, this restores BG as it is expected
2021-08-14 21:29:48 +01:00
quietly-turning 6bd6963406 Revert "Merge pull request #1888 from mwkroening/notes_loader-invalid_argument"
This reverts commit 56caf6da4b.
2021-08-14 21:25:27 +01:00
Gareth Francis aeb5c7598f Handle exceptions in int conversions (#2092)
* RageUtil: Add exception-safe wrappers around std::stoi, stol, stoll

* Replace use of std::stoi with exception-safe StringToInt
2021-02-15 12:36:51 -08:00
Martin Kröning 67bce17382 Extract logic to NoteDataUtil::StringInterpretsAs 2020-06-13 23:36:10 +02:00
Martin Kröning dc25295879 Catch stoi invalid_argument in BGCHANGES 2020-06-13 23:35:33 +02:00
Tracy Ward 04f7a8c466 Rewrite BG/FG changes parsing (#1916)
* Handle commas and equals in BG/FG change tags

Rewrote parsing of BGCHANGES and FGCHANGES tags to be able to
handle people putting commas and equals in the filenames. For the
value positions which can be filenames, check to see if we can
recognize any filename from the song directory followed by a comma,
equal, or end of string. If we can, use that. If not, just treat it
the same as before, looking for the next comma or equal.
2019-10-12 11:41:39 -04:00
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -07:00
Kyzentun Keeslala 9fe6f49a55 Shut up various Trace calls that were clogging the log file uselessly. 2016-02-10 17:14:17 -07:00
Kyzentun bd53ae2e81 Updated changelog for 5.0.7rc. 2015-03-09 20:54:55 -06:00
Kyzentun 20953df0bd Rebased loading optimizations to current master. 2015-03-09 20:42:33 -06:00
Kyzentun ddb1683bb7 Autosave completed but not tested. 2015-03-09 19:47:44 -06:00
Kyzentun 064aead73c Added autosave to edit mode. 2015-03-09 19:47:43 -06:00
Jason Felds 519ad8672d Revert "Improved NotesLoaderSSC and NotesLoaderSM" 2015-03-09 16:58:56 -04:00
Kyzentun ff520479ca Rewrote NotesLoaderSM and NotesLoaderSSC to use map instead of an else if chain. Substantial improvement to load time. 2015-03-05 20:32:08 -07:00
Kyzentun c16f045cb4 Fixed UnknownStyleSupport. 2014-10-20 05:14:54 -06:00
Jason Felds 395107d3d5 Revert "Preserve Steps of unknown Style."
This reverts commit 8edd929e24.

This also updates the song cache.
2014-10-19 10:06:40 -04:00
Kyzentun 8edd929e24 Preserve Steps of unknown Style. 2014-10-01 17:12:01 -06:00
Ben "root" Anderson e085a40b01 Revert "Attempt preventative file not found crashing."
This reverts commit c5637444ab.
This didn't actually fix anything, but moved the crash from start of ScreenGameplay to parsing the .sm file during load.
2014-02-09 07:43:35 -06:00
Jason Felds c5637444ab Attempt preventative file not found crashing. 2014-02-04 21:10:40 -05:00
Ben "root" Anderson a16a42cb02 Edit loading overhaul: Load edits from song folders; Allow a songfolder-style hierarchy in profile edit folders; Make the #SONG tag optional if we can infer the intended song from the directory hierarchy. 2013-11-14 13:29:00 -06:00
Devin J. Pohly 6f7376c902 Fix VS float->int warning 2013-05-29 00:29:56 -04:00
Devin J. Pohly 135d9025bc Hopefully fix error with vector iterators.
That's what I get for pretending I know how to use C++.
2013-05-21 08:53:56 -07:00
Devin J. Pohly f13af2c96f Fix conversion of negative BPMs and stops.
There are still issues with loading the changed files from cache for some
reason.  However, the initial conversion is now identical to OpenITG behavior
except in some very strange edge cases.
2013-05-20 19:12:40 -07:00
Devin J. Pohly ed9fbd2c31 Filter out zero BPMs and zero-length stops in first pass
It turns out to be much cleaner to do this here than to do it later.
2013-05-19 21:42:54 -07:00
Devin J. Pohly dcb62dec88 Sort BPMs and stops before processing 2013-05-19 19:50:56 -04:00
Devin J. Pohly c04553846a "Combine" processing for BPMs and stops.
Prep for replacing with new negative-converting algorithm.
2013-05-17 16:43:53 -04:00
Devin J. Pohly 785cff2abc Remove unneeded return value from ProcessBPMs 2013-05-17 05:43:25 -04:00
Devin J. Pohly b1d2f68737 Finish moving ProcessBPMs and ProcessStops together 2013-05-17 05:34:14 -04:00
Devin J. Pohly 6fadd3a727 Start moving ProcessBPMs and ProcessStops next to each other 2013-05-15 19:57:57 -04:00
Devin J. Pohly 8eb76829fb Don't allow edits with no valid #NOTES 2013-05-09 17:45:25 -04:00
Devin J. Pohly adb0d5d4a1 Separate functions for BPM/stop parsing and processing 2013-05-09 00:00:14 -04:00
Devin J. Pohly 536768c91b Split parsing from processing for BPMs/stops 2013-05-08 23:46:54 -04:00
Jason Felds caa417abe7 Bring in the warp stuff. 2013-05-04 20:55:56 -04:00
Jason Felds f5c877cbb6 Replace StringToInt with the std version.
Again, RageUtil isn't the right home.
2013-05-04 11:59:25 -04:00
Jason Felds 07b9fb6da5 The big NULL replacement party part 6.
...and ', NULL' had even more to replace.
2013-05-03 23:49:23 -04:00
Jason Felds 28e5148dec The big NULL replacement party part 5.
Right. ' = NULL' would get a lot of these.
2013-05-03 23:39:52 -04:00