Commit Graph

136 Commits

Author SHA1 Message Date
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 0447d9ae58 Consistency in Windows ifdefs/windows.h includes
Changing all defined(_WINDOWS) to defined(_WIN32)

Defining WIN32_LEAN_AND_MEAN in all files except those in Archutils/Win32
2024-06-24 15:48:05 -07:00
Crash Cringle becd375544 Only UpdateMeterSort when necessary (when sorting), account for other games and styles.
Songs are already sorted by title so no need to do so again (otherwise big boi lag)
2024-03-02 23:48:04 -08:00
Crash Cringle d788071d4d Add sorting by Block level
(cherry picked from commit e1c8326a6a71f4a15c3f123391dc3f3331ee4a7b)
2024-02-25 09:36:21 -08:00
Martin Natano 56edcee48c Use compiler intrinsics for byte swapping 2023-04-21 22:13:41 +02:00
Martin Natano bacecae1f7 Decouple <vector> 2023-04-21 22:13:41 +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
Lamar Cooley f62938787a Add new Preference, Maximum Number of Credits
Grant users the ability to change the maximum amount of credits available rather than the constant cap at 20.

(cherry picked from commit 2ec2355d7a7d9fec9410cf6b7d2b5c31a4406074)
(cherry picked from commit 48245ab51600ede16096e70e27c94345918eaed7)
2023-01-24 13:04:27 -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
SheepyChris 95a07e6803 Add line labels to definition of default video card settings 2022-06-18 11:43:33 -07:00
SheepyChris 25ae3c07f5 Update default Graphics settings 2022-06-18 11:43:33 -07:00
Martin Natano f60707b506 Add support for incremental updates to ScreenReloadSongs 2022-06-10 19:33:23 +02:00
Martin Natano 15b77ee278 Update documentation 2022-05-28 11:21:13 +02:00
Martin Natano d54bc6857f Prevent access to /Save/Preferences.ini from lua
Directly writing to the file would circumvent preference protections,
compromising security.
2022-05-07 23:53:58 +02:00
Martin Natano 4c0aef69dd Remove legacy network code 2022-04-11 14:50:00 -07:00
Martin Natano 1ab364c0fa Remove autotools infrastructure
Having one build system is enough.
2022-03-31 12:06:18 -07:00
Martin Natano c99477f046 Only make parts of the initial filesystem writable
This prevents overwriting the program binary or other sentitive paths
like /Data/Static.ini from Lua.
2022-03-13 12:46:14 -07:00
Martin Natano 168877f6a8 Mount directories read-only where possible 2022-03-12 22:30:54 +01:00
Martin Natano 0861ed45c7 Merge /AdditionalSongs into /Songs, and /AdditionalCourses into /Courses
Includes a backwards-compatibility mechanism to adapt paths when loading
Stats.xml.
2022-03-11 22:35:31 +01:00
Martin Natano dc49af3c59 Implement NetworkManager
For now there are two methods:

