Commit Graph

5686 Commits

Author SHA1 Message Date
mniip
7a459e8021 Fix CI 2023-04-10 23:31:30 +02:00
mniip
f443eeff2f Refactor Engine, Window, and Panel drawing 2023-04-10 23:05:44 +02:00
mniip
4b70eeab55 Refactor PNG and working with alpha 2023-04-05 21:30:24 +02:00
mniip
b26a1b4a88 VideoBuffer pointer correctness 2023-04-05 14:52:20 +02:00
mniip
50bfa7cd5e Remove unused VideoBuffer code 2023-04-05 14:16:25 +02:00
mniip
132e3508cf Refactor tools 2023-04-05 14:11:37 +02:00
mniip
7f84887f6d Refactor things referencing VideoBuffer internals 2023-04-05 02:30:05 +02:00
mniip
b56d3cf611 Fix return values in VideoBuffer::*Character 2023-04-05 02:30:05 +02:00
mniip
e5af4dab68 Refactor resize-related code 2023-04-05 02:30:05 +02:00
mniip
caab738184 Refactor raster draw methods 2023-04-05 02:29:35 +02:00
mniip
e93db9c06a RasterDrawMethods CRTP, PlaneAdapters in VideoBuffer, Graphics, and Renderer 2023-04-05 02:29:35 +02:00
mniip
a0a9ad0abd Add new Vec2, Mat2, RGB, RGBA classes and deprecate some old functions 2023-04-05 02:29:35 +02:00
Tamás Bálint Misius
a2c7242c7c
Fix uninitialized read of Engine::dt early after startup 2023-03-02 20:55:48 +01:00
Tamás Bálint Misius
369dadf81e
Fix crash from new brush code when TPTMP is enabled
Okay yeah this is actually a well-camouflaged refactor.
2023-02-28 14:57:30 +01:00
Tamás Bálint Misius
114017d550
Fix msvc error due to narrowing conversion 2023-02-28 14:57:29 +01:00
Tamás Bálint Misius
a13c29875f
Don't mangle custom element types in life, ctype, tmp{,2,3,4}
Achieved by adding a new element property called CarriesTypeIn, whose bits signal to save loading code which properties of particles of the element class in question carry element IDs. The bits in this property are numbered the same way as sim.FIELD_* constants for consistency. One would signal from Lua that a custom element carries element IDs in its tmp like this:

	elem.property(id, "CarriesTypeIn", 2 ^ sim.FIELD_TMP)

