102 Commits

Author SHA1 Message Date
Tamás Bálint Misius
d83b49a1ed
Update tpt-libs
Like 5103db82887f, this addresses the upload issues experienced on windows, but this time with the official fix from libcurl developers; see the relevant tpt-libs commit.
2025-01-07 21:34:47 +01:00
Tamás Bálint Misius
5103db8288
Update tpt-libs
This fixes upload issues (mainly on windows, though I've found no reason why it wouldn't manifest elsewhere also) and enables querying display refresh rate when using xorg.
2024-12-22 20:55:39 +01:00
JJ Marr
7394a1c081
Add clang-tidy support and fix modernize-use-nullptr (#966)
C++11 standardizes the "nullptr" keyword, which replaces the
implementation-defined macro null pointer "NULL" or a hardcoded 0.

---------

Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2024-12-18 18:11:06 +00:00
Tamás Bálint Misius
1ef78c019a
Migrate embedded files to custom targets
Meson generators seem to be a dying feature, evidenced by the fact that they have been in a state of isolation from the rest of the language for several years at this point:

 - very few things accept generator outputs as inputs, not even generators themselves do
 - unlike configured files, their outputs aren't guaranteed to be always synthesized, and yet they can't be passed as dependencies to other targets
 - they accept strictly one input and can't depend on other files

This makes them really hard to work with in a context that would require either a project resource or a target. Custom targets don't have any of these shortcomings, so this commit migrates embedded files over to those. A real shame, considering that generators can be used anywhere and are generally less messy than custom targets.
2024-12-17 16:15:27 +01:00
Tamás Bálint Misius
860ba13899
Fix crash on windows when using invalid particle/element property values
See the comment in meson.build. Reproduce with

	elem.property(elem.DEFAULT_PT_DMND, "Enabled", false)
2024-12-09 20:43:50 +01:00
Tamás Bálint Misius
9233b0036f
Only use custom LTO flags when we actually want LTO
This considerably speeds up linking of release binaries with msvc when testing locally, when LTO is of no concern.

Also properly override b_lto and b_vscrt in all cases for all targets, never leaving them to take default values.
2024-12-09 17:55:11 +01:00
Tamás Bálint Misius
809ae3ae93
Automatically set b_vscrt on Windows 2024-11-07 18:42:19 +01:00
Tamás Bálint Misius
b46f35c1e5
Upgrade to C++20 2024-11-07 18:42:19 +01:00
Tamás Bálint Misius
119591d14d
Add support for aarch64 on windows, update tpt-libs 2024-11-07 18:42:19 +01:00
Tamás Bálint Misius
87ab4c285a
Bump some ghactions jobs to macos-13 2024-11-04 18:40:47 +01:00
Tamás Bálint Misius
f9ccc24177
Remove the single C TU from the codebase
This leaves one non-C++ TU in the entire codebase: Cocoa.mm is Objective C++ and is only compiled on MacOS, where it's used for clipboard integration. This too will go away when we move to SDL3, which has a proper clipboard API.
2024-10-14 00:14:29 +02:00
Tamás Bálint Misius
281dbfa283
Make to-array.py list itself as a dependency of its outputs
This causes these dependencies to be rebuilt if the script chanages, which is heaps better than having to remember to clean the build directory every time.
2024-08-07 10:20:43 +02:00
Tamás Bálint Misius
295aad1800
Mark dlls as link-time dependencies of powder.exe
So they get copied into the build site even if you invoke only the powder build target, rather than all build targets by not specifying one. Case in point:

	meson compile

vs

	meson compile powder

wherein the latter will build powder.exe but will not copy the dlls into the build site, which are required by powder.exe.
2024-08-06 07:26:12 +02:00
yangbowen
24628db58b Add support for clang-cl. Also refactors compiler detection logic. 2024-07-03 20:49:46 +02:00
Tamás Bálint Misius
9a785dc389
Fix assumption that python is called python
The assumption was introduced by 7e674a887d69, where find_program('python') was used instead of Meson's built-in python discovery services. This turned out to be a bad idea because of course there are systems in 2024 where python is not python 3.
2024-04-29 17:50:45 +02:00
Tamás Bálint Misius
7e674a887d
Replace resource tools with python scripts
May fix pipeline failures on ghactions where makeico or toarray just exit with a non-zero status for no reason.

Also makes it easier (possible, rather) to build TPT using a cross-compiling msvc toolchain on windows; you can't have two different msvc toolchains in PATH on windows because of course you can't.

toarray had been python before, maybe I converted it to cpp to avoid pulling in python as a dependency, I'm not sure. With android vanilla development (hopefully) gaining traction soon, we'll be relying anyway on helper scripts I've written in python, so python will be a dependency sooner or later. Meson implicitly makes python a dependency, but there could be Meson implementations out there that don't rely on python, who knows.
2024-04-26 11:55:50 +02:00
jacob1
e55fc8703a
The squirrel infestation problem is mostly resolved
This reverts commits 5e8a28b94677c8bc62d5f33c94a8615ee44f3f60, e8c24e7e236353d0f68aee972224fbc3504bdb11, e8c24e7e236353d0f68aee972224fbc3504bdb11
2024-04-01 19:45:14 -04:00
catsoften
e8c24e7e23
Add squir... sound. Add sound 2024-03-30 22:33:13 -04:00
Tamás Bálint Misius
c1c1daa9e5
Allow exporting Lua symbols
Which optionally enables loading Lua shared modules from within even static TPT. Not that anyone actually needs this.

This currently can't work on Windows because DLLs there import symbols by [module name, symbol name] rather than just symbol name. One could in theory export Lua symbols from TPT (I don't know the exact MSVC hack this would require, .def files?) and place a lua51.dll next to the executable that just re-exports them, see https://learn.microsoft.com/en-us/cpp/build/reference/exports?view=msvc-170 , but I've yet to try this.
2024-03-24 08:37:38 +01:00
Tamás Bálint Misius
66a09ababd
Remove meson warning about mingw and lto
Because msys2 ucrt64 mingw seems to do lto just fine.
2024-01-13 22:51:32 +01:00
Tamás Bálint Misius
bc9d43bb10
Migrate mingw builds to msys2 ucrt, update tpt-libs 2024-01-12 17:05:00 +01:00
Tamás Bálint Misius
d05b0093b9
Attempt to show and demangle symbols in bluescreen stack traces 2024-01-10 07:41:11 +01:00
Tamás Bálint Misius
6160a6b7d5
Add stack trace to bluescreen on some systems
This is still complete nonsense on posix systems where bluescreen runs in a signal handler, but what can you do.
2024-01-01 09:34:44 +01:00
Tamás Bálint Misius
fb9cba0d01
Some native clipboard support for some platforms
I was hoping SDL2 would get this functionality eventually, but nope, proper clipboard support is staged for SDL3, which we're not going to see much of for at least a few more months. This will have to do for 98.0. The feature can be disabled at runtime from powder.pref.

