Commit Graph

48 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
sukibaby e0b254968d std::size_t -> size_t
Removing std prefix from all size_t.
2024-10-01 01:46:26 -07: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
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
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
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -07:00
Colby Klein f5100aee0d Fix NOTESKIN:GetMetric() 2016-11-24 18:57:25 -08:00
Devin J. Pohly 10ddd549f3 Make sure we always release Lua lock
I have a sneaking suspicion that this also magically fixes memory cards
on Linux.
2016-05-24 16:25:23 -04:00
Jason Felds bec18a0d36 Fix minor windows pedantic warnings. 2016-03-27 22:03:15 -04:00
Jason Felds edabf4605b Clean up three sets of warnings:
* Ensure all switches have a default when working with enums.
* Match defined new[] calls with delete[] calls.
* Respect variable initialization order.
2016-03-24 18:30:29 -04:00
Kyzentun Keeslala a816de735a If the fallback for a noteskin doesn't exist, remove it from the list of noteskins to prevent crashing when someone tries to use it. 2015-10-20 22:57:07 -06:00
Jason Felds d9a3c9cf97 Use cmake to determine which string func we need.
On a side note, better to default to linux names when possible.
2015-10-07 19:00:16 -04:00
Kyzentun 8cde91eb2e Prevent crashes from an invalid noteskin being set. 2015-01-31 00:23:54 -07:00
Kyzentun 261f2b0e3c Fix dumb mistake in NoteSkinManager multi-match error message. 2014-12-16 02:21:03 -07:00
Kyzentun bdb2b373bc Added NoteSkinManager::GetDefaultNoteSkinName so that PlayerOptions can avoid clearing the noteskin when the clearall mod is used. 2014-08-07 18:36:42 -06:00
Kyzentun bc7217908d Added Sprite::NewBlankSprite for use by NoteSkinManager. Removed default texture loading from Sprite::Sprite. Should fix problems with white banners and garbage on videos. 2014-07-24 03:38:17 -06:00
Kyzentun 0f607df55e Changed NoteSkinManager::LoadActor to always return a Sprite on failure because some elements must be a sprite. 2014-07-19 10:11:14 -06:00
Kyzentun 8a65dfaefa Tested and fixed error reporting for NoteSkinManager. Changed Sprite::Sprite() to load the default texture. 2014-07-16 02:03:06 -06:00
Kyzentun 0f72d7cc6b Changed NoteSkinManager to use new error reporting and avoid crashing. Fixed DoChangeTheme to switch to the InitialScreen if the screen doesn't exist in the theme being changed to. Fixed error reporting in MeterDisplay. 2014-07-15 13:28:06 -06:00
Kyzentun 026f968fa4 Changed many uses of Dialog::OK and LOG->Warn to use ReportScriptError. 2014-07-07 00:39:27 -06:00
Kyzentun a7a98a690e Replaced every use of lua_call with RunScriptOnStack. Modified RunScriptOnStack to report an error to log and system message using a passed in context string. Modified every use of RunScriptOnStack to avoid crashing so that the reported error can be seen. 2014-07-05 01:34:05 -06:00
sigatrev 8d5a22a2e1 added NOTESKIN:GetMetric() method
none of the other type specific methods can call the "FallbackNoteSkin"
metric.
2014-05-01 19:03:38 -05:00
Ben "root" Anderson a040c4a586 1) SOMEONE can't spell "accessible" 2) Global commenting consistency 3) persistance -> persistence 2013-11-30 09:50:54 -06:00
Jason Felds 25c3c7d4f1 Change our auto_ptr's to unique_ptr's.
auto_ptr is deprecated in c++11.
2013-05-04 14:11:47 -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 28e5148dec The big NULL replacement party part 5.
Right. ' = NULL' would get a lot of these.
2013-05-03 23:39:52 -04:00
Jason Felds ba59dd1656 The big NULL replacement party part 2.
This may take a bit. Trying to do this by operator/command.
2013-05-03 23:11:42 -04:00
Jason Felds c67419ecc8 There goes the macro file.
This is one of my bigger commits in this branch.

