Commit Graph

5857 Commits

Author SHA1 Message Date
Rebmiami
c0f248c6db Updated comments and element description 2023-12-13 06:24:18 -05:00
Rebmiami
39b811e52c Changed LDTC mark color 2023-12-13 05:47:17 -05:00
Rebmiami
fdda40c24d Don't render PAPR if there is a particle on top of it 2023-12-13 03:51:54 -05:00
Rebmiami
53f82f9caa PAPR marks scorch correctly when deco is disabled 2023-12-12 17:53:17 -05:00
Rebmiami
4a15cf5fd3 Fixed LDTC -> PAPR mark color and adjust fading 2023-12-12 17:17:57 -05:00
Rebmiami
1ac7a5d8f5 Mark color now fades when PAPR scorches 2023-12-12 16:51:50 -05:00
Rebmiami
c8fc7b2e2a PAPR now respects deco settings and blackDecorations 2023-12-12 16:31:47 -05:00
Rebmiami
a50f4a10f3 Reduce PAPR+ARAY read/write duration and reformat mark color 2023-12-12 15:57:52 -05:00
Rebmiami
19461e315e Adjustments to ARAY read/write feature 2023-12-12 14:55:13 -05:00
Rebmiami
cb40d869cd Add PAPR interaction with LDTC 2023-12-12 08:38:02 -05:00
Rebmiami
f4dd854b78 ARAY read/writes PAPR and PAPR physics 2023-12-11 23:08:00 -05:00
Rebmiami
8efefb0264 Updated PAPR passthrough behavior 2023-12-11 18:41:37 -05:00
Rebmiami
6f70192742
Merge branch 'The-Powder-Toy:master' into paper 2023-12-11 22:11:50 +00:00
Rebmiami
09f86ff962 Additional PAPR behavior 2023-12-11 17:06:41 -05:00
Tamás Bálint Misius
ef86110516
Fix can_move being set up too early
As in, before element properties were populated. This broke everything that depended on can_move, probably most notably particle displacement based on the Weight property. It didn't help that once element properties were populated, any secondary call to init_can_move would fix the symptoms, such as when any custom element is added with Lua.
2023-12-11 22:50:52 +01:00
Rebmiami
5613bf70f5
Merge branch 'The-Powder-Toy:master' into paper 2023-12-11 14:00:01 +00:00
Rebmiami
74c0467f6b Basic burning properties 2023-12-11 08:48:12 -05:00
Tamás Bálint Misius
a38e1c48bb
Default to identity mapping elements not in the palette for pre-98.0 saves
Newer saves include an element palette which maps save-space element numbers to element identifier strings, see 29189693b3. This is useful because the numbers of custom elements can change, while their identifiers are expected to not change. Not all elements make it into the palette, only the ones that are in use in the save.

98.0 is staged to extend this feature in two ways. First, it'll warn the user of missing custom elements when loading a save that uses such elements, see 36800a76cd. Second, it'll do a better job of deciding what to put in the element palette, see a13c29875f.

In order for detection of missing elements to work, a save's palette has to account for every element number used in the save, including built-in elements. To dispel a misunderstanding regarding that last part: yes, including built-in elements is not crucial if the set of built-in elements only ever grows, but this is not guaranteed.

98.0 creates such palettes, but older code didn't, for various reasons. One reason is that the palette at some point wasn't meant to include built-in elements, see e0d982367b, although this was rectified later in 67b87b1dab. Another reason is that not all cases of element numbers encoded in particle properties were considered, see for example f45d0d1683 and 1f1062408c.

Palettes in existing saves being thus incomplete didn't use to be a problem because older code would just assume that whatever element number wasn't listed in the palette referred to a built-in element and would just map such save-space element numbers to the same simulation-space element number, hence identity mapping.

However, this approach doesn't cover custom elements whose numbers can change, nor does it cover extra built-in elements added by a mod. Worse, a different mod with different extra built-in elements may map save-space element numbers not listed in the palette to its own extra elements.

As a solution to these problems and making use of the fact that palettes are now complete and comprehensive, 98.0 no longer does this default identity mapping, see 73be29aa61. Removing this identity mapping in itself would have broken older saves that use the old identifiers of some elements; that commit works around that by remapping these early in the loading process. By the way, these changes in identifiers are perfect examples of the set of built-in elements changing in ways other than growing.

