Tamás Bálint Misius
f23a3dd2f8
Fix unknown HTTP response body size being reported as 0 in some cases
...
Namely, when libcurl dies or when progress is checked before the request is started, although this should never happen.
2023-05-27 20:22:13 +02:00
Tamás Bálint Misius
c0a2370c77
Fix paste previews being positioned incorrectly
...
Recent changes made to multiple instances of paste placement code caused inconsistencies between what paste previews suggested would happen and what actually happened during pasting. Relevant code factored out.
2023-05-14 20:44:13 +02:00
Tamás Bálint Misius
7ef02a6c0b
Remove return value from Simulation::Load
...
Not useful anymore, it can only fail if the GameSave passed in is nullptr, which this commit guards against.
Also make Simulation::Load and Simulation::Save take block-oriented positions and rects.
2023-05-13 13:21:05 +02:00
Tamás Bálint Misius
ee87f0a0a7
Fix vote bars in previews touching the enclosing rects
2023-05-13 13:21:05 +02:00
Tamás Bálint Misius
a9d231587c
Show save button thumbnail in the preview if it's available
...
This is good enough for now but also more limited than I'd like because if the thumbnail arrives (gets rendered or downloaded) later than the preview is opened, it's never shown.
2023-05-13 13:21:05 +02:00
Tamás Bálint Misius
d8acdfb576
Fix various warnings that had piled up
2023-05-12 19:25:41 +02:00
Tamás Bálint Misius
9bd8bd2274
Fix some deprecation warnings
...
Namely:
- [[deprecated("Use Mat2")]]
- [[deprecated("Use Vec2")]]
- [[deprecated("Use Mat2::operator*(Vec2)")]]
- [[deprecated("Use Vec2<float>::operator*(float)")]]
- [[deprecated("Use Vec2::operator+")]]
- [[deprecated("Use Vec2::operator-")]]
- [[deprecated("Use Vec2::Zero")]]
- [[deprecated("Use Mat2::Identity")]]
2023-05-12 18:53:48 +02:00
Tamás Bálint Misius
c8bc8a7285
Fix some deprecation warnings ( #920 )
...
Namely:
- [[deprecated("Use PlaneAdapter<std::vector>")]]
- [[deprecated("Use operator[](Vec2)")]]
2023-05-12 09:00:06 +02:00
Tamás Bálint Misius
0f95ce82f8
Sanitize GameSave/SaveInfo/SaveFile ownership
2023-05-11 12:40:23 +02:00
Tamás Bálint Misius
5c5354655c
Fix progress bars drawing their borders in the wrong place
...
Same problem as with textboxes solved in 3eb3481fda
.
2023-05-09 22:54:57 +02:00
Victoria Hoyle
29655db976
Update IntroText.h
...
Name change here as well
2023-05-03 23:34:53 -04:00
Tamás Bálint Misius
3eb3481fda
Fix local save browser crashing in some cases
...
This also fixes local save thumbnails being resized such that they are just short of filling the space they are supposed to.
Also fix textboxes drawing their borders in the wrong place.
2023-05-01 22:32:31 +02:00
Tamás Bálint Misius
60a7ce1aae
Use _rgb literals where possible
2023-04-30 14:22:56 +02:00
Tamás Bálint Misius
410dc71f42
Fix some deprecation warnings
...
Namely:
- [[deprecated("Use DrawPixel/BlendPixel")]]
- [[deprecated("Use DrawLine/BlendLine")]]
- [[deprecated("Use DrawRect/BlendRect")]]
- [[deprecated("Use DrawFilledRect/BlendFilledRect")]]
2023-04-30 14:06:54 +02:00
Tamás Bálint Misius
9fbb780728
Fix some deprecation warnings
...
Namely:
- [[deprecated("Use BlendChar")]]
- [[deprecated("Use AddChar")]]
- [[deprecated("Use XorPixel")]]
- [[deprecated("Use AddPixel")]]
- [[deprecated("Use XorLine")]]
- [[deprecated("Use XorDottedRect")]]
- [[deprecated("Use XorImage")]]
- [[deprecated("Use BlendEllipse")]]
- [[deprecated("Use BlendFilledEllipse")]]
- [[deprecated("Use DrawFilledRect (beware off by 1)")]]
2023-04-30 11:27:58 +02:00
Tamás Bálint Misius
f5cbc30d85
Fix some deprecation warnings
...
Namely:
- [[deprecated("Use BlendTextOutline")]]
- [[deprecated("Use BlendText")]]
- [[deprecated("Use BlendImage")]]
- [[deprecated("Use BlendImage")]]
- [[deprecated("Use TextSize().X - 1 (yes this is very bad code eww)")]]
2023-04-29 15:50:34 +02:00
Tamás Bálint Misius
2960e0f58f
Fix some deprecation warnings
...
Namely:
- [[deprecated("Use operator+(Vec2)")]]
- [[deprecated("Use operator-(Vec2)")]]
- [[deprecated("Use video")]]
- [[deprecated("Use persistentVideo")]]
- [[deprecated("Use wrapVideo")]]
2023-04-29 14:44:27 +02:00
Tamás Bálint Misius
8f10210c77
Fix various unintended layout changes since 97.0
...
Also fix a few unused variable warnings.
2023-04-29 13:18:32 +02:00
jacob1
ad1420152c
Fix delete key not functioning correctly in textboxes when text is selected
2023-04-25 00:30:07 -04:00
catsoften
8d88394e38
Add RGBA.Pack(), Simplify ui::Colour/RGBA conversions
2023-04-16 22:13:39 +02:00
catsoften
561fc17431
Simplify conversion from temperature to color in OptionsView
2023-04-16 22:13:39 +02:00
catsoften
a715f5d71a
Use RGB for constants and gradients, other misc changes
2023-04-16 22:13:39 +02:00
catsoften
bc085705a8
Remove deprecated PIXPACK/RGB/R/G/B functions
2023-04-16 22:13:39 +02:00
Tamás Bálint Misius
34e4d90dac
Properly seed rng at load time for saves that don't carry rng state
...
Also save rngState as a user object rather than two separate i64s.
2023-04-15 23:04:58 +02:00
Tamás Bálint Misius
a8604ef579
Add ensureDeterminism to saves
2023-04-15 22:19:54 +02:00
Tamás Bálint Misius
eee42b2ea3
Fix RNG usage
...
Mostly boils down to having graphics functions use Renderer's RNG, update and similar functions Simulation's.
2023-04-15 18:22:03 +02:00
mniip
c23eba1921
Remove unused Component::Component overloads
2023-04-13 18:48:19 +02:00
mniip
8c387a5a00
convert ThumbnailRequest to Vec2
2023-04-12 19:28:55 +02:00
mniip
aa2fa9ed8c
Remove Graphics::SetClipRect
2023-04-12 19:24:54 +02:00
mniip
9b9b0b794a
Remove Graphics::vid, Graphics::textwidthx, Graphics::textsize
2023-04-12 19:21:37 +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
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
e5af4dab68
Refactor resize-related code
2023-04-05 02:30:05 +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
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
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
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
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
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
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
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
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
c8ca016494
Move update code to Platform
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
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
91a9973bfd
Refactor HTTP
...
Request ownership is no longer flaky. Requests are now owned by the code that makes requests, and Requests and the RequestManager co-own RequestHandles. RequestManager disowns a RequestHandle if it's done with it or if Request code reports that it's no longer needed.
All libcurl code has been moved to RequestManager. This is nice because once NOHTTP is removed, we can add any number of RequestManager implementations, for example one for Android.
Client outliving RequestManager is still a problem, this will have to be addressed later.
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
7fca2433cd
Derive LuaScriptInterface from TPTScriptInterface
...
Also convert stray references to LSI to stray references to CommandInterface. Not a lot better as it's still a global >_> but it's easier to follow.
2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
1f22e209f1
Localize Simulation::Before/AfterSim control to GameModel
2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
169aa47685
Hide CommandInterface creation behind a factory
...
Which is then provided by either a Lua-ful or a Lua-less translation unit.
2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
33edb2e0e4
Refactor GameController events
...
More precisely, refactor the code responsible for routing these GameController events to the Lua side. The issue with the previous solution was it relied on preprocessor macros to switch between Lua-ful and Lua-less builds.
2023-01-27 09:26:39 +01:00
Tamás Bálint Misius
27ddf78e0c
Preprocessor purge round 9: XCELLS and YCELLS
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
Tamás Bálint Misius
e97fd74503
Preprocessor purge round 6: intro text and user agent
2023-01-27 09:26:38 +01:00
Tamás Bálint Misius
b2b06bf009
Preprocessor purge round 3: spaghetti headers
2023-01-27 09:26:38 +01:00
Tamás Bálint Misius
e4c2ec5a00
Preprocessor purge round 2: #pragma once
2023-01-27 09:26:38 +01:00
Tamás Bálint Misius
3a591b8539
Preprocessor purge round 1: simulation constants
2023-01-27 09:26:36 +01:00
jacob1
e824e023f1
Fix WIND tool not reacting to zoom window properly, fixes #899
2023-01-23 20:32:37 -05:00
suve
8ce7a37070
Add missing cstdint includes
...
Some files have been using various fixed-size types (uint32_t etc.),
which are defined in stdint.h / cstdint, without including said header
file. While this code worked with GCC12 (likely a transitive include),
under GCC13 it fails to build due to "unknown type" errors.
2023-01-21 19:50:55 -05:00
Tamás Bálint Misius
6e140b580c
Fix vote buttons being wrong on own saves
...
The buttons are disabled on such saves, and the disabled background colours weren't set.
2023-01-02 16:33:47 +01:00
Tamás Bálint Misius
1ffc2055ca
Extend the BETA part of the intro text
...
So it now includes a warning about local saves and stamps made in a beta potentially being incompatible with older versions.
2022-12-29 12:57:49 +01:00
Tamás Bálint Misius
c5c9c046aa
Fix an uninitialized variable warning
...
Not an issue in practice because that value is never used unless the accompanying isValid is true, but the compiler can't know that.
2022-12-29 08:46:35 +01:00
jacob1
932f28bcd7
Fix property tool converting x / y values as temperatures
2022-12-28 22:57:03 -05:00
jacob1
f1cf0ade70
Merge pull request #847 from xphere07/temperaturescales
...
Add temperature scales option
2022-12-27 11:59:16 -05:00
Tamás Bálint Misius
86b6084baf
Vote editing
2022-12-27 17:42:15 +01:00
jacob1
b6cb6801df
Use RenderTemperature method in OptionsView, always re-render it on defocus, and remove degree symbol
2022-12-27 11:33:44 -05:00
xphere07
fe67ec8550
Add temperature scales option
...
Make the PROP tool default to the current temperature scale
Make the PROP tool's temp suffixes work in the console(This is currently blocked by AnyType doing resource management wrong)
Signed-off-by: xphere07 <xphere07@outlook.com>
2022-12-27 22:07:52 +09:00
Tamás Bálint Misius
16df10bc39
Have the intro text hide the HUD completely
...
Including the right portion, which hadn't been hidden until now.
2022-12-25 22:43:34 +01:00
Tamás Bálint Misius
d3ab2e231e
Merge data/ into resources/
2022-12-25 11:13:46 +01:00
Tamás Bálint Misius
3e3ee8a722
Convert hmap data to gradients
2022-12-25 11:09:08 +01:00
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
jacob1
952c3a6975
Add sim.historyRestore and sim.historyForward
2022-12-22 22:05:05 -05: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
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
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
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
b20d38d3b0
Silence unused variable warnings for fromNewerVersion
2022-12-08 07:48:00 +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