Commit Graph
97 Commits
Author SHA1 Message Date
Martin Natano 7b9a799cdb Statically link MSVC runtime 2022-06-03 19:47:45 +02:00
Martin Natano 4de9bd7c7f Fix mine fix :)
The song timing was used for the calculations, but the steps timing should be used instead because of split timing.
2022-06-03 14:36:24 +02:00
Martin Natano 2fc8705f45 Force dead code elimination for libtommath 2022-05-31 18:21:35 +02:00
Martin Natano 327278436d Remove support for building with system libraries 2022-05-31 18:21:35 +02:00
Martin Natano 5f08636ad0 std::binary_function is deprecated and unnecessary in C++11 2022-05-31 12:55:03 +02:00
Martin Natano f83dd1989d Move libtomcrypt to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 967ff91cc6 Upgrade libtommath unknown version from 2010 -> 1.2.0 and move to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 9723a67ad7 Upgrade pcre 4.5 -> 8.45 2022-05-30 23:57:33 +02:00
Martin Natano d112fdd1d2 Rename libmad directory 2022-05-30 23:57:33 +02:00
Martin Natano 06154a0094 Upgrade libjpeg 8c -> 9e 2022-05-30 23:57:33 +02:00
Martin Natano e2ee97e36d Update github CI for submodules 2022-05-30 23:57:33 +02:00
Martin Natano 2934af7784 Upgrade glew 1.5.8 -> 2.2.0 2022-05-30 23:57:33 +02:00
Martin Natano 2bb9124c72 Clean up build system 2022-05-30 23:57:33 +02:00
Martin Natano 7d29ee308d Upgrade vorbis 1.3.6 -> 1.3.7 and move to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 1a44af0cf4 Upgrade ogg 1.3.2 -> 1.3.5 and move to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 1764dbcea8 Move libpng to submodule 2022-05-30 23:57:33 +02:00
Martin Natano b6620d50ed Move ffmpeg to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 3d05e523c8 Upgrade zlib 1.2.11 -> 1.2.12 and move to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 7f06ca703d Upgrade IXWebSocket 11.3.2 -> 11.4.3 and move to submodule 2022-05-30 23:57:33 +02:00
Martin Natano 08896f0cc1 Add SM5 migration guide 2022-05-28 11:21:13 +02:00
Martin Natano 15b77ee278 Update documentation 2022-05-28 11:21:13 +02:00
Martin Natano be0dee1402 Remove SM5 songs course 2022-05-28 11:21:13 +02:00
Martin Natano c36ac09ce0 Remove Manual
It is incomplete and outdated. There are better resources out there.
2022-05-28 11:21:13 +02:00
Martin Natano d8586b02b2 Add NETWORK:WebSocket() 2022-05-27 23:42:37 +02:00
Martin Natano cb037494fc Correct capitalization of ITGmania folder in macOS dmg 2022-05-27 23:42:37 +02:00
Martin Natano b9171d4892 Fix ffmpeg target OS version on macos 2022-05-24 14:56:02 -07:00
Martin Natano 07e422111c Tweak app bundle 2022-05-24 12:39:55 -07:00
Martin Natano e77357a75e ITGmania credits 2022-05-23 21:49:42 +02:00
Martin Natano ee65b7b0c4 Replace logo and clean up packaging 2022-05-21 10:05:44 +02:00
Martin Natano f5682cfdac Bundle Club Fantastic song packs in full releases 2022-05-21 10:05:44 +02:00
Martin Natano b6cc8f90fc Align defaults with SL recommendations 2022-05-11 22:31:37 +02:00
Martin Natano b2e60fa48b Bundle Simply Love as the default theme 2022-05-11 21:59:06 +02:00
Martin Natano 2ce8bcea76 Remove SM5 default theme 2022-05-11 21:59:06 +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 b9ebbd32a9 Build universal binary on macOS 2022-05-02 21:23:48 +02:00
Martin Natano b039be360c Fix subdomain matching 2022-05-01 17:33:52 +02:00
Martin Natano f7d8408fc2 Add support for subdomain wildcards to HttpAllowHosts 2022-05-01 13:16:14 +02:00
Martin Natano 6cd4ac88c3 Fix error reporting when opening the download file fails 2022-05-01 10:42:28 +02:00
Martin Natano 07e8abf380 Generate downloads folder in portable mode 2022-05-01 10:27:30 +02:00
Martin Natano 9cf66ae643 Update ffmpeg 2.1.3 -> 5.0.1
Old ffmpeg has a lot of vulnerabilities that have been fixed in newer
versions, see https://www.cvedetails.com/vulnerability-list/vendor_id-3611/Ffmpeg.html.
2022-04-30 23:22:52 +02:00
Martin Natano 692310a0e4 Tweak defaults for the HTTP preferences
Connections to GrooveStats are now allowed by default.
2022-04-13 21:56:04 +02:00
Martin Natano 3ca3bb0773 Fix macOS build 2022-04-11 14:50:00 -07:00
Martin Natano 4c0aef69dd Remove legacy network code 2022-04-11 14:50:00 -07:00
Martin Natano f1e3e4d519 Remove the 'home' and 'legacy' themes 2022-04-11 14:50:00 -07:00
Martin Natano 7f31fd59e8 Remove unused appveyor and travis files 2022-04-11 14:50:00 -07:00
Martin Natano 5019625aaf Remove unused extern cmake project 2022-04-11 14:50:00 -07:00
Martin Natano 28b53ae79e Remove unused build option 2022-04-11 14:50:00 -07:00
Martin Natano dbef16945f Remove unused SDL dependency 2022-04-11 14:50:00 -07:00
Martin Natano 7d2d74fa19 Remove unused cmake files 2022-04-11 14:50:00 -07:00
Martin Natano f710aaf67f Always include full version number in ProductVersion() 2022-04-08 21:55:49 +02:00
Martin Natano 2586eec53f Update lua docs 2022-04-06 21:13:16 +02:00
Martin Natano 54ddcb9df8 Update README.md, round 1 2022-04-03 23:00:40 +02:00
Martin Natano 724b880dfa ITGmania 2022-04-03 22:25:01 +02:00
Martin Natano 65eb85b8e9 Sync LuaDocumentation.xml with 'Lua for SM5'
The LuaDocumentation.xml in the StepMania repository and
quietly-turning's 'Lua for SM5' diverged over time. This commit pulls in
a couple of documentation improvements from 'Lua for SM5'.