This still doesn't address the problem in the case of pre-98.0 saves though. Such saves have seemingly valid element numbers (although it's impossible to tell whether these refer to built-in elements from vanilla or extra built-in elements from a mod) but no corresponding entry in their palettes. The user is warned about such elements also, see 9f8449357f. Lacking a better solution, this commit assumes that these elements are indeed vanilla elements and re-enables the default identity mapping for such saves.

In summary, this commit fixes the loading process for saves that were made in 97.0 or some older version and use built-in vanilla elements in ways that didn't trigger their inclusion in the element palette.

For example, until a13c29875f, CONV's tmp was not considered by the palette code, so any CONV with tmp set to an element that wasn't a built-in vanilla element, and which also wasn't used anywhere else in the save, would have been potentially corrupted by the loading process. An example a save that demonstrates this behaviour is id:2633868, which has CRAY particles on the right with ctype set to LIGH, but until this commit, these ctypes would have been set to 0 and the user would have been warned about element number 87 (LIGH) missing from the palette.
2023-12-10 13:38:33 +01:00
Tamás Bálint Misius
7ab52f8bec
Snapshot 354 2023-12-09 20:04:15 +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
cc27126f27
Move palette code to GameSave
Because Simulation shouldn't need to know about palettes.
2023-12-09 16:37:50 +01:00
Tamás Bálint Misius
2d7b40b9e5
Prevent Lua callbacks from being called from secondary SaveRenderers
SaveRenderers populate their own Simulation with Simulation::Load, which may call various callbacks now that these SaveRenderers know about custom elements. Make sure these callbacks don't try to call into the main thread's Lua state.

Seeing as these callbacks now need to be protected from races too, the scopes of some of the exclusive locks of the graphics property mutex needed to be extended.
2023-12-09 16:37:50 +01:00
Tamás Bálint Misius
ca6c67c16c
Factor functions shared between elements into headers
The signature duplication was getting out of hand; too easy to get wrong.
2023-12-09 16:37:49 +01:00
Tamás Bálint Misius
0f1218df0c
Sort out constness of Simulation and Renderer in graphics functions
Mostly. They are now const but only in graphics functions called from secondary Renderers. The primary (main thread) Renderer still allows graphics functions to mutate Simulation; this is required for correct in-PIPE rendering of custom elements.
2023-12-09 16:37:45 +01:00
Tamás Bálint Misius
cfa9fe568d
Move graphics cache to SimulationData 2023-12-09 09:51:41 +01:00
Tamás Bálint Misius
e64c23d50d
Limit access to the LatentHeat property to LATENTHEAT builds 2023-12-09 00:38:12 +01:00
Tamás Bálint Misius
78314a8f7d
Move Simulation::platent to Element::LatentHeat
Also put the feature gated by the macro REALISTIC behind the constexpr LATENTHEAT in SimulationConfig.h.
2023-12-08 23:36:34 +01:00
Tamás Bálint Misius
f8ee7aa0f7
Sort out constness of Simulation::PlanMove
And a bunch of other member functions. This got rid of some nasty assumptions documented only in the form of comments, in exchange for some nasty template nonsense.
2023-12-08 22:40:46 +01:00
Tamás Bálint Misius
dd875987b9
Enable basic rendering of custom elements in secondary Renderers
By factoring element and other static-ish data out of Simulation and protecting basic graphical element properties (i.e. everything that contributes to graphics other than the Graphics callback) with an std::shared_mutex. This is taken exclusively (std::unique_lock) by the main thread when it changes these properties, and inclusively (std::shared_lock) by non-main-thread code that uses Renderer.
2023-12-08 22:40:44 +01:00
Rebmiami
00fa5da4f2 Added PAPR (currently clone of WOOD) 2023-12-06 17:08:58 -05:00
Tamás Bálint Misius
9f8449357f
List element IDs that don't have an identifier associated in a save
36800a76cd lists missing element identifiers but neglects to handle IDs that don't even have one associated.
2023-12-05 10:19:13 +01:00
Tamás Bálint Misius
66136c8866
Customize ghactions job names 2023-12-03 18:28:11 +01:00
Tamás Bálint Misius
daed1e7ae0
Deprioritize some ghactions jobs
This means they aren't run every single commit, only if something interesting is going on (non-dev branch, pull request, etc.)
2023-12-03 18:17:28 +01:00
Tamás Bálint Misius
1ff6a2d0ae
Add a --backend=vs job to the ghactions workflow
This also requires patching CREATEPROCESS_MANIFEST_RESOURCE_ID out of powder-res.template.rc because Meson generates a VS config that instructs VS to add its own and this conflicts with ours. TODO: Undo this hack once https://github.com/mesonbuild/meson/pull/12472 makes it into a release.