"Carrying an element ID in a property" is to be interpreted as follows: the property is treated as a combination of a PMAPBITS-bit (so, currently 9-bit) unsigned integer lower part holding an element ID and a 32-PMAPBITS-bit (so, currently 23-bit) signed integer upper part holding whatever makes sense for the element. CONV, for example, uses this signed integer in its ctype as the extra "v" parameter for particle creation.
2023-02-28 12:43:45 +01:00
Tamás Bálint Misius
2e2c3181b5
Fix custom elements disappearing on load (fixes #908)
Some checks on particles, most importantly whether their element IDs refers to an enabled element, were done _before_ in-save element IDs are mapped to in-simulation element IDs. This resulted in some particles being removed if their IDs were unlucky enough.
2023-02-28 12:29:26 +01:00
mniip
ed8ec51f95 Copy brushes instead of making temporary changes to them 2023-02-22 09:58:03 +01:00
mniip
515df765e4 Clean up brush code 2023-02-22 09:58:03 +01:00
jacob1
18a4407166
Use ubuntu 20.04 for github runners instead of 18.04
18.04's runner only has around a month left to live and the blackout periods are getting longer
2023-02-21 22:46:46 -05:00
jacob1
6d4f6218a4
Create wrapper around lua_pcall that properly tracks Lua execution time
A bug existed before where certain events would not update Engine's lastTick. If the sim was lagging hard, then this could cause "script is not responding" errors to appear in unintentional situations.

The starting execution time is tracked in LuaScriptInterface instead now, and set in tpt_lua_pcall
2023-02-17 21:58:57 -05:00
Tamás Bálint Misius
e5fec98d28
Fix stamps being impossible to delete
Broken by 416f84a1c4, oops.
2023-02-05 23:09:53 +01:00
Tamás Bálint Misius
1c92280097
Clean up Misc.cpp somewhat
Also make a feeble attempt at rooting out standard C I/O library function usage. Lua still uses it though >_>
2023-02-05 15:59:31 +01: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
0fe8d79e60
Make replace parameter of RenameFile explicit
Also replace a few rename calls with RenameFile calls. Old code doesn't expect rename to overwrite existing files without question, when it in fact can.
2023-02-01 21:48:18 +01:00
Tamás Bálint Misius
aa78a1ee6b
Clean up FFT gravity 2023-02-01 19:56:55 +01:00
Tamás Bálint Misius
85d492bad6
Make request progress variables atomic
These are the only bit of shared state between the Request user thread and RequestManager that aren't covered by RequestHandle::stateMx. The problem was that they were not covered by anything, which meant that they were not guaranteed to be coherent between threads.
2023-02-01 19:26:59 +01:00
Tamás Bálint Misius
b7a6663e08
Fix updating not deleting the old exe on windows
Also fix WriteFile being unable to overwrite existing files. The rename would fail because the file was still open, and the sanity remove in response to that would also fail for the same reason.
2023-01-29 18:54:02 +01:00
Tamás Bálint Misius
bd667dddad
Group request manager files into their own directory 2023-01-27 23:04:30 +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
159d0eb4b7
Group platform files into their own directory 2023-01-27 17:31:40 +01:00
Tamás Bálint Misius
694bc8eb0f
Fix exit behaviour
We can't rely on atexit, handlers registered with it are in a hard to establish ordering relationship with destructors of static and thread-local objects.
2023-01-27 14:55:58 +01:00
Tamás Bálint Misius
11945ba620
Factor out game stuff from PowderToySDL.cpp 2023-01-27 09:29:19 +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
416f84a1c4
Read stamps from stamps.json
... while retaining all the functionality of stamps.def.

Also fix stamp names encoding only 32 bits of the timestamp, migrate from stamps.def to stamps.json if the latter doesn't exist, delete both on migration to the shared data directory, rescan stamps at startup, and make rescanning a painless process in general by removing invalid entries and adding missing entires at the beginning of the list.
2023-01-27 09:27:33 +01:00
Tamás Bálint Misius
9034736708
Move more stuff to Editing.cpp 2023-01-27 09:27:32 +01:00
Tamás Bálint Misius
75191e7ac5
Skip loading authorship info in render 2023-01-27 09:27:32 +01:00
Tamás Bálint Misius
a438584871
Only save custom GOL data if it changed 2023-01-27 09:27:32 +01:00
Tamás Bálint Misius
4f0c365e05
Preprocessor purge round 19: Split and minimize usage of Config.h
Also mostly banish it from other headers, and shuffle standard header includes to minimize cross-contamination between headers.
2023-01-27 09:27:32 +01:00
Tamás Bálint Misius
6ea66f02de
Include "1" in the list of "true-strings" on the command line 2023-01-27 09:27:32 +01:00
Tamás Bálint Misius
3cb6b26d1d
Migrate Singletons to ExplicitSingleton 2023-01-27 09:27:30 +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
49102e395c
Move platform-specific code out of entrypoint TUs 2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
c8ca016494
Move update code to Platform 2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
a7d8ecc6e3
Make WriteFile replace rather than overwrite
This preserves old file if writing the new one fails for some reason.
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
746dbb0cba
Manage search model requests in SearchModel
Also make Client an ExplicitSingleton, and thus fix all known instances of Requests outliving RequestManager.
2023-01-27 09:26:41 +01:00
Tamás Bálint Misius
afda2826bf
Refactor preferences 2023-01-27 09:26:41 +01:00