- Add documentation for previously undocumented functions
- Improved descriptions
- More crosslinking
2022-04-03 21:35:21 +02:00
Martin Natano d8055e59ab Update Lua.xml documentation 2022-04-03 19:59:29 +02:00
Martin Natano 02008eb469 Rename to ITGmania
- executable name:
  - linux: itgmania
  - windows: ITGmania.exe
  - macOS: ITGmania.app
- config path:
  - linux: ~/.itgmania
  - windows; %AppData%\ITGmania
  - macOS: ~/Library/Application Support/ITGmania
2022-04-02 20:14:57 -07:00
Martin Natano a8b9c1da09 Replace some SM cmake macros with builtin functions 2022-03-31 12:06:18 -07:00
Martin Natano 1ab364c0fa Remove autotools infrastructure
Having one build system is enough.
2022-03-31 12:06:18 -07:00
Martin Natano e3347276b5 Build LoadingWindow_Gtk as an object module
CMake object modules have the advantage of allowing to set additional
compile flags for the involved files, but it's linked into the main
binary with the rest of the object files.

This removes GtkModule.so and the dynamic loading code that goes with
it.
2022-03-31 12:06:18 -07:00
Martin Natano 024f3ac96a Don't crash when reloading songs with players joined
This allows to call ScreenReloadSongs from SSM.
2022-03-19 08:18:58 -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 1036d20e11 Implement FILEMAN:Copy(string fromPath, string toPath)
Copies a file from `fromPath` to `toPath`. Returns `true` if the file
was copied successfully.
2022-03-13 12:37:11 -07:00
Martin Natano 67d1c78450 Implement FILEMAN:Unzip(string zipPath, string targetPath, int strip)
Unzip zip file at `zipPath` to `targetPath`.
`strip` is optional and defaults to `0`. If set to a number larger than
`0`, that many components are removed from the paths of the extracted
files. e.g. `a/b/c` is replaced with `b/c` when stripping one component
or just `c` when stripping two.
Returns whether all files were extracted successfully.
2022-03-13 11:46:28 -07:00
Martin Natano ca86f80743 Add support for onProgress and downloadFile to NETWORK:HttpRequest() 2022-03-13 11:31:49 -07:00
Martin Natano 394bc93915 Add support for streaming transfers
This change adds onChunkCallback to the request. If defined it will be
called repeatedly with the incoming data. This allows to process data on
the go or write it to disk instead of accumulating the data in memory.