Also start using meson compile in place of ninja in some cases because it integrates better.
2023-12-03 18:17:26 +01:00
Tamás Bálint Misius
a594ae996d
Fix android workflows
Meson 1.3.0 broke parentheses in machine files so we'll be using 1.2.3 for now.
2023-11-23 18:46:33 +01:00
Tamás Bálint Misius
1c1e3aaf5a
Enforce build numbers of official builds in build.sh
Also fix the current build numbers.
2023-10-27 18:11:28 +02:00
Tamás Bálint Misius
eb29915243
Use a proper ProgressBar in UpdateActivity
Can't have the update window not use my fancy clip rect progress bars, see 04455ada1c.
2023-10-25 22:20:13 +02:00
Tamás Bálint Misius
e2743a2be1
Fix the casing of the new upstream tpt.version keys 2023-10-25 20:12:48 +02:00
Tamás Bálint Misius
d56510b1ac
Use method indices as LuaLuna thunk upvalues
Rather than member function pointers, which are not necessarily simple pointers and are not necessarily convertible to void * sensibly. This also gets rid of the last instance of lua_pushlightuserdata, which apparently isn't super well-supported by luajit, and which thus often crash on android.
2023-10-25 15:25:54 +02:00
Tamás Bálint Misius
b5d40a49f8
Remove luajit ffi particle access
No point to having it sit around effectively commented out.
2023-10-25 15:20:06 +02:00
jacob1
d5681d8ed9
Remove unnecessary lua_pushlightuserdata usage, use commandInterface global instead
This causes a crash when using luajit on aarch64 Android builds. I didn't remove the lua_pushlightuserdata usage in LuaLuna.h because that's external code and beyond my understanding
2023-10-24 22:12:16 -04:00
Tamás Bálint Misius
7d337ab732
Give emscripten version a starcatcher-compatible name
This means that it can now be taken seriously and handler properly by the starcatcher mod/snapshot service.
2023-10-24 21:23:21 +02:00
Tamás Bálint Misius
f98561d33b
Fix workflows with complicated publish passwords 2023-10-24 20:31:25 +02:00
Tamás Bálint Misius
01728fe1f4
Make curl_multi_wakeup/curl_multi_poll usage optional
Thus dropping the minimum required libcurl version to at least 7.64, possibly further. We have compatibility macros all the way to 7.55 so yeah.

Also fix RequestManagerImpl::~RequestManagerImpl not doing a wakeup after setting running = false. This meant that in the worst case the worker would wake up 1000ms later and only then notice running = false and exit, making the game take overall longer to exit.
2023-10-24 06:50:52 +02:00
Tamás Bálint Misius
3b6d607d98
Fix stable/beta ghaction workflows 2023-10-23 18:05:17 +02:00
Tamás Bálint Misius
ba5883ff84
Fix changelog spam in the update window
That is, in some cases (read: starcatcher, which uses the very last component of the user agent to determine the build ID), you'd get all changelog entries ever, not only the ones between the current version and the one the update server has.
2023-10-22 20:15:37 +02:00
Tamás Bálint Misius
8c2a7e4312
Add surface normal debug tool 2023-10-22 17:57:23 +02:00
Tamás Bálint Misius
dda3e8a9c7
Expose debug constants to lua
Also clean up related resource management code a bit.
2023-10-22 10:57:49 +02:00
Tamás Bálint Misius
ac99fb8a11
Factor PlanMove out of Simulation::UpdateParticles
This will be useful later for a debug feature I'm planning to add.
2023-10-22 10:57:46 +02:00
Tamás Bálint Misius
edcbeaca56
Sort out scopes in Simulation::UpdateParticles 2023-10-22 10:28:17 +02:00