Commit Graph

3264 Commits

Author SHA1 Message Date
Tamás Bálint Misius
bb6c371aa8
Convert images.cpp to actual images
Also remove some dead code.
2022-12-25 11:09:06 +01:00
Tamás Bálint Misius
7173650df9
Migrate AnyType to std::variant
AnyType did resource management wrong. Not that it's particularly nice now, but it's at least correct. There's a change I want to make later that was blocked by this.
2022-12-23 12:15:28 +01:00
Tamás Bálint Misius
50ef07c339
Add underline escape sequence to text renderer
This allows us to do underline the app name in the intro text correctly. More important than it used to be now that the app name can be changed.
2022-12-23 07:39:58 +01:00
jacob1
952c3a6975
Add sim.historyRestore and sim.historyForward 2022-12-22 22:05:05 -05:00
Cracker1000
81bd1fd9e7
Make GLAS strengthening reaction more controllable and not so arbitrary (#856) 2022-12-22 21:36:50 -05:00
jacob1
94406a4320
Fix "End of particles reached" not printing if manually simulating to particle 235008 2022-12-22 21:08:18 -05:00
Tamás Bálint Misius
06802949ab
Add Lua support for partial sim updates 2022-12-22 17:44:06 +01:00
Tamás Bálint Misius
ca93e69b19
UpdateParticles takes a range that is inclusive on both ends 2022-12-22 17:34:43 +01:00
jacob1
888e0f2065
Remove pmap hack in BOMB.cpp 2022-12-20 23:59:17 -05:00
CanGonenc
ed9d405742
FIRE.cpp: minor improvements on readibility (#872) 2022-12-20 20:39:10 -05:00
jacob1
1c459a7e1a
Fix compilation with LUACONSOLE turned off 2022-12-19 22:45:08 -05:00
jacob1
63661a752c
Add evt.beforesim and evt.aftersim for running code only when simulation advances
Only triggered when simulation is unpaused or simulating via subframe debugging. beforesim is the location where most vanilla sim handlers are run.
2022-12-19 22:31:21 -05:00
jacob1
299781bf13
Block solids from being created in detect wall in IsWallBlocking instead, fixes #881 2022-12-19 21:38:42 -05:00
jacob1
74adc9e4b2
Use bitmap in FloodParts to prevent infinite loops in unusual situations, fixes #882
"unusual situations" include all particle slots filling up
2022-12-19 21:38:42 -05:00
Tamás Bálint Misius
7768450e74
Fix document icons on windows
I was wrong in dd7178dbc8, we do need resource.h after all.
2022-12-19 20:51:54 +01:00
Tamás Bálint Misius
dd7178dbc8
Stop setting window icons on windows
Also fix font editor builds on windows and add more font editor builds to the ghactions workflow.

Funny, we don't really need resource.h anymore. The resource compiler does, but we don't.
2022-12-18 19:32:12 +01:00
Tamás Bálint Misius
7bfce3e4a8
Fix local browser offering to open broken saves
It wouldn't actually open them, it'd just exit back to the currently open save. It's better to tell the user the reason why the save is broken instead.
2022-12-18 15:32:45 +01:00
Tamás Bálint Misius
e5c88f154a
Unify icons 2022-12-18 15:00:08 +01:00
Tamás Bálint Misius
9e2185c8a2
Keep thumbnails of SaveButtons with lazily loaded SaveFiles 2022-12-18 10:38:37 +01:00
Tamás Bálint Misius
5ae7755025
Fix the zoom window producing out of bounds coordinates
Also fixes sim.adjustCoords doing the same.
2022-12-18 09:05:55 +01:00
Tamás Bálint Misius
59f89f9a46
Let mods customize app constants
Mainly via meson_options.txt.
2022-12-17 19:45:01 +01:00
Tamás Bálint Misius
1beaebb928
Fix nullptr deref in SaveButtons without an associated SaveFile
I've seen the nullptr deref, but I don't see how it's possible at all. A condition for file->LazyUnload to be called is for SaveButton::wantsDraw to be false, but for that to happen, SaveButton::Tick has to be called after a call to SaveButton::Draw to reset it to false, and then *again* for it to see it being false on entry.

Whatever, the bug is genuinely there and is bad, and easy to fix, no need to figure out in what way it is bad exactly.
2022-12-15 07:46:41 +01:00
Tamás Bálint Misius
2cd1f7bad3
Fix local browser handling large amounts saves badly
So instead of loading every save in sight and rendering the thumbnails for them too, SaveButtons will only do this when they are actually visible, and unload saves and thumbnails when they are not.

Also remove the "Rendering thumbnails" progress bar, which did absolutely nothing.
2022-12-14 19:04:59 +01:00
Tamás Bálint Misius
54cd259a18
Fix PSv parsing
I took extra care to not mess up signedness in readOPS in ab600780d0, but apparently didn't do the same in readPSv.

Also fix a bound check that was broken since aac6b7258c. It's a good thing this was broken, because this allowed negative type values from broken signedness readPSv to get past and cause a crash later on, rather than just cause particles to disappear or something.
2022-12-11 08:55:46 +01:00
Tamás Bálint Misius
b57db7991a
Restrict tmp2 != 0 CONV to 97.0
See 0e361c170c.
2022-12-08 07:57:41 +01:00
Tamás Bálint Misius
b20d38d3b0
Silence unused variable warnings for fromNewerVersion 2022-12-08 07:48:00 +01:00
Tamás Bálint Misius
9a9c686d91
Expose BZ2 to Lua 2022-12-08 07:47:59 +01:00
Jakav-N
0e361c170c
Add inverted element filtering to CONV with tmp2 set to 1 (#871) 2022-12-07 12:43:21 +01:00
Mark Theng
34fa5d0cce
Make file browser respond to search query changes while loading files (#866) 2022-12-07 12:17:30 +01:00
catsoften
510424363b
Replace max/min pressure with constants (#870) 2022-12-07 12:07:46 +01:00
Tamás Bálint Misius
b393050e55
Fix PHOT reflecting off thin walls of particles incorrectly
When PHOT fails to move (do_move or eval_move return "no move"), it looks for
a surface (a contour of boundaries, as reported by is_boundary) along its path
and reflects off (or refracts into, see below) it, using get_normal_interp to
find the point of incidence and get_normal to deduce the surface normal.
get_normal is given the point and angle of incidence, and attempts to traverse
the surface the point belongs to by running two "surface scout" processes.

These processes remember their own position and "heading", a subset of the
eight cardinal directions on the grid. They are initialized with the point of
incidence and a heading that includes all directions whose dot product with
the angle of incidence is non-negative (see direction_to_map). They then
perform a few iterations (SURF_RANGE).

In each iteration, the processes check all eight neighbours of the cell they
are on and select the first neighbouring cell they find that is both a
boundary (as reported by is_boundary) and that is within their heading. They
then move to this neighbouring cell and update their heading by discarding
directions that are not similar enough to (differ by more than 45 degrees
from) the one that took them where they are now (see find_next_boundary). If
they find no such neighbour, they stop.

Continuing the militaristic line of thinking introduced by the term "surface
scout", you can imagine the two processes as two paratroopers who arrive from
above, land on a horizontal surface, and one starts going left, while the
other starts going right. They initially expect the surface they land on to be
close to horizontal, but are also prepared for not too erratic changes in its
angle as they go. Changes too erratic (imagine a precipice) scare them and
force them to stop.

Once the processes finish, an imaginary line segment is drawn between the
cells they ended up on. If the line segment is long enough (estimated by j,
and compared against NORMAL_MIN_EST), get_normal returns a normal that is
perpendicular to it. If it is too short, get_normal gives up and returns
nothing (which results in the PHOT being killed).

This amounts to our paratroopers attempting to get the "lay of the land" by
walking away from where they landed and comparing where they end up. They also
know that if they are still relatively close to each other at the end of their
walk, their measurement is probably wrong and their mission should be aborted.

The bug this commit fixes is that get_normal returns bogus surface normals
when it encounters thin walls of particles, defined as walls exactly two
layers of particles thick. One-layer walls are not really walls, as movement
code allows particles to penetrate these, and three-layer and thicker walls
are too thick for the bug to manifest.

The bug manifests for two-layer walls because the "left" scout process is
drawn to the side of the wall opposite to the one with the point of incidence.
This is because scout processes check neighbours in a clockwise order, and
always select the first suitable neighbour they find. As particles on the
other side of the wall are both boundaries and are within the heading of the
processes, they also qualify as suitable neighbours, so whether a scout
process selects the correct side of the wall depends on the order in which
neighbours are checked.

Essentially, the paratroopers look at their immediate surroundings in a
clockwise order. The right paratrooper always finds the ground and knows where
to step. The left paratrooper finds the Upside Down from Stranger Things and
teleports there.

This bug also affects refraction into and out of thin walls, but since these
walls are thin, the path the PHOT takes inside them is rather short and the
incorrect angle of travel is difficult to see. Furthermore, upon exit, the
same normal deduction bug causes the PHOT to take a path whose angle is almost
identical to that of the path that took it to the wall, so much so that it is
also difficult to see over shorter distances.

The solution is to have the left scout process check neighbours in reverse
order, so that it prefers the right side of the wall over the wrong one. This
does not affect its behaviour when facing thicker walls, but fixes its
behaviour when facing two-layer walls.

The changes in this commit also make find_next_boundary interact with
is_blocking directly to detect a change between the blocking trait of
immediate neighbours. This makes more sense than relying on is_boundary
because find_next_boundary is meant to find a transition from non-blocking to
blocking neighbours within the current heading, rather than to find any
boundary particle. The difference is subtle but important.
2022-11-12 11:10:43 +01:00
Tamás Bálint Misius
ab600780d0
Clean up GameSave somewhat
Namely:

 - get rid of unsafe memory management;
   - use vectors / Planes everywhere;
   - return a vector from serialization functions;
   - have read functions take a vector;
 - improve constness;
 - hide a few implementation details from GameSave.h;
 - get rid of GameSave copy constructor;
 - better member initialization;
 - use the slightly more C++-looking BZ2 wrappers.

The BSON library still takes ownership of the data it parses, and GameSave
ownership is still a joke. Those will need to be fixed later.
2022-11-10 15:15:10 +01:00
Tamás Bálint Misius
f70cc705cb
Remove GameSave::Collapse and GameSave::originalData
... and everything built around them.

A GameSave would hold at least one but sometimes two representations of a save:
one serialized, and one "friendly", accessible for modification. Thus, a
GameSave would have three states:

 - "Collapsed": only the serialized representation was present; this was the
   initial state of GameSaves loaded from files;
 - "Expanded With Data": both the serialized and the friendly representations
   were present; this was the state of GameSaves loaded from files after a call
   to Expand;
 - "Expanded Without Data": only the friendly representation was present; this
   was the initial state of GameSaves being prepared for being saved to files.

A GameSave would be able to go from Collapsed to Expanded With Data with a call
to Expand, and back with a call to Collapse. Of course, this latter transition
would discard any changes made to the friendly representation, for example with
Translate. A GameSave would however be unable to go from Expanded Without Data
to any other state; a call to Collapse in this state would have been a no-op.

There were two instances of Collapse being called, one in the GameSave
constructor taking the serialized representation, immediately after a call to
Expand, and another in SaveRenderer, which would Collapse a save "back down" if
it had originally been Collapsed. Now, consider that there reasons for
constructing a GameSave from the serialized representation are as follows:

 - loading an online save at startup from the command line;
 - loading a local save at startup from the command line;
 - loading a local save when it is dropped into the window;
 - loading a local save for placement of the most recently used stamp;
 - loading a local save for stamp placement via Lua;
 - loading an online save for preview generation while browsing;
 - loading a local save in the stamp browser for thumbnail generation;
 - loading a local save in the local save browser for thumbnail generation.

In some cases, the friendly representation is needed for thumbnail generation
by ThumbnailRendererTask. ThumbnailRendererTask operates on its own copy of the
GameSave, because it runs SaveRenderer on a thread different from the main one
and cannot be sure of the lifetime of the original GameSave. It destroys this
copy when it is done rendering, so the call SaveRenderer makes to Collapse is
pointless.

In all other cases, the friendly representation is needed immediately. In some
of these, SaveRenderer is used from the main thread, but since the friendly
representation of the GameSave will be needed for pasting anyway, the call
SaveRenderer makes to Collapse is pointless again.

So, Collapse goes away. This also means that it is pointless for GameSaves to
hold on to the serialized representation, since in all cases in which they have
access to it, the friendly representation is needed immediately, and with
Collapse gone, they will never need it again.
2022-11-10 12:03:48 +01:00
Tamás Bálint Misius
059b3a8e38
Add verb parameter to http.get/post
Also make ENFORCE_HTTPS optional, but default to enabled, so unencrypted HTTP is disabled by default, and require it to be enabled for release binaries.
2022-11-01 19:25:17 +01:00
jacob1
3011e45475
Fix text in some buttons being cut off prematurely 2022-10-31 16:22:34 -04:00
Tamás Bálint Misius
a57bb09d02
Target v141 toolset with msvc, update tpt-libs
Also reduce per-host connection count to 1, now that we support HTTP/2.
2022-10-29 08:42:39 +02:00
jacob1
8fd6db56d1
Fix string handling in text drawing / width functions
Allows passing in null bytes, which allows 0s to be used with \x0F color codes
Also unrelated, fix two warnings in OptionsView.cpp
2022-10-25 22:35:49 -04:00
Tamás Bálint Misius
a3a874f4d6
Get png avatars from the static server
Also restore concurrent connection / stream counts, and fix a bug that would cause AvatarButtons to try to fetch avatars before they knew what name they belonged to. I apparently broke this in the first PNG commit.
2022-10-24 22:12:10 +02:00
Tamás Bálint Misius
59354731df
Remove all PTI code, use libpng to load avatars and thumbnails
Also write PNGs with libpng, and BMPs with SDL, and have the renderer only generate a large PNG thumbnail, and disable HTTP/2 multiplexing for now so we don't get banned when loading avatars.

simon pls reply to the stupid emails already.
2022-10-23 20:21:05 +02:00
Tamás Bálint Misius
ebb87a17c6
Unbundle bzip2 and jsoncpp, update tpt-libs
Also Disallow linking against non-C++ system Lua, unless configuring with -Dworkaround_noncpp_lua=true, add -Dworkaround_elusive_bzip2 and friends, and get rid of the -image_base hack for macos.
2022-10-20 23:15:49 +02:00
jacob1
6338da7cb7
Fix empty string being discarded at beginning of lua log/return lists 2022-10-19 17:28:13 -04:00
Tamás Bálint Misius
715333295b
Add clip rect feature to Graphics and gfx.setClipRect
Also retire the separate VideoBuffer in Panel and hiding ToolButtons in the GameView ToolButton panel in favour of clip rects.
2022-10-11 20:47:39 +02:00
Tamás Bálint Misius
f18bd6553f
Remove long defunct OpenGL code paths 2022-10-11 20:11:14 +02:00
Tamás Bálint Misius
f378b3ac1d
Fix BSON.h rolling its own 64-bit integer types
This is problematic as per a comment on #860, and everything we target has <cstdint> now.
2022-10-10 10:20:55 +02:00
Tamás Bálint Misius
04e8538a48
Fix uninitialized stickmen
Funny commit message aside, they were throwing warnings in valgrind.
2022-10-06 19:42:13 +02:00
Tamás Bálint Misius
d75e4ccb2e
Fix OOB read when parsing empty string as float
I really don't like how the only way to return with an error from ParseFloatProperty is via an exception >_>

Also do a range check on airTemp only if isValid is true, otherwise it's uninitialized.
2022-10-06 19:25:41 +02:00
Tamás Bálint Misius
304cc3a47b
Move Read/WriteFile from Client to Platform 2022-10-05 19:55:04 +02:00
Tamás Bálint Misius
084f196248
Add http.getAuthToken
This website API was created to enable TPTMP to prove the identity of connecting users, and while TPTMP works fine without explicit support for this from the game, it has to resort to parsing powder.pref. This is not only ugly but also likely to be disallowed by the next version of the script manager. This new script manager will probably come after 97.0, so it's okay for it to rely on a game feature that won't be available until 97.0.
2022-10-05 19:55:02 +02:00
Tamás Bálint Misius
e54df0e6ad
More Lua API 8-bit-cleanliness changes
Round 2 of what I started in 36d034dc2e, mostly fixing c_str usage where it's not sensible.
2022-10-05 11:38:35 +02:00
Tamás Bálint Misius
b4462273b0
Fix a very elusive PHOT reflection crash
get_normal_interp is given a PHOT and scans a line section starting from the PHOT, extended in the direction of its velocity, to determine the surface normal of the surface that is reflecting the PHOT. It uses is_boundary to detect "boundaries" on this line section, defined as one "blocking" cell with at least one "non-blocking" non-diagonal neighbour. It never actually makes sure the position it passes to is_boundary is within the simulation area, so I assume is_boundary is expected to handle this correctly.

Plot twist: it does not. It delegates checking whether a cell is "blocking" (defined as something PHOT would normally fail to move into as per eval_move, but GLAS and BLGA are handled specially) to is_blocking. is_blocking returns true for cells beyond the simulation area (as eval_move returns "no move" for such cells). Once is_boundary sees that the cell it's been given is blocking, it then proceeds to check whether any of its non-diagonal neighbours might be non-blocking. In most cases, non-diagonal neighbours of an out-of-bounds cell are also out of bounds and are thus blocking, but if the cell is_boundary is given is in the innermost layer of out-of-bounds cells, just beyond the simulation area, then it has a neighbour that is in bounds, and that one may not block PHOT. The takeaway is that out of bounds cells can indeed be boundaries, as far as is_boundary is concerned.

This is a problem because get_normal_interp's line section can easily reach beyond the simulation area if the PHOT's velocity is high enough, and if it finds a boundary along this line section, it immediately stops looking and passes its position to photoelectric_effect, which then uses this potentially out-of-bounds position to index pmap. A position with y = -1 causes photoelectric_effect to read from the last few slots of parts data that it then interprets as pmap entries, which then may direct it to particles to spark that are beyond parts. This eventually crashes.

This commit doesn't fix is_boundary's definition of boundaries, but it stops get_normal_interp looking at cells beyond the simulation area.

The crash is difficult to reproduce because there have to be many particles in the simulation for the very last slots of parts to be in use, and for them to point to memory that isn't accessible. PHOT also has to survive a try_move beyond the simulation area first (otherwise the reflection code isn't even run), which requires it to start from EHOLE. I have no idea why this is so. Reproduce the out of bounds read in photoelectric_effect with

	break Simulation.cpp:2934 if nx < 0

in gdb and executing the following Lua code:

	sim.clearSim()
	tpt.set_wallmap(55, 44, 12)
	local i = sim.partCreate(-1, 223, 178, 31)
	sim.partProperty(i, "vx", -300)
	sim.partProperty(i, "vy", 0)
	sim.framerender(1)
2022-10-02 22:57:36 +02:00
catsoften
5d66533f23
Make stickman movement strength independent of gravity (#857) 2022-09-25 14:49:43 +02:00
Tamás Bálint Misius
0f9b1a58b1
Add notification for missing or bad SSL certificates
Also add mbedtls to and document new certificate config options in README.md.
2022-09-25 07:22:23 +02:00
Tamás Bálint Misius
09c2704928
Add CAFile and CAPath config options, use mbedtls in static builds
This is how we'll handle systems where the cert bundle and cert directory is stored where mbedtls doesn't expect it.

Also update tpt-libs to get new curl and mbedtls.
2022-09-25 06:13:35 +02:00
Tamás Bálint Misius
25d6ca9dec
Fix crash when trying to load a stamp that doesn't exist 2022-09-11 16:56:40 +02:00
Tamás Bálint Misius
a674498a96
Clean up Client::DoInstallation
Also Factor out app constants that mods might change into Meson options and clean up format::URLEncode in the process, convert app and document icon data in arrays to actual images, actualize AppStream data for possible future packaging, add alternative command line format for opening filesystem saves and ptsave URLs, fix a memory leak in Platform::GetCwd, and add format::URLDecode.
2022-09-08 06:54:35 +02:00
Tamás Bálint Misius
04e899e824
Use std::vector<char> consistently for file operations
This made it possible to get rid of two GameSave constructors.

Also clean up Client::LoadSaveFile, Client::ReadFile, and Client::WriteFile in the process, and remove unused SaveRenderer::Render
2022-09-08 06:45:25 +02:00
Tamás Bálint Misius
69faea971f
Enable By date button when viewing Favorites 2022-09-07 13:01:52 +02:00
Tamás Bálint Misius
513d2cae3e
Update tpt-libs
Also restructure meson.build and the ghactions workflow a bit, and enable -ffunction-sections and -fdata-sections.

Note that starcatcher uploads have not been tested and most likely don't work.
2022-09-03 07:01:21 +02:00
Tamás Bálint Misius
ed13f33e7a
Fix invalid stamps names being accepted
The .size() == 14 check got lost in the last commit.
2022-08-31 18:52:00 +02:00
Tamás Bálint Misius
9e712eba08
Remove dependency on dirent.h on windows
Also fix a few bugs and other weirdness in Platform::DirectorySearch. Empty string paths would crash and filenames with 4 or fewer characters wouldn't register.
2022-08-30 20:39:44 +02:00
Tamás Bálint Misius
6ba5de6034
Crop stamp thumbnails that don't fit even when resized 2022-08-28 07:12:46 +02:00
Tamás Bálint Misius
23a368dbf0
Clean up DirectionSelector and surrounding code
I really should have done this before merging it >_>

Also fix a few warnings.
2022-08-23 13:47:45 +02:00
Tamás Bálint Misius
36d034dc2e
Fix 8-bit-uncleanliness of most of the Lua API
This fixes bugs like "type\0hello mom" being a property name sim.partProperty accepts and half-fixes bugs like text formatting codes making gfx.drawText exit prematurely.
2022-08-22 19:42:51 +02:00
Tamás Bálint Misius
3c6bd74389
Return HTTP response headers to Lua
Also accept request headers in a string array format, beside the old string-string dictionary format.
2022-08-21 20:54:43 +02:00
savask
22805e14f1
Tidy up some conditionals in simulation code. (#854) 2022-08-13 18:40:26 +02:00
Rebmiami
ae32470c9c
Make QRTZ slightly change color while growing (#852) 2022-08-11 06:20:33 +02:00
Tamás Bálint Misius
8763d6e75f
Expose SDL button codes to Lua
Also sanitize GameController mouse up reason and related code.
2022-08-08 09:13:05 +02:00
Tamás Bálint Misius
059697aba0
Alias dcolor, pavg0, pavg1 to dcolour, tmp3, tmp4 2022-08-08 08:55:32 +02:00
Tamás Bálint Misius
4b0fa65bcd
Don't expose KMOD_SCROLL, apparently it's too new 2022-08-01 09:55:23 +02:00
Tamás Bálint Misius
21438d435d
Expose SDL keycodes and scancodes to Lua 2022-08-01 09:44:42 +02:00
catsoften
6aa68adbf4
Add custom gravity mode and replace hardcoded gravity interactions (#820)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2022-07-31 08:19:16 +02:00
jacob1
a0016a2b9c
Fix exception when passing nil to some functions in interface api, fixes #849 2022-07-20 21:52:03 -04:00
Tamás Bálint Misius
c603c41b92
Fix PIPE graphics hack giving Lua graphics functions bad particle IDs 2022-07-16 13:27:28 +02:00
Tamás Bálint Misius
ae253ebc75
Add real v parameter to sim.partCreate
Currently it detects presence of v incorrectly (via if (ID(type))) and thus rewrites v = 0 to v = -1, even if 0 is actually what you want. Especially problematic if you're trying to spawn GOL (so LIFE(ctype=0)).
2022-07-06 11:34:21 +02:00
Tamás Bálint Misius
766ffd4ad6
Add sim.partExists and elem.exists 2022-07-03 15:40:35 +02:00
Tamás Bálint Misius
289c2c4528
Fix handling of malformed scale: and proxy: arguments 2022-06-13 13:40:41 +02:00
jacob1
833973f1fc
Mark saves with GLAS/QRTZ/TUNG as 97.0-only
They immediately break if under pressure in older versions, because pavg1 (tmp4) isn't set
2022-06-13 00:53:06 -04:00
jacob1
79f6fd728c
Fix, Deprecate, Remove, and Replace tpt.element_func / tpt.graphics_func 2022-06-04 22:16:45 -04:00
Tamás Bálint Misius
fb7132a923
Fix LITH conducting through INSL 2022-05-27 06:22:22 +02:00
Tamás Bálint Misius
fb318c71ec
Fix a missing #include 2022-05-26 17:53:45 +02:00
Tamás Bálint Misius
c7e9706295
Let NEUT pass through BGLA
GLAS does this, there's no reason for BGLA to not do it also.
2022-05-10 14:27:45 +02:00
jacob1
c8c0f90871
Use date in screenshot filenames to ensure each screenshot's filename is unique 2022-05-06 01:27:33 -04:00
Cracker1000
23af1042b4
Make PHOT change its wavelength upon colliding with charged LITH (#841)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2022-05-04 22:34:23 +02:00
jacob1
f70f222a61
Remove inaccuracy in OIL's description 2022-05-02 11:34:33 -04:00
Tamás Bálint Misius
b278eb4393
New WTRV + BCOL -> OIL reaction in presence of PTNM
Yes, Factorio is a good game.
2022-05-02 06:14:49 +02:00
Cracker1000
823ff9080e Remove unnecessary .life change from PSNS 2022-04-18 14:39:11 -04:00
Tamás Bálint Misius
f7527b46e6
Update tpt-libs, add support for android 2022-04-14 21:18:21 +02:00
cracker1000
29ed52d50e Fix find mode not highlighting WARP particles 2022-04-10 11:52:47 +02:00
Tamás Bálint Misius
6fe82d7221
Update tpt-libs, use SDL2main the way it's meant to be
Also fix the first mouse click not being detected on windows with sdl 2.0.20. Apparenlty, we need SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH set to 1 for it to be detected.
2022-04-10 10:39:23 +02:00
Tamás Bálint Misius
f6878dcdb6
Free array we get from CommandLineToArgvW 2022-04-08 07:14:39 +02:00
xphere07
18c604fd42 Element scroll bar Improvement
Signed-off-by: xphere07 <xphere07@outlook.com>
2022-04-04 23:21:24 -04:00
jacob1
48e15af738
Restrict version to 97.0 in saves with reinforced glass 2022-04-04 23:19:36 -04:00
Departing
d5f94f4718
Added chemically strengthening GLAS (#837) 2022-04-04 23:17:08 -04:00
Tamás Bálint Misius
254b4a642a
Fix cryptic level 0 Lua error built-in elements sometimes produce
If the built-in update function is allowed to run, it can change the particle's type. The code path assumes that there is a Lua update function to call on the particle, but this type change may break this assumption and cause the code to call the update function of an element that doesn't even have one, producing a weird error message with no line number.
2022-03-31 16:46:24 +02:00
Tamás Bálint Misius
b2ddb39b42
Add IDENT to user agent again
The server got fixed.
2022-03-26 18:35:23 +01:00
Tamás Bálint Misius
01e2c2d3f0
Remove new IDENT portion from user agent string
The server isn't prepared for it and fails requests that fiddle with the user session with an 500.
2022-03-26 17:43:48 +01:00
Tamás Bálint Misius
76b89f8da1
Handle SDL_CreateWindow failure slightly better
Might explain weird breakage we experience on chromebooks. Difficult to say as we don't have access to chromebooks.
2022-03-26 17:43:43 +01:00
jacob1
14348437a6
Fix TRON being unable to pathfind to the top and left edges of the screen 2022-03-18 18:13:01 -04:00
Tamás Bálint Misius
6ff385d92d
Fix crash when trying to render an empty stamp
Empty stamps are those whose block width or height is 0. While they are technically valid and certain parts of the game are prepared to handle them, others aren't, so it's safest to just adjust the definition of valid stamps to exclude empty ones.
2022-03-16 06:45:24 +01:00
Tamás Bálint Misius
df7bbd3b8e
Prevent SaveRenderer from calling into Lua
Also clear SaveRenderer graphics cache along with the main Renderer's when needed, and revert to built-in element callbacks rather than nothing at all when assigning nil to a callback slot in Lua.
2022-02-23 22:22:10 +01:00
Tamás Bálint Misius
bfe94618c6
Include slightly more future-proof target type in user agent string 2022-02-22 08:10:18 +01:00
Tamás Bálint Misius
1e440d078c
IDENT_PLATFORM can now be MACOSARM 2022-02-22 06:56:41 +01:00
jacob1
477909d00f
Redo code that makes SOAP float on OIL
Rather than hacking velocity, do it directly through can_move. Add a special case to make it slowly float upwards, rather than immediate like most weight differences in TPT.
2022-02-21 23:56:52 -05:00
jacob1
982fdff528
Add safeguard to try_move to ensure we don't write to out of bounds pmap
This is a follow up to this crash fix - 0ed8d0a0be
This may possibly fix other crashes users occasionally experience, especially in the case of high velocity particles with loop edge mode on. Even so, there are other bugs at play, as a crash here can't be triggered if pmap is in a correct state
2022-02-21 23:36:10 -05:00
Tamás Bálint Misius
656ace10c6
Add support for MacOS on ARM
Also build with real -no-pie on ghactions, and fix SDL include directories (it's probably blind luck that they worked correctly on most systems).
2022-02-18 18:56:41 +01:00
Tamás Bálint Misius
6ef505ccca
Fix crash on exit if a Lua component is added to a Lua window
Very similar in nature to the problem fixed by 0fcad65d. Again, it'd be massive help if we didn't destroy the Lua state explicitly in LSI's dtor. But this is not worth refactoring LSI for.
2022-02-11 22:19:42 +01:00
Tamás Bálint Misius
7ab720d847
Fix pipe mirroring (fixes #750 again) 2022-02-04 09:07:02 +01:00
Tamás Bálint Misius
0fcad65d6f
Fix crash on exit if any modern particle callback is registered
All these smart pointers have to be cleared before the Lua state is closed. Ordinarily, we'd have a smart pointer to the Lua state defined earlier in LSI than these smart pointers, which would take care of destruction in the correct order, but tfw technical debt.
2022-01-28 08:03:14 +01:00
Nova
f5bc2a5f0d
Fix crash on network activity (#824)
Ignoring broken pipes led to libcurl crashing when connections were dropped, rather than re-attempting. Now, libcurl is not set to ignore broken pipes. Closes #823.
2022-01-07 15:15:09 +01:00
jacob1
eadd381da9
Fix incorrect RNG call in WARP, code cleanup
x velocity was set using .chance instead of .between. This always returned false, meaning vx always was set to .5 giving a rightward bias
2022-01-06 20:29:07 -05:00
Tamás Bálint Misius
95a9e93645
Fix pressure-sensitive particles breaking on load, again
Repurposing the comment I added because I'm lazy: pavg[1] used to be saved as a u16, which PressureInTmp3 elements then treated as an i16. tmp3 is now saved as a u32, or as a u16 if it's small enough. PressureInTmp3 elements will never use the upper 16 bits, and should still treat the lower 16 bits as an i16, so they need sign extension.

The code that was originally responsible for this somehow got lost in the tmp3/tmp4 migration.
2021-12-25 09:44:09 +01:00
Tamás Bálint Misius
286d0d60b9
Fix mingw-on-linux builds 2021-12-24 22:47:57 +01:00
Tamás Bálint Misius
84d6ca6938
Fix -Dhttp=false builds 2021-12-13 15:23:33 +01:00
xphere07
674134588c
Upgrade to C++17 (#819) 2021-12-13 14:41:02 +01:00
Tamás Bálint Misius
ce84e60074
Fix a few warnings
I found these looking at ghactions output.
2021-12-09 09:11:47 +01:00
Tamás Bálint Misius
c0e3818df3
Save higher halves of tmp3 and tmp4 if needed (fixes #822 with dbd971fb) 2021-12-09 08:40:27 +01:00
Tamás Bálint Misius
dbd971fb05
Convert float pavg[2] to int tmp3, tmp4
Also add GameSave::PressureInTmp3 to check for elements with pressure memory and fix TUNG not sampling pressure on creation. This does not in itself fix #822 because tmp3 and tmp4 are still saved in 16 bits each, so full ctypes still don't fit in tmp3.
2021-12-09 07:49:31 +01:00
Tamás Bálint Misius
b587732d7b
Fix render failing to compile with GCC 11
Due to Client::SetPref not being available for use by AddCustomGol. GCC 7 didn't mind this, weird.
2021-12-07 16:44:48 +01:00
jacob1
c25e35e9ff
Read float bson settings as floats, not ints 2021-11-20 23:56:47 -05:00
Tamás Bálint Misius
f07879d165
Fix potential crash when adding a custom GOL type
GOLWindow would try to access a GOLTool that would have been deleted earlier when the menus were rebuilt.
2021-10-27 21:20:58 +02:00
Tamás Bálint Misius
0f2eedd4fb
Make thread_local replacement for MinGW slightly nicer 2021-10-23 10:08:26 +02:00
jacob1
0ed8d0a0be
Fix flood_water movement cancel check
This fixes a crash with water equalization on, with loop mode enabled, when there are high velocity particles near the edges. This can be occasionally reproduced with id:2800901

The water was moved to a new position and pmap updated, but the movement code continued, assuming water was at its old position. pmap for the WATR's old position won't be cleared once it moves, leaving a stale entry. If a particle then looks up the water in that location and tries to swap positions, this can cause a crash at the end of try_move
2021-10-23 00:52:13 -04:00
Tamás Bálint Misius
5582d6881d
Update tpt-libs, add support for compiling with MinGW on Windows 2021-10-22 23:14:54 +02:00
Tamás Bálint Misius
6653080400
Fix cursor placement in textboxes with single-character text
TextWrapper used faulty logic for converting local points to wrapped text indices: a check on curr was skipped if next was end-of-range.
2021-10-17 13:59:35 +02:00
Tamás Bálint Misius
afa9fd3d8f
Remove precompiled headers, fix a few problems they masked 2021-10-15 17:04:04 +02:00
Tamás Bálint Misius
d675d483bd
Leave the original GameSave alone in Simulation::Load 2021-10-13 11:26:48 +02:00
Tamás Bálint Misius
816b9eda3d
Disable text input as startup
We're not handling any keyboard input at that point anyway.
2021-09-05 19:30:55 +02:00
jacob1
1d0e039cec
Fix crash when closing game, while not on the main screen, with lua components active
Also delete unnecessary RemoveComponent call
2021-09-03 23:38:02 -04:00
Tamás Bálint Misius
6cb54b1857
Fix near-RTEMP temperatures being loaded incorrectly in some cases 2021-09-03 08:16:19 +02:00
jacob1
46d7682ed9
Regenerate window when changing sdl settings if "old fullscreen" is enabled 2021-09-03 00:06:15 -04:00
jacob1
50336565b4
Fix missing delete commandInterface, fix gc issue with LuaComponent/LuaWindow
lua_close wasn't being called at all before due to the delete commandInterface being missing. With it there, the lua gc could delete the LuaComponent before the LuaWindow. Make sure if that happens, it tells the parent LuaWindow it's already been gced
2021-09-02 23:31:30 -04:00
jacob1
4f8fc739ac
Version 96.2 (350) 2021-08-29 22:53:12 -04:00
jacob1
323c443d2a
Minor LIGH compat fix
old LIGH with invalid high .tmp2 will spawn a line of LIGH, rather than disappearing
2021-08-29 14:02:21 -04:00
jacob1
4f36ab10c1
Add back "Name already taken" message 2021-08-28 00:02:19 -04:00
jacob1
44590d82e9
Add a few more Lua functions
sim.replaceModeFlags
sim.listCustomGol
sim.addCustomGol
sim.removeCustomGol
tpt.perfectCircleBrush
sim.floodDeco
2021-08-27 23:57:55 -04:00
jacob1
63fe8e46b2
LIGH now lasts longer and expands frame-by-frame, fix LIGH stamping bug 2021-08-26 22:26:55 -04:00
Tamás Bálint Misius
688dc272e4
Update tpt-libs
Also remove duplicate momentumScroll member from Engine.
2021-08-22 12:42:33 +02:00
Tamás Bálint Misius
b5d1712123
Define lua_pushglobaltable only if it's not already defined
This fixes compatibility with moonjit, a luajit replacement that lies about which API level it implements.

Also link more stuff statically on linux.
2021-08-09 07:17:34 +02:00
Tamás Bálint Misius
eac92d1b04
Optimise undo history memory usage
By storing only the differences between Snapshots where possible.
NOTE: This may be reverted later if it causes too much trouble.
2021-08-04 17:19:15 +02:00
Tamás Bálint Misius
ea07244119
Refresh history code in GameMVC 2021-08-04 17:08:23 +02:00
Tamás Bálint Misius
483fde0698
Fix GCC11-only errors and warnings 2021-08-04 16:58:44 +02:00
Cracker1000
a3a45db3e4
Add AMBP and AMBM tools (#778)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-07-29 17:50:24 +02:00
Maticzpl
4ed600b621
All HSV sliders in color picker (#796)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-07-29 17:23:39 +02:00
catsoften
f13fe3d36b
Prevent property tool from being used with bad values (#791)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-07-29 17:20:13 +02:00
Tamás Bálint Misius
e3c9176277
Bump version to 96.1.349 2021-07-18 20:34:36 +02:00
Tamás Bálint Misius
c0e065cc76
Fix certain Lua APIs mangling integers
Also fix a few warnings.
2021-07-18 20:33:50 +02:00
jacob1
133c8db0c7
Make Lua prints fade out better 2021-07-16 13:58:31 -04:00
Tamás Bálint Misius
5f90a80fe3
Disallow GOL rulesets with no B states 2021-07-15 21:05:24 +02:00
Tamás Bálint Misius
d040de396a
Fix find mode not always succeeding in darkening particles 2021-07-15 19:29:21 +02:00
Tamás Bálint Misius
11188c85c3
Fix element identifiers not being accepted by tpt __newindex
Becuase *of course* whether it succeds or not depends on whether you've rebuilt menus.

With all seriousness, the real culprit here is GameModel::GetToolFromIdentifier, which looks for tools in the menu section tool lists, plus another list with tools that aren't in any menu section. This is absolutely blaphemous, but I don't feel like refactoring this right now. It also wouldn't be a problem in itself, but allocating an element also doesn't rebuild these lists, only changing the MenuSection property and a few other obscure operations do. This makes allocating elements also rebuild these lists.
2021-07-14 08:48:42 +02:00
Tamás Bálint Misius
a463180e2a
Fix elem.allocate corrupting LSI when running out of IDs
The can_move bits weren't guarded by newID != -1.
2021-07-14 07:29:50 +02:00
jacob1
e80dc7b114
Preserve GoL deco in older saves; deco on builtin GoL no longer renders when decorations are off 2021-07-14 00:26:21 -04:00
jacob1
943f9d6c03
LITH explodes when overcharged, update charge graphics 2021-07-14 00:17:47 -04:00
jacob1
cea629c6c0
Make LITH->GLAS reaction easier 2021-07-13 23:01:02 -04:00
jacob1
31f1b62a4c
Disallow CGOL with duplicate rulestrings or names > 7 chars 2021-07-13 22:09:49 -04:00
jacob1
f2d92bc3d7
Don't let GLOW ctype go negative 2021-07-13 21:50:36 -04:00
jacob1
c93b72c800
HUD: Show GLOW and LITH ctype as number, don't show ctype for elements which use it as data storage (such as PHOT or PRTI) 2021-07-13 21:48:55 -04:00
jacob1
9ac8b00b8d
Fix "B12345678/S012345678/17" appearing in HUD for ctype 78 2021-07-13 20:53:58 -04:00
jacob1
54a2abce3b
Default drawfrequency to 0, because of frame drop issues
Very apparent when using LIGH, which only stays on screen for one frame. Sometimes LIGH rendering is skipped entirely.
2021-07-11 18:04:51 -04:00
jacob1
05f722b397
Fix custom brush loading 2021-07-11 16:48:05 -04:00
Tamás Bálint Misius
cfeda0fdba
Fix GOL showing up where it shouldn't
The underlying problem was that the spreading step in SimulateGOL would record activity concerning a cell to builtinGol even if said cell already housed a non-GOL particle. The culling step handles these records and purges them once it's done (thus builtinGol only ever has non-zero values inside SimulateGOL), except in this case, it saw the non-GOL particle and skipped the cell without purging the corresponding records. This would later let GOL spread seemingly out of nowhere.
2021-07-11 12:21:48 +02:00
jacob1
34615536ce
Update build number (96.0.348) 2021-07-10 19:33:17 -04:00
moonheart08
a014c81ad6
Last minute explosiveness enhancement for LITH (#788) 2021-07-10 16:17:58 -04:00
catsoften
c6a52d1425 Prevent ROCK from repeatedly breaking into STNE and reforming under pressure 2021-07-10 00:18:46 -04:00
jacob1
8a788fac78
Misc minor changes to new elements
LITH: show .tmp2 in HUD, remove outdated comment
SLCN: update description
ROCK: form under pressure from both normal LAVA and LAVA(STNE), as these are basically the same thing
2021-07-09 22:09:24 -04:00
jacob1
37dfe728d0
Update build number and readme 2021-07-04 15:37:46 -04:00
moonheart08
66c5287824
Adjust color of LITH (#787) 2021-07-04 14:55:20 -04:00
jacob1
fb3fcfcdb7
Fix local saves and migration process on Windows 2021-07-04 14:35:25 -04:00
jacob1
fe49e58de8
Make ROCK more resistant to DEST (like CNCT is) 2021-07-03 23:34:38 -04:00
Tamás Bálint Misius
fb506599c2
Bump version to 96.0.346 2021-06-30 22:44:37 +02:00
jacob1
d45c73e9e5
No longer necessary to blame Simon 2021-06-28 21:33:03 -04:00
jacob1
26327effd5
Compile fixes for renderer, no lua, and no gravfft options 2021-06-28 21:02:59 -04:00
jacob1
6dd7d9bd46
Add bounds checking to sim. tool APIs (crash fix) 2021-06-27 21:43:14 -04:00
catsoften
e97925f0fd
Change PTNM reactions to take pressure from reacting particle's coordinates (#784) 2021-06-27 20:27:02 -04:00
jacob1
91a1f19c52
Adjust LITH color slightly so that it isn't the same as CNCT 2021-06-27 18:47:09 -04:00
jacob1
f9d9951237
add extra failsafe in RequestManager when shutting down 2021-06-27 18:43:04 -04:00
jacob1
76699d2f7e
Make ROCK harder to get, greatly increase ACID resistance
This helps prevent ROCK from appearing in normal situations, which can easily get to pressure > 2 just from the movement of the falling LAVA.
2021-06-27 18:39:51 -04:00
jacob1
b3aa6252ce
Add button in options menu to migrate to shared data directory a18855301306
Summary of migrated files will be shown to user in a popup, and a log file with every moved file will be left in the original directory
stamps, saves, scripts, screenshots, and powder.pref will be migrated. Recordings are not.
2021-06-27 18:25:59 -04:00
jacob1
0292344328
Fix Windows compile error, switch std::string to ByteString 2021-06-26 01:05:56 -04:00
jacob1
d1016cf58d
move Platform.cpp to common/, seems to fit in a little better there 2021-06-26 00:58:37 -04:00
jacob1
6e0ace2e4d
Add / move some filesystem methods to Platform.cpp 2021-06-26 00:58:37 -04:00
Tamás Bálint Misius
72948978fa
Fix over-eager MSVCRT bounds checking crash in LuaTCPSocket
MSVCRT doesn't like .operator[](.size()), it's safer to just replace all &.operator[x] with &.operator[0]+x.
2021-06-24 07:10:02 +02:00
Tamás Bálint Misius
fb514ca9e3
Return index into range passed to :send rather than bytes written
This is what LuaSocket used to do.
2021-06-22 20:57:17 +02:00
Tamás Bálint Misius
dcf0764fd8
Return a reason for failure from sim.loadStamp 2021-06-21 08:04:32 +02:00
Tamás Bálint Misius
cb52495472
Use GameController::ClearSim in sim.clearSim
Unlike Simulation::clear_sim, this also resets the save info in GameModel, i.e. is equivalent to pressing the 'Erase everything' button.
2021-06-19 21:55:08 +02:00
jacob1
6bd1289bdd
restrict ambientAirTemp to valid limits when set from Lua 2021-06-18 23:37:04 -04:00
jacob1
3c9882598c
When air temp textbox is defocused, correct out of range temperatures 2021-06-18 23:07:17 -04:00
jacob1
b0e29c8c23
Fix crash when doing sim.ambientAirTemp(0/0) 2021-06-17 23:21:29 -04:00
jacob1
5eb2495d61
Ensure tpt.set_wallmap is called with 3, 5, or 7 arguments 2021-06-08 23:11:25 -04:00
jacob1
9775527123
Misc compile fix for the unsupported opengl configuration 2021-06-08 23:11:24 -04:00
Tamás Bálint Misius
1851677dbe
Return version (aka history index) from sim.getSaveID
Makes sense because sim.loadSave has a history argument.
2021-06-05 08:26:43 +02:00
Tamás Bálint Misius
788c9cf9fc
Restrict saves with ambient air temp set to v96.0 2021-06-04 22:54:31 +02:00
Tamás Bálint Misius
ffe730c615
Save ambient heat temperature and add it to options 2021-06-04 22:39:07 +02:00
Tamás Bálint Misius
7cfc5aa9f6
Actually store the return value of curl_easy_send, oops 2021-06-03 21:25:28 +02:00
Simon Robertshaw
5ec8baa406 snapshot-216
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEL1ZG5CrcaMThtrZgTlijLVEOGZUFAmC0Ji4ACgkQTlijLVEO
 GZVAKhAAw7DB+87+L2m8OXbqhI4t113OHq0oPvHhetFuORLs4Z6xMhzZQaaUJ2TM
 bNd/qZidf2KHq5kwkeqkC081fQbWdWZ/PlWJMNrNKGF0iKh82EJLXHICVTHTmiAU
 baYMnLPMl2RKO9OsA8vU1cUj8VuXddRAWyVLOYZnwWE/y+iNH5ifVpS/xNFpuUTA
 mv3NLoWilkKX7gKJ8BEg3MM3zIvCWMoaGOL1NNnLo23Q/x6IrKJH9R0roBs3k2E9
 VCjhGXIxtGARkNFRfP87OfEFDmvqfdDP5ByZlvEdkRFtNxfdAHD7bVFEHBjRnYlh
 5Gt0aEmXUg5jmg4cTeenog9lSUSNlWEhqF2QLvsio+jtDALgeCbX3PwauJ9OMaOH
 C9EteG3zJdUvTnjAnme3fkr61bbuh1dolTckJQPydDaEvD/Z2eUnv++jD+qG3F3U
 nczxYKBDUhRhPeBaQnQef18t/Sxqym1TFTdUQxBrMPQkYfLuJLvfOip5lxALe1zS
 ZcelFKsKTlQXsaHcW7gIKmUAwOuOoeZq0HrtqNhd30/Px2/5+knEc1omjqSzoDy5
 1q0DVSFPj96vVtDuO0acuKhacKhY/rkjldAvrEEMLi7oYy6MyeCPKl2aPJhNLAT+
 wMF1jQaGQHunQ5DtbrK1rd1UYpLoowHu8fkMQr22Jru3w7Vbp5k=
 =4goh
 -----END PGP SIGNATURE-----

Merge tag 'snapshot-216'

snapshot-216

# gpg: directory '/c/Users/Simon/.gnupg' created
# gpg: keybox '/c/Users/Simon/.gnupg/pubring.kbx' created
# gpg: Signature made Mon May 31 00:56:30 2021 GMTST
# gpg:                using RSA key 2F5646E42ADC68C4E1B6B6604E58A32D510E1995
# gpg: Can't check signature: No public key
2021-06-02 16:35:23 +01:00
Cracker1000
7be888ccf1 Make debug mode show .tmp2 for VSNS too. 2021-05-30 19:54:10 -04:00
jacob1
076be894d1
Take snapshot when using ctrl+x 2021-05-30 19:45:31 -04:00
Tamás Bálint Misius
48d1226f59
Rewrite tpt.set_wallmap, it can now set WL_FAN velocity 2021-05-28 11:58:25 +02:00
Tamás Bálint Misius
ed29794fb8
Remove LuaSocket, add new socket API backed by libcurl 2021-05-27 15:13:43 +02:00
Simon Robertshaw
10a6bb7120 Remove pastel glow on "inactive" GLOW, fix FIRE_ADD variables.
FIRE_ADD, firea/r/g/b variables adjusted to work similar to v51.1.
Use RNG to assist with smooth(er) transition from PMODE_FLAT to PMODE_ADD
2021-05-22 21:48:06 +01:00
Tamás Bálint Misius
d8e641b977
Fix dangling pointer smuggling in PreviewModelException 2021-05-22 14:53:45 +02:00
Sam Robertson
2c207a934e
Makes GLOW element glow under pressure. Fixes #774
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-05-22 11:18:31 +02:00
jacob1
14be92c013
Prop tool - only check GoL rulestings / names for ctype
They are meaningless when applied to any other property, even .type
2021-05-19 00:04:23 -04:00
jacob1
a25fa700e2
Don't show GoL .tmp in HUD, check if create_part was successful while simulating GoL 2021-05-11 23:40:31 -04:00
jacob1
829c0bced5
Fix issue allowing drawing unlimited LIGH with 1x1 cursor
Also fix warnings from a previous commit
2021-05-10 21:04:08 -04:00
jacob1
fca0c62cd7
Remove "Auto Draw Rate" option, there is no reason to turn this off
It can still be turned off or adjusted via Lua, though
2021-05-10 00:07:52 -04:00
jacob1
aac6b7258c
Improve stack pasting behavior
It will now clear all particles in positions being pasted over
2021-05-10 00:02:27 -04:00
jacob1
0e530dc0ca
Fix "NONE" showing in HUD in many cases 2021-05-02 23:58:19 -04:00
jacob1
4e2e054c50 Make username case-insensitive when logging in
Username will be fixed automatically if not in the right casing
Logins are always sent over https
Logins are stored and salted using bcrypt on the server-side (wraps around original md5), fixes #294
2021-04-24 22:39:56 -04:00
Tamás Bálint Misius
2e16eecae0
Fix a bunch of LDTC and DTEC issues
Namely: LDTC GoL detection, ctype-drawing and HUD rendering, alongside DTEC HUD rendering.
2021-04-18 20:32:32 +02:00
jacob1
f441626de4 Fix some issues in elementCount
Count goes negative if an element is killed due to .life=0 on the same frame an elementRecount is scheduled
element count skyrockets when recount is scheduled during game pause
Element count increases by a static amount when undoing, because it schedules a recount without clearing the old counts
2021-04-18 14:01:51 -04:00
Tamás Bálint Misius
11f6abdfca
Update elementCount when restoring a snapshot (fixes #592) 2021-04-18 15:48:10 +02:00
Tamás Bálint Misius
8590a74785
Also flush prefs on user change, see previous commit
Flushing user changes to powder.pref was in fact the reason why I began this pref flushing thing at all, but of course Client handles user changes by modifying preferences directly, not through SetPref, so it skipped WritePrefs.
2021-04-18 15:28:11 +02:00
Tamás Bálint Misius
dfc8dc80bd
Write prefs every time they change (fixes #770) 2021-04-18 12:23:31 +02:00
Tamás Bálint Misius
2a23a38120
Normalise GetPrefs 2021-04-18 12:23:31 +02:00
Tamás Bálint Misius
bcbcdbe06b
Make custom can_move settings persistent (fixes #764) 2021-04-17 21:23:39 +02:00
Tamás Bálint Misius
6a6b14f871
Redo and add type parameter to sim.neighbours 2021-04-17 10:40:10 +02:00
moonheart08
a3f5731a43
Add element LITH (#726)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-04-17 00:01:26 +02:00
Tamás Bálint Misius
b94e26d6f0
Disconnect version numbers from the content of v* tags 2021-04-16 17:54:25 +02:00
jacob1
ffb88259d6 Split Simulation::IsValidElement into IsElement and IsElementOrNone
Allows finer control over whether you want none included or not.
Fixes some invalid things being allowed for element 0 in legacy lua api
Fixes {ctype} signs showing 0 instead of NONE
2021-04-11 23:20:33 -04:00
Tamás Bálint Misius
1859125218
Fix undo not updating air block map 2021-04-11 21:44:33 +02:00
Tamás Bálint Misius
b98c9c8a2e
Fix crash on exit when using nvidia-460 + SDL with EGL support 2021-04-06 20:03:48 +02:00
Tamás Bálint Misius
1681ca77d8
Add Lua support for composition 2021-04-02 10:21:54 +02:00
Tamás Bálint Misius
3dbf6d7810
Use SDL text input correctly, add basic composition support 2021-04-02 10:21:52 +02:00
jacob1
da2ccc70fe Some ROCK fixes
Improve efficiency in FIRE logic, it no longer runs the check multiple times for each surrounding particle. RNG chances reduced accordingly.
Remove unnecessary code in init_can_move
Set Weight to 100, which is the proper max for weight
2021-03-30 23:14:53 -04:00
jacob1
7614042e19 Update MotD when MotD fails to download 2021-03-30 23:01:13 -04:00
Tamás Bálint Misius
ee22c3e631
Fix Windows registry values broken by d155b0f
Also remove unused resource IDs from the resource script.
2021-03-24 22:42:56 +01:00
Tamás Bálint Misius
36e9fdc39d
Add support for i686-win 2021-03-20 23:02:03 +01:00
Doxin
cc2022504a Add ren.showBrush to the LUA api to allow hiding the brush 2021-03-18 16:13:15 -04:00
Doxin
b1506e15d4 Don't draw intro text when hud is disabled 2021-03-18 16:13:15 -04:00
Tamás Bálint Misius
f86ffb48c6
Fix colour picker colour square broken by 4b7e85c 2021-03-14 21:12:12 +01:00
Tamás Bálint Misius
93b920a57f
Ignore key events with KMOD_GUI set #2, see previous commit 2021-03-08 21:09:35 +01:00
Tamás Bálint Misius
dbe4e78257
Ignore key events with KMOD_GUI set
As those are probably not meant for us.
2021-03-08 20:42:44 +01:00
Tamás Bálint Misius
c7619387ac
Fix EXOT freezing upon failing to replicate a neighbour 2021-03-05 21:54:00 +01:00
jacob1
0ed6a84ecf Fix ambient heat display 2021-02-28 16:53:18 -05:00
Tamás Bálint Misius
eece15dbb4
Set shortcut working directory, see a17a2fe 2021-02-17 22:11:56 +01:00
Tamás Bálint Misius
a17a2fe6c7
Add shortcut to programs on install 2021-02-17 21:40:45 +01:00
Tamás Bálint Misius
d155b0ffc1
UTF-8 everywhere 2021-02-17 21:40:40 +01:00
Tamás Bálint Misius
31dda85504
Fix pavg loading behaviour of QRTZ/GLAS/TUNG again
Was thought to have been fixed by 3de92f5; turns out the fix only worked with positive pressures.
2021-02-17 15:53:55 +01:00
Tamás Bálint Misius
92cb50505d
Make molten ROCK produce vertical clusters of GOLD (fixes #762)
Also make GOLD veins spread out a bit more.
2021-02-17 09:49:41 +01:00
Tamás Bálint Misius
4b7e85c2fb
Fix a metric ton of MSVC warnings 2021-02-15 21:24:44 +01:00
Tamás Bálint Misius
413c18950d
Fix font and render targets broken by 3056b86 2021-02-15 21:22:54 +01:00
Tamás Bálint Misius
3056b86780
Fix hang on exit when using platform.restart 2021-02-08 10:55:17 +01:00
Tamás Bálint Misius
be7ea2578b
Correctly decide whether we provide prebuilt libs 2021-01-21 19:20:16 +01:00
jacob1
d037178bb5 Fix infinite spark loops in photoelectric effect 2021-01-19 20:54:03 -05:00
Tamás Bálint Misius
ea41fa4e81
Migrate hardcoded -D flags to per-target Config.h 2021-01-18 12:20:36 +01:00
Sebastián Mestre
36f661b87f
Clean up some code in Simulation::FloodINST (#758)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
2021-01-10 17:11:33 +01:00
Tamás Bálint Misius
3a0331d747
Add SDL_Quit calls back in
These got lost in the migration to Meson; they used to be called
with atexit, but this caused more problems than it should have.
Anyway, it's fine to call these only when we're exiting normally,
since otherwise we have bigger problems than not quitting SDL.
2021-01-06 15:46:39 +01:00
Tamás Bálint Misius
9f47e6c028
Actually fix the bug, see previous commit 2021-01-04 21:49:09 +01:00
Tamás Bálint Misius
1e67a579fd
Fix crash when the constructor of a LuaComponent derivative fails
The interface API is a mess, hopefully not for long.
2021-01-04 21:35:47 +01:00