- `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed.
- `NETWORK:HttpRequest()`: Perform an HTTP request.

By default access to the network is disabled for all target hosts. It
can be enabled by setting `HttpEnable=1` in the preferences. Individual
hosts have to be added to `HttpAllowHosts` as a comma separated list to
allow access.

See included docs for more details on usage.
2022-01-15 22:56:08 +01: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
Gareth Francis 23889bd7c8 Avoid crash in ~LightsDriver_SystemMessage (#1663)
* Avoid crash in ~LightsDriver_SystemMessage

This will avoid a crash caused by the fact LIGHTSMAN is destroyed
after the other MAN objects

* Rework code path for turning lights off on exit

Calls to LightsDriver::reset removed from each driver to avoid any crashes

LightsDriver::reset renamed to Rest to match surrounding style

Added LightsManager::TurnOffAllLights, called before XXXMAN objects are deleted
2018-05-10 18:04:44 -07:00
Alexander Griffin c0981c42ec Changing BannerCache into ImageCache to support more imagetypes (#1532) 2017-09-19 14:49:42 -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
Tyler Brekke 8f332653e1 Persistent Coins (#1405)
On Coin Insert, a file Save/Coin.ini is created if it does not exist, which stores the number of coins currrently in m_iCoins. Whenever m_iCoins is update, the Coin.ini is updated.

On boot, Coin.ini is read and m_iCoins is set to that value. If coins in coin.ini file is greater then MAX_NUM_CREDITS then reset the value to 0.
2017-02-17 08:21:38 -08:00
Matt McCutchen 4b3507f195 Instantiate MESSAGEMAN first. (#1399)
This fixes a well-formed warning, but does it break anything?

It's not clear off hand. Having this up for discussion.

(Matt McCutchen <matt@mattmccutchen.net>: Cherry picked from commit
a565a27da8c5278846c06585cb6e218ff8f0f1b7 with a conflict resolution.
This commit fixes a crash on startup in MessageManager::Broadcast when I
build StepMania with -DCMAKE_BUILD_TYPE=Release and g++ 6.3.1 on Fedora
25.  Apparently g++ is optimizing out the "this != NULL" on the grounds
that calling a method on a null pointer has undefined behavior, so the
"m_Logging" is a null dereference.)
2017-02-10 06:40:43 -08:00
latot 47b0f83aed Remove WITH_VERSION_INFO, version info by default 2015-10-22 21:21:47 -03:00
Jason Felds b7c62ee645 Missed a spot on Linux. 2015-10-02 22:18:31 -04:00
Jason Felds 99b79e5410 Generate verstub.cpp through raw cmake.
There is no need for an extra program.

As a bonus, generate a consistent windows vdi file.

There is still an issue with actually *reading* the vdi, but that's for someone else to tackle.
2015-10-02 21:56:02 -04:00
Colby Klein a9b061f8f9 Remove hard-coded 480 for high res textures.
Now it reads Common::ScreenHeight from the theme like it should.
2015-08-08 14:12:45 -07:00
Kyzentun Keeslala f6d369372f Changed HOOKS singleton to register itself with lua correctly so that it can be used by lua. 2015-07-08 15:39:00 -06:00
Kyzentun Keeslala 1dca128f79 Added logic to prevent crashing on an invalid initial screen. Added HARDCODED error screen in _fallback for displaying and explaining the error when a theme has an invalid initial screen. 2015-06-06 20:43:39 -06:00
Kyzentun Keeslala e6dc4307b5 Exposed update_centering lua function. Added ScreenOverscanConfig. Added case to RageDisplay_D3D so that BLEND_SUBTRACT doesn't crash. Updated changelog. 2015-06-05 08:48:58 -06:00
Joe dabad23323 BackInEventMode code now works for both players 2015-05-11 20:37:17 +01:00
Kyzentun 912582674c Don't put the song title in the screenshot name because it might contain utf8 which doesn't work on windows, or path garbage, or other stuff that would have to be sanitized. 2015-05-10 10:53:33 -06:00
Kyzentun f3ab635d03 Made screenshot key tag with song title and screen name. 2015-04-25 21:18:42 -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
Jason Felds 39c7e1bb45 Cleaner approach. 2015-01-31 11:14:56 -05:00
Kyzentun 09eede311c LOG->Info takes a char*, not an RString. 2015-01-30 23:41:59 -07: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
Ben "root" Anderson 0d394e269d Declare version_* in only one place. Define them in ver.cpp (at least on autotools). 2015-01-28 16:45:19 -06:00
Kyzentun fb0b48be52 Changed screen width calculations to subtract 1 if the result is odd. 2015-01-21 10:44:16 -07:00
Kyzentun 36d94f272f Fixed --game command line arg to set the current game correctly soe that the correct input mapping is loaded. 2014-12-08 16:39:01 -07:00
sillybear c6fb8a11b9 Allow setting of game type via console command 2014-12-04 02:46:01 +08:00
Kyzentun e22e99251e Added functions to ActorUtil for converting the extension to a file type and changed various places that had lists of extensions to use ActorUtil instead of duplicating the list of extensions. Added webm and wmv to list of video types. 2014-11-09 00:04:47 -07:00
Dan Guzek d1ec94bcd7 touch up style to InsertCredit and InsertCoin
Third time's the charm.
2014-09-01 20:26:55 -04:00
Dan Guzek 6ccbbb4f6f update InsertCoin and InsertCredit functions
These should now agree with kyzentun's suggestions.
2014-09-01 20:03:45 -04:00
Dan Guzek eae5fcb3ba expose InsertCoin and InsertCredit to Lua
This commit exposes InsertCoin() and InsertCredit() to Lua under GAMESTATE.  It adds a check to ensure overall credits don't become negative when deducting and only plays sounds if credits are being added.

Themers are instructed to deduct credits by passing negative values to InsertCoin.
2014-09-01 19:00:00 -04:00
Kyzentun 9b08ab5b52 Created GameLoop::ChangeGame analogous to GameLoop::ChangeTheme. Changed ChangeTheme to use the AfterThemeChangeScreen metric instead of a passed in screen name from the theme being changed away from. ChangeGame uses the AfterGameChangeScreen and AfterGameAndThemeChangeScreen metrics to pick the screen to load after the change. New metrics are optional and default to InitialScreen. Changed ScreenManager::ThemeChanged to not duplicate the code in ReloadOverlayScreens. Fixed ScreenManager::IsScreenNameValid to check with HasMetric before using GetMetric. Changed game ConfOption logic to set the preference and work in a similar way to the theme ConfOption. Added THEME:SetTheme lua function. 2014-08-02 00:38:34 -07:00