Still, shouldn't cause a problem.
2013-05-01 23:54:39 -04:00
Jason Felds fa3e09ce42 More loops.
TODO: Look into a proper "implode" function.
2013-04-30 20:54:15 -04:00
Devin J. Pohly 001ee51242 replace gotos with tail calls where appropriate 2013-01-25 17:22:23 -05:00
AJ Kelly 967237d881 Add Var "Player" and Var "Controller" for NoteSkin. [hanubeki]
Sourced from http://code.google.com/r/hanubeki-modified-sm-ssc/source/detail?r=824cff29912d1c29a667046ba463d195e81c524a
2012-05-03 14:27:51 -05:00
Jason Felds 4791141809 Temp test: remove game check on Noteskin refresh.
If this causes too many problems, this can be reverted.
2011-10-20 23:48:57 -04:00
AJ Kelly 79b0c1ccbe more reverting of 750b688 2011-06-12 20:36:06 -05:00
Jason Felds fa07ab9e0a Doxygen bot commit test. 2011-05-12 13:19:51 -04:00
Jason Felds 750b688de4 Consistent insensitive string comparisons.
This seems to reduce the need for a #define,
but I need someone on the Windows side to check.
2011-05-11 16:48:51 -04:00
Jason Felds da51e26d07 Standardize conversion processes.
Too many arguments for or against the many methods:
stick to one inside a common function.

This commit will force recompilation of many files.
2011-05-11 15:58:31 -04:00
Jason Felds a085d0d1da Line endings...be normalized! 2011-03-17 01:47:30 -04:00
Jason Felds 81ccc7daba Quickly variables! Into the magic mirror! 2011-03-14 03:32:07 -04:00
AJ Kelly 60ce757c5f spacing cleanup 2011-03-04 22:48:00 -06:00
Jason Felds 9d13036e08 Add @briefs to the Luna classes.
Yeah...there was a lot. */
2011-02-19 12:26:18 -05:00
AJ Kelly 20a1802758 add StripMacResourceForks(); hopefully prevents things like issue 178 ( http://ssc.ajworld.net/sm-ssc/bugtracker/view.php?id=178 ) from happening again 2010-08-26 00:49:40 -05:00
AJ Kelly 60b86919ba [Player] CheckpointsFlashOnHold metric added (bool). also cleanup/comment/etc. 2010-02-24 02:40:36 -06:00
AJ Kelly c43635b6b3 efa81bc: don't filter NoteSkins at a PrefsManager/NoteSkinManager level. Leave the NoteSkin sorting and filtering up to the theme. [Chris Danford]
ScreenWithMenuElements.cpp - add Cancel command, so actors can react to Cancel.
GameState.cpp - cleanup
2010-02-19 16:05:50 -06:00
AJ Kelly 7f19f8310a Okay so Glenn decided to revert some Frieza code. I'm not going to remove everything Glenn did, as there was some useful code.
However, the ones I agreed with were:

75d5b63 "if a Noteskin fails to be loaded by the time the notes need to be displayed, attempt to force the default theme on and throw errors in to the log rather than crashing SM."
Glenn: There was no indication in the commit of when this was actually happening; this is unnecessary logic that will do nothing but hide bugs.
AJ: Based on some of the other code I've seen in the StepMania codebase, I'd say having this code in GetMetric isn't a good idea. There's an assert for checking if the noteskin isn't empty. That should suffice.

e27e971 "Adds metric options to flash the lifebar when a note is hit"
AJ: There are many possible ways of doing this without having to add a new metric.
The most extreme example is to code your own life bar and mess with JudgmentMessageCommand.
I'm not sure if StreamDisplay would respond to the message or not, but there are multiple ways of getting at the Stream. (ultralight, to be released, contains an example)
2010-02-10 21:23:28 -06:00
AJ Kelly 3e51544930 Initial commit. 2010-01-26 21:00:30 -06:00
Devin J. Pohly 80057f53cd smsvn -> ssc-hg glue: rearrange directory structure 2013-06-10 15:38:43 -04:00