This updates Actor classes, class methods, and Enums listed in the
bundled copy of Lua.xml to be current.
I used the command-line arg --ExportLuaInformation, to generate a wholly
new file, then manually removed some methods (e.g. literally numbered
PlayerOptions methods ported from notitg, CamelCase aliases of
spline-related methods) to keep previous manual modifications intact.
This doesn't touch GlobalFunctions in Lua.xml; those need further
review.
Before, this ended up calling a virtual method in the constructor,
which C++ does not allow, and I got weird crashes.
This removes a lot of unused code and gets rid of unnecessary abstractions.
This adds choices for 21:9 (Ultrawide) and 9:16 (widescreen display in
portrait mode) to the _fallback theme. Previously, users would have to
manually edit Preferences.ini to achieve either of these.
Since "21:9" is the common marketing term for what is actually 64:27,
I've slightly extended GenChoices() in ConfAspectRatio() to use a "name"
string from the winFracs table is one is provided. If not, the original
behavior of generating user-facing choices from the raw values is
preserved.
See: https://wikipedia.org/wiki/21:9_aspect_ratio
I updated the global AspectRatios table in _fallback/02 Utilities.lua to
match.
* removed ClearEnterMappedKeys from global functions
* typo fix in rawequal
* fix explanations of global SecondsToXXXX functions
* add to explanation of lua.ReportScriptError
* explain how ActorSound class can be used in Lua as "Sound"
* fix explanation for Course.GetCouseDir
* fix specified args for GAMESTATE.GetPreferredDifficulty
* remove HighScore.GetHighScore since it doesn't exist
* document special args for ScreenSelectProfile.SetProfileIndex
* fix specified args for Style.GetColumnInfo
* add examples of return value for Style.GetColumnInfo
* remove lingering mentions of SM4
The setjmp/longjmp error handling mechanism may fail with Microsoft C++ since
they utilize the same stack-unwinding mechanism with C++ exception handling.
Lua calling longjmp after luaD_rawrunprotected returns causes unpredictable
behaviour. On Windows x64 build, this causes lua_error to crash the whole
StepMania program.
Lua provides the same macros to utilize C++ throw/catch, which effectively
solve the problem. Just specify Lua library as C++ code to enable them.
Reference: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/longjmp
Running StepMania with the command line argument of --ExportLuaInformation while the current 5.1's default theme (Lambda) was selected added some seemingly stray Lua variables to the Constants table in ./Docs/Luadoc/Lua.xml.
I spotted them here: http://dguzek.github.io/Lua-For-SM5/LuaAPI#Constants
I'm assuming num, bPreference, and bCategory don't need global scope, so I added the local keyword where appropriate.
The statistics are updated in the generic codepath, which is not used by
RageDisplay_Legacy::DrawLineStripInternal() when rendering smooth lines.
Note, that the output vertex count can differ a lot between smooth lines
(2) and non-smooth lines (~38 output vertices per input vertex), so
updating the statistics can not be done in RageDisplay::DrawLineStrip()
like it is donw for the other draw functions.
The IsUsingWideScreen() function only checked 16:10 and 16:9, now we just
check that the ratio is greater than 16:10. (Coincidentally that's also
what the documentation states about this function.)
* Remove unused function
* Sort input devices on Linux
The readdir() function doesn't guarantee any specific ordering, so the
numbers of joysticks might change when restarting StepMania.
(Empirically this usually only happens after a reboot.)
Let's sort the input devices alphabetically before opening them to have
more consistent numbering and avoid annoying remapping of controllers.
* 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.
While loading all songs, disable writing the index file for the image
cache, in order to speed up loading and cache generation, similar to
how the song cache index file write is delayed.