Commit Graph

51 Commits

Author SHA1 Message Date
teejusb 53dcbed80d Revert "Change some RString methods to free functions" 2025-06-22 23:31:56 -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
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 4977f29fe3 silence a bunch of msvc warnings 2019-03-28 15:05:07 -07:00
Rhythm Lunatic dcb2f74c8d Add More OptionsList functionality (#1810)
* Add More OptionsList functionality

* Remove Size parameter because it's broken

* Make OptionsList inputs remappable

* Change Next/Prev OptionsList to CodeDetector
2019-03-28 14:49:46 -07:00
Drew Barbarello 557be7cf1b 5 1 new backport x11 fs rework (#1485)
* Use XRandR 1.2 to set fullscreen resolution for single output

Squash of roothorick's PR #497
(also includes Kyzentun's CMake changes from PR #716)

* Cherry-pick json c++1x stuff (b9e3d7174e)

* Cherry-pick c++11 support from 5bba5c0038 and 9f8b045309

* rework Linux (X11) fullscreen, improve display-related Graphics Options

Implement option to select between monitors for exclusive fullscreen mode
on X11 (using XRandR 1.2), or use a fullscreen borderless window.

Reimplement resolution/refresh rate/display mode-related option rows
using Lua, update choices dynamically so only known-good groupings of
resolution/refresh rate/aspect ratio can be selected.

Minimally update Windows/MacOS LowLevelWindow implementations to support
changes made for Linux side. Fullscreen Borderless Window/multi monitor
support from X11 not implemented for those in this commit.

* allow forcibly disabling xinerama use on Linux

When libXinerama is available, SM tries to use it to find the proper
monitor indexes to use to set _NET_WM_FULLSCREEN_MONITORS (on borderless
fullscreen). xfwm4 seems to assume that monitors are numbered in increasing
order from left to right (rather than using the Xinerama-assigned numbers),
so _NET_WM_FULLSCREEN_MONITORS misbehaves on Xfce.

This commit bypasses use of libXinerama, and instead forces SM to induce fullscreen
on the desired monitor in the backup, hacky way: remove all window hints, move window
to desired monitor, then add _NET_WM_STATE_FULLSCREEN hint. This works on
mutter and Xfce.

* Remove multiple warnings on redundant define.

This used to be hard-coded due to pthread related items, but now it's dynamically determined.

* fix _fallback menu behavior for unrecognized aspect ratios

* Fix error recreating existing FS texture

* Bump deployment target to 10.7 to use libc++ on XCode 8

* Add explicit casts to please clang

* Update changelog
2017-06-18 08:55:16 -07:00
Colby Klein b4e02821e8 Revert "Improve handling of errors in lua functions and speed up calls. (#1427)"
This reverts commit f10e3ae36a.

(it was a joke PR, do not fear)
2017-04-04 17:21:55 -07:00
Kyzentun f10e3ae36a Improve handling of errors in lua functions and speed up calls. (#1427) 2017-04-04 11:36:23 -07:00
Kyzentun Keeslala d496f8145c Noteskin name in PlayerOptions needs to be compared case-insensitive when comparing PlayerOptions structures. The old code that used != probably relied on RString::operator!= misbehaving. 2015-11-05 21:56:43 -07:00
Kyzentun c4fed9747c Fixed crash on no args to AddInputCallback. Clear steps for all players when deleting on ScreenEditMenu. Changed assert message in ApplyDerivedType to be useful. Fixed typos in OptionRowHandler message and EditHelpText. 2015-02-26 14:51:54 -07:00
Kyzentun 3fb36af157 Separate styles for players. Notefields positioned between margins. Edit mode works for kickbox. 2014-12-09 22:27:00 -07:00
Kyzentun 3945a4a34b Improved three-key support. Default theme should be completely usable with three-key cabinets if ThreeKeyNavigation pref is true. Added ThreeKeyNavigation pref. ScreenOptions:NavigationMode metric now uses that pref to decide between normal and toggle modes. Added GoToFirstOnStart to OptionRowHandlerLua so an option row can control that behavior. Rewrote input for default's ScreenSelectProfile to use an input callback to take advantage of menu button mapping. Fixed inconsistent indentation in ORHL documentation. 2014-08-02 00:38:46 -07:00
Kyzentun 4343a99ea9 Changed many parts of GameCommand to improve error reporting. Fixed GameCommand setpref to not set when loading the command. Minor fix to ScreenOptionsExample.ini to explain that SongInCurrentSongGroup is unusable. CommonMetrics, CourseContentsList, HoldJudgent, OptionRowHandler all have minor changes to fix crashes on malformed theme data. 2014-08-02 00:38:25 -07:00
Kyzentun 5df80b6e0e Changed many places that used RageException to use ReportScriptError instead. Wrote ScreenOptionsExample.ini as documentation example for the OptionRow system. Rewrote gamecommands.txt to include all GameCommands. Fixed Commands::GetOriginalCommandString to insert the semicolons that separated the original commands. Changed nonsensical boolean |= true statements in GameCommand.cpp to just use =. Added protection to ReportScriptError to keep it from recursing through itself when an error occurs in error reporting. Added UseAbort option to ReportScriptError for places that want to use an AbortRetryIgnore dialog to query the user. Added ScriptErrorMessage for places that need to handle the warning/dialog part separately. Added logging flag to MESSAGEMAN so that all messages broadcast can be logged when desired. Changed OptionRowHandler::LoadInternal to return a boolean success value as part of error handling. 2014-08-02 00:38:24 -07:00
Kyzentun cc548a8cb5 Moved error reporting to ScreenSystemLayer error.lua. ScreenSystemLayer overlay/default.lua restored to previous. Error messages are now broadcast with the ScriptError message instead of SystemMessage. Added show/hide error messages toggle and clear error messages to debug menu. Nuked ScreenConsoleOverlay for being unfinished and duplicating ScreenSystemLayer. Changed Actor:tween and Tween::CreateFromStack to use ReportScriptError on invalid tween params. Changed some OptionRowList things to use ReportScriptError on invalid metrics. 2014-08-02 00:38:21 -07:00
Kyzentun a74a49af78 Changed many uses of Dialog::OK and LOG->Warn to use ReportScriptError. 2014-08-02 00:38:18 -07:00
Kyzentun 95fe1a17e9 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-08-02 00:38:17 -07:00
Kyzentun dcf819d297 Moved all sanity checking for OptionRowHandlerLua to a separate function so that a malformed row does not crash StepMania, and instead prints an error to the log file, and creates a row that does nothing. Added AllowAnything arg to CheckEnum. 2014-06-25 12:08:57 -06:00
Kyzentun 045e9edcdd Added ArbSpeedMods function for a better way of setting speed modifiers. Added NotifyHandlerOfSelection to OptionRowHandler to support this. Changed exceptions thrown by OptionRowHandlerLua into log warnings because crashing out is not helpful to themers. Fixed SetEnabledForPlayers in OptionRowHandlerLua to correctly read the PlayerNumber enum. Removed silly git add Docs/Themerdocs/Examples/OptionRowHandlerLua.lua and second check for ExportOnChange. 2014-06-19 06:41:18 -06: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 a3f37dc2b4 The big NULL replacement party part 3.
Getting there I think.
2013-05-03 23:16:39 -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 9f24627bf9 The big NULL replacement party part 1.
This is meant to be a safer alternative since
NULL can often be 0. Let's not rely on that.

And yes, I know this is a lot of files. This is
a safer thing to do in big commits vs for loops.
2013-05-03 23:01:54 -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 1766edc691 Two loops. 2013-05-01 22:15:38 -04:00
Jason Felds 860b32da7c More for loops. 2013-04-30 19:38:43 -04:00
Devin J. Pohly 900d04e624 replace gotos with if blocks where appropriate 2013-01-25 17:57:03 -05:00
Jason Felds 1fc16698ba War on -Werror, part 12: explicit bool usage.
It may save a few cycles, but it's best to be
explicit on boolean operations, especially with
ASSERT.
2012-12-27 11:38:53 -05:00
Jason Felds e01537405f war on -Werror, part 8: more informals.
General guide: if the parameter name and its typings
match almost exactly, the name goes away.
Otherwise, it's commented out to allow for some
documentation.
2012-12-27 00:00:28 -05:00
Jason Felds 4f07a0ea8b war on -Werror, part 7: start informal params.
I'm preserving our numbering Pohly. ;)
2012-12-26 23:23:59 -05:00
AJ Kelly 778ce8a288 [ScreenOptionsMaster] Added StepsRowLayoutType metric. (Valid values are ShowAllInRow or ShowOneInRow.) 2012-02-08 23:49:42 -06:00
Jason Felds 3d8174dd03 Restore proper edit behavior sans metric.
...we seriously need a new way of doing this.
2011-07-14 10:59:59 -04:00
Jason Felds 5bec1e3e76 Add comment.
This really seems like something that should be in lua.
2011-07-12 15:01:50 -04:00
Jason Felds e67324c5af Add StepsUseChartName metric.
This is in ScreenOptionsMaster.

To the C++ guys: please don't yell at the goto.
2011-07-12 14:51:52 -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 f2e7954054 various cleanup/comment changes 2011-02-27 00:52:32 -06:00
AJ Kelly d7caea9f0a [OptionRow] Added GetLayoutType() and GetSelectType() Lua bindings. 2011-02-21 03:18:37 -06:00
AJ Kelly 0755d0f3b9 comment/whitespace editing 2011-02-09 17:42:16 -06:00
AJ Kelly 0a4323fd02 cleanup 2010-07-17 02:44:30 -05:00
AJ Kelly b40f144f1a small comment/cleanup 2010-07-03 18:07:17 -05:00
AJ Kelly dca9182138 various cleanup and commenting 2010-03-14 19:46:05 -05:00
AJ Kelly 60b86919ba [Player] CheckpointsFlashOnHold metric added (bool). also cleanup/comment/etc. 2010-02-24 02:40:36 -06:00
AJ Kelly 3e51544930 Initial commit. 2010-01-26 21:00:30 -06:00