Commit Graph

61 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
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
Arthur Eubanks 9131dc6b68 Prefix some calls with std::
These depend on C++ argument dependent name lookup and won't work with
an upcoming cleanup.
2025-04-22 23:19:28 -07:00
sukibaby 659cd549a2 Remove std prefix from uint types
std::uint*  ->  uint*
2024-10-05 19:25:41 -07: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
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +02:00
Martin Natano aa87f85eef Decouple <cstdint> 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
Martin Natano b68ca517e6 Clean up math functions
- Remove checking for standard functions from the build system
- Prefix all invocations with std::
- Replace suffixed functions with unprefixed versions
- Include <cmath> in all files that use it and remove the global include

e.g. floorf(x) -> std::floor(x)
2023-04-19 19:31:40 +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
Martin Natano afb3836367 Remove unsafe package library
package.loadlib() can be used to load a dynamic C library allowing
arbitrary code execution in mod charts and themes.

So far I haven't found any theme that depends on the library, so I think
removing it shouldn't break anything.
2022-03-04 21:27:55 +01:00
Prcuvu 1dc2c9cc1f Fix indentation [ci skip] 2019-10-01 18:09:22 +08:00
Prcuvu e5321deed4 Fix DLGPROC prototype 2019-10-01 14:10:56 +08:00
teejusb 7e3789b131 Integrate C++11 branch into 5_1-new 2019-06-22 12:35:38 -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
Kyzentun 2aee27a276 Backport custom song support. Prefs are CustomSongsEnable, CustomSongsMaxCount, CustomSongsLoadTimeout, CustomSongsMaxSeconds, CustomSongsMaxMegabytes. Metrics are NumProfileSongGroupColors and the colors with it. Profile custom load function is passed PlayerNumber now. Stepmania must run as root to save USB profile scores. (#1470) 2017-06-06 05:30:06 -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 d2090081a1 Doing what I should have done a long time ago. 2015-07-09 13:18:51 -06:00
Kyzentun Keeslala 4078010ebd Change RunScriptFile to report errors through the error reporting system instead of just dialogs so that errors show when reloading scripts in game. 2015-06-16 16:51:06 -06:00
Jason Felds dc94728628 Introduce cmake (min 2.8.12) to StepMania.
tl-dr: view the Build directory to see.

This is intended to replace the project files that we presently maintain
so that only a single set is needed instead of multiples.

The following setups were used for testing:

* Windows 8 and Visual Studio 2013 Desktop Express
* Windows 7 and Visual Studio 2012
* Mac OS X Mavericks and Xcode
* Ubuntu and makefiles
* Fedora 21 and makefiles

All three operating systems can generate projects, compile, link, and
run. Windows and Mac OS X users will find their compiled binary in the
same location as before, but Linux users will be surprised: it goes
straight into the root directory, along with a symlinked GtkModules.so
as appropriate. There is no more need for a manual symlinking step.

Known issues:

* At this time, MinGW likely does not work. Extra time will be needed.
* The WITH_JPEG option may go away, and we'll just always require it.
* Some linux libraries can use the system equivalents, but that is not up yet.

For more information, check out the Build directory.
2015-03-21 20:15:15 -04:00
Ben "root" Anderson 7a33b8a44a Program version is now in a const from a generated file, not a static macro. Plus all the mess I had to make to get that to work. 2015-01-28 19:21:24 -06:00
Flameshadowxeroshin f230729a6f unsigned int combo and score, Player::IncrementComboOrMissCombo 2015-01-23 10:25:06 -06:00
Forest 96501df3d7 Use legal printf format strings when logging. 2014-09-08 02:23:45 -07:00
Kyzentun 8657d70fe1 Created Def.LogDisplay for displaying messages in a log. Changed error reporting layer to use Def.LogDisplay. Changed engine error reporting to not clip errors to a single line. 2014-08-02 00:38:29 -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
Devin J. Pohly a9d5931533 Command/LuaManager: add legacy command parsing
Only enabled when compiling via CompileXNodeTree.
2014-02-20 10:59:49 -05: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
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 45b1631e09 Another loop with deleting.
...unsure how maintained this file will be.
2013-05-01 22:42:24 -04:00
Jason Felds ead42d5234 Update these loops. 2013-04-30 20:45:40 -04:00
Jason Felds f710f850bf Demonstrate how auto is used for this. 2013-04-27 15:16:55 -04:00
Devin J. Pohly feb919f0bf Revert memory leak commits
5f7001e: "Added a new branch"
01456ed: "Fixed a lot of memory leaks"
dac4493: "Fixed all remaining memory leaks that I could figure out"
0792db7: "Removed the smnew macro and the call to _CrtSetDbgFlag()"

Some of these caused destructor-time problems due to static initialization
order fiasco and related issues.  Notably, the program would no longer exit on
OSX and had to be killed.

There were probably legitimate fixes in here, but since these are monolithic
commits it's too much work to extract them now.  Let's reapply them
individually and in the forward direction.
2013-04-27 00:05:14 -04:00
Shenjoku 0792db752a Removed the smnew macro and the call to _CrtSetDbgFlag() to get ready for
merging with the main branch.
2013-04-19 20:34:11 -07:00
Shenjoku 01456ed0b9 Fixed a lot of memory leaks caused by static globals never getting
deleted and some other objects not getting deleted properly due to missing
destructors.
2013-04-18 21:17:57 -07:00
Shenjoku 5f7001ef0a Added a new branch that implements support for outputting all memory leaks to
the debug output for the Debug and FastDebug project configurations. This
requires replacing all instances of new with a macro, smnew, that defines a
special form of new which outputs file and line number information along with
the memory leak details. This makes finding memory leaks much easier since you
can just double-click the leak in the output window and it will take you to the
line that caused it.
2013-04-17 20:42:29 -07:00
Jason Felds a15cbc431d War on -Werror, part 14: More hodgepodge. 2012-12-27 12:45:04 -05:00
AJ Kelly 1aee8afe87 kill GetOSName lua binding since GetArchName is better 2011-12-27 11:21:31 -06:00
AJ Kelly 046b30484b [LuaManager] Added ProductFamily() Lua binding. 2011-12-22 12:19:50 -06:00
AJ Kelly 3548810ad5 make the 'attempt to index a function value' stand out as a lua panid 2011-09-25 11:17:19 -05:00