Submitted upstream:
https://github.com/machinezone/IXWebSocket/pull/353
2022-03-12 14:18:48 -08:00
Martin Natano bb8fc0f4c2 Change access order for RageFS
Packages > Additional folders > User FS > Initial FS
2022-03-12 14:14:59 -08:00
Martin Natano 168877f6a8 Mount directories read-only where possible 2022-03-12 22:30:54 +01:00
Martin Natano d8b6d36a78 Allow to mark preferences as immutable or deprecated
- Deprecated: The option is read from the settings, but not written back
  when saving. This can be used for migrating options to a new name or
  format. (Not used yet.)
- Immutable: The option can not be changed from Lua. Used for
  security-relevant options that should not be changable by the theme or
  mod charts. Currently that's networking and some file system access
  options.
2022-03-12 22:19:19 +01:00
Martin Natano 7bd7a9b41e Tweak sort defaults to make more sense
- SortBPMDivision: Reduce from 20 to 10 to match up with ECS "tiers".
- SortLengthDivision: Increase from 5 seconds to 1 minute. Divisions of
  5 seconds don't seem very useful.
2022-03-12 20:32:21 +01:00
Martin Natano acb3ad727a Fix sort by length
The sort order is not remembered between songs when sorting by length.
This can be fixed by recognizing SORT_LENGTH as a sort order that can be
used for songs.

Reported by @aeubanks in https://github.com/Simply-Love/Simply-Love-SM5/issues/363
2022-03-12 19:13:11 +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 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
Martin Natano e1b5664f21 Update jsoncpp from version 0.5.0 to 1.9.5
Aside from including a ton of bug fixes, this should fix an issue in the
CI pipeline when building with system libraries that was caused by a
minor incompatibility between 0.5.0 and less ancient versions.

Also, switch to the amalgamated source, because it makes it easier to
keep it up to date.
https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated-(Possibly-outdated)
2022-02-19 14:10:55 +01:00
Martin Natano 3216fdec1e Prevent access to the root file system via the memorycard mount points
Before any memorycard is used the mount point exposes "/". Let's
introduce a special value "(empty)" to allow a DIR mount to point to
nothing.
2022-02-19 11:20:01 +01:00
Martin Natano f79830e7af Fix typo in IniFile.WriteFile() error handling 2022-02-06 15:31:31 +01:00
Martin Natano 7d8ff85018 Remove access to the root FS from lua
On linux / is mounted to /rootfs in RageFile, which allows access to the
_whole_ filesystem from lua. This means themes and mod files can
re-write user data and extract files via USB profiles.

/rootfs was only added for internal use by the alsa, oss and memory card
drivers, so it can be easily replaced with direct fstream file access.
2022-02-06 15:31:31 +01:00
Martin Natano b46ba8f66c Move mbedtls to "External Libraries" in cmake 2022-01-23 15:42:25 +01:00
Martin Natano c4851955e8 Remove unused extern/crypto 2022-01-23 15:31:27 +01:00
Martin Natano f49cb9eff5 Update lua from 5.1.1 to 5.1.5
This keeps all the SM patches intact, but applies the 5.1.5 fixes on
top. All newlines normalized to make diffing with upstream easier.