Implementation status:

 - windows (via winapi): has the most friendly api so of course the implementation is flawless and uses every available optimization >_>
 - macos (via cocoa): I'm bad at cocoa so this is only as good as absolutely necessary; TODO: on-demand rendering
 - x11 (via xclip): I am NOT implementing icccm2; TODO: remove reliance on external tools
 - wayland (via wl-clipboard): oh god wayland oh why, you're almost as bad as x11; TODO: remove reliance on external tools
 - android: TODO; is there even a point?
 - emscripten: TODO; the tricky bit is that in a browser we can only get clipboard data when the user is giving it to us, so this will require some JS hackery that I'm not mentally prepared for right now; also I think the supported content types are very limited and you can't just define your own

x11 and wayland support are handled by a common backend which delegates clipboard management to xclip-like external programs, such as xclip itself or wl-clipboard, and can load custom command line templates from powder.pref for use with other such programs.
2023-12-13 21:49:35 +01:00
Tamás Bálint Misius
28b5b6dc97
Fix some LTO-related emscripten link-time error
I have absolutely no idea. The error in question is the following:

	wasm-ld: error: /home/lbphacker/.emscripten_cache/sysroot/lib/wasm32-emscripten/lto/libhtml5.a(callback.o): attempt to add bitcode file after LTO (_emscripten_run_callback_on_thread)

I have no idea where we use _emscripten_run_callback_on_thread, and I have no idea why LTO would think it's not required when it's obviously required. This commit fixes it by holding the linker's hand even more than it already had.
2023-12-09 16:51:42 +01:00
Tamás Bálint Misius
374209eebe
Remove a few outdated windows-only preprocessor hacks 2023-10-15 12:04:22 +02:00
Tamás Bálint Misius
b89d29b744
Enable libcurl on android 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
f94b436cbc
Use mbedtls on windows 2023-10-03 18:25:34 +02:00
Tamás Bálint Misius
baf484653a
Update tpt-libs 2023-10-03 18:25:32 +02:00
Tamás Bálint Misius
e09b125981
Bump required meson version to 0.64
Needed by configure_file(..., copy: true).
2023-08-31 16:46:33 +02:00
Tamás Bálint Misius
7cb0ac96c9
Emscripten: Enable modularity
This allows multiple instances of the game to be loaded in a single page.

Also stop emitting htmls as a build artifact and require presence of #PowderSessionInfo.
2023-08-22 00:26:34 +02:00
Tamás Bálint Misius
58229f49b2
Emscripten: Support persistent storage 2023-08-22 00:26:32 +02:00
Tamás Bálint Misius
67e41b6705
Emscripten: Add target, update tpt-libs
The code itself is nowhere near being usable in a browser though.
2023-08-22 00:26:31 +02:00
Tamás Bálint Misius
b6c6cf00d0
Enable installation in the meson config 2023-06-11 20:09:00 +02:00
Tamás Bálint Misius
6756c27274
Have ghactions check if dynamic windows builds have all their dependencies
Also update tpt-libs to properly fix the bug I fixed very temporarily earlier.
2023-02-05 15:59:31 +01:00
Tamás Bálint Misius
ef8764e6ab
Temporarily fix mingw builds on windows missing bz2.dll
This will need to be addressed in tpt-libs at some point.
2023-02-05 08:34:08 +01:00
Tamás Bálint Misius
b9c8817386
Group gravity files into their own directory
Also replace non-FFT gravity with "no gravity"; fine for render.
2023-01-27 23:04:27 +01:00
Tamás Bálint Misius
2566506e4b
Provide three levels of install support
Namely: no, yes, and yes and ask at startup.

The install_check option is thus replaced by the can_install option. -Dinstall_check=true maps to -Dcan_install=yes_check, while -Dinstall_check=false maps to -Dcan_install=yes. -Dcan_install=no is new and is recommended for downstream packaging, where -Dinstall_check=false was historically used.

Also improve error messages about bad configuration here and there and scatter configuration code in subdirectories, where they can be closer to their areas of effect.
2023-01-27 09:27:33 +01:00
Tamás Bálint Misius
8680f0d4a7
Remove PATH_SEP, set PATH_SEP_CHAR in meson.build 2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
36d6f1d67e
Preprocessor purge round 18: difficult parts of WIN, LIN, MACOSX, AND 2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
163203b321
Preprocessor purge round 17: easy parts of WIN, LIN, MACOSX, AND 2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
f7478422a4
Preprocessor purge round 16: DEBUG 2023-01-27 09:26:40 +01:00
Tamás Bálint Misius
f0ffa2eeb1
Preprocessor purge round 15: FONTEDITOR, RENDERER 2023-01-27 09:26:40 +01:00
Tamás Bálint Misius
a2a079356a
Preprocessor purge round 14: NOHTTP 2023-01-27 09:26:40 +01:00
Tamás Bálint Misius
29d4d4e91c
Preprocessor purge round 13: X86 2023-01-27 09:26:40 +01:00
Tamás Bálint Misius
b16cbf86fc
Preprocessor purge round 12: BETA, SNAPSHOT, MOD 2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
9068920de3
Preprocessor purge round 11: GRAVFFT
By splitting gravity implementations into separate translation units.
2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
dc8d63fb15
Preprocessor purge round 10: LUACONSOLE 2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
1efafb8d30
Preprocessor purge round 8: trivial binary macros 2023-01-27 09:26:38 +01:00
Tamás Bálint Misius
9542f98b82
Preprocessor purge round 7: Config.template.h 2023-01-27 09:26:38 +01:00