https://www.lua.org/bugs.html#5.1.2
https://www.lua.org/bugs.html#5.1.3
https://www.lua.org/bugs.html#5.1.4
https://www.lua.org/bugs.html#5.1.5
2022-01-23 12:19:16 +01:00
Martin Natano 69ca42e18c Update zlib from version 1.2.5 to 1.2.11 2022-01-22 20:17:48 +01:00
Martin Natano 6de676984d Add mbedtls and use it on windows 2022-01-18 20:50:15 +01:00
Martin Natano 3fab481611 fixup collect 2022-01-15 22:56:22 +01:00
Martin Natano bb826dc0b2 Allow cancellation of HTTP requests
`NETWORK::HttpRequest()` now returns a HttpRequestFuture with a
`Cancel()` method.
2022-01-15 22:56:22 +01:00
Martin Natano 134fa9a3d9 IXWebSocket: Allow to cancel asynchronous HTTP requests
Usage:

    auto args = this->httpClient.createRequest(url, method);
    httpClient.performRequest(args, ...);
    [...]
    // Oops, we don't actually want to complete the request!
    args->cancel = true;

Submitted upstream:
https://github.com/machinezone/IXWebSocket/pull/332
2022-01-15 22:56:22 +01:00
Martin Natano bc4a275510 Add parameter encoding helpers to NETWORK
This adds two more methods:
- `NETWORK:UrlEncode()`: Encode a single string value.
- `NETWORK:EncodeQueryParameters()`: Encode a table as query string.
2022-01-15 22:56:08 +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
Martin Natano b4f86a2052 Add json encoding/decoding functions to lua
This adds two global functions:

- `JsonEncode()`: Encode data as JSON. Optionally "minify" the result.
- `JsonDecode()`: Decode JSON data.
2021-10-13 19:33:02 +02:00
Martin Natano baa5de4cd2 Fix BinaryToHex()
Previously the function stopped short on nul bytes ("\0") due to usage
of the SArg() macro, which does not retrieve the length of the lua
string.

before the fix: `BinaryToHex("a\0b")` -> `"61"`
after the fix: `BinaryToHex("a\0b")` -> `"610062"`
2021-09-19 22:27:09 +02:00
Martin Natano 8c2f13da2c Fix BinaryToHex()
Previously the function stopped short on nul bytes ("\0") due to usage
of the SArg() macro, which does not retrieve the length of the lua
string.

before the fix: `BinaryToHex("a\0b")` -> `"61"`
after the fix: `BinaryToHex("a\0b")` -> `"610062"`
2021-09-19 22:07:31 +02:00
Martin Natano 1c45882843 Add changes to README.md 2021-09-01 23:51:58 +02:00
Martin Natano 9b3f26d672 Increase Stats.xml file size limit to 100MB
A lot of people have run into the previous ~10MB limit and increasing it
to 100MB doesn't seem to break anything.

I left a limit in place, so that excessively large Stats.xml files on a
USB profile can't be used to make a cab run out of memory. (SM uses a
multiple of the memory that is required for the file on disk.)
2021-09-01 23:20:28 +02:00
Martin Natano f18695df59 Track held misses
This adds a `HeldMiss` attribute to judgment messages and a GetHeld()
method to TapNoteResult.
2021-08-31 18:25:09 +02:00
Martin Natano 65e859d6c5 Increase Stats.xml file size limit to 100MB
A lot of people have run into the previous ~10MB limit and increasing it
to 100MB doesn't seem to break anything.

I left a limit in place, so that excessively large Stats.xml files on a
USB profile can't be used to make a cab run out of memory. (SM uses a
multiple of the memory that is required for the file on disk.)
2021-08-23 22:19:34 +02:00
Martin Natano 6894386662 Change the default binding for P2/back from hyphen to backslash
This is a workaround to make the hyphen key usable in text entry
screens. It allows to add a hyphen to profile names and set a negative
offset in edit mode.

Technically backslash is also a typeable character, but it seems to be
less common names in user names and not necessary for typing negative
offsets.

Fwiw, in outfox P2/back is unbound.
2021-08-19 22:28:59 +02:00
Martin Natano 5c27754b39 Mark keypad buttons as such in the input mapping screen
Both the slash key and the numpad slash key were displayed as 'Key /',
so it's not obvious to the user which key actually has been bound. Let's
display them as 'Key /' and 'KP /' instead. Same for other KP keys.
2021-01-18 21:54:30 +01:00
Martin Natano c5096d24de Update vertex count stats when drawing smooth lines (OGL) (#1932)
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.
2019-11-14 12:40:35 -08:00
Martin Natano 6a4551f958 Detect 8:3 as widescreen (#1929)
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.)
2019-11-03 12:10:05 -08:00