Commit Graph

5669 Commits

Author SHA1 Message Date
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
Tamás Bálint Misius
0e3968af0b
Add fs.isLink 2023-05-09 22:31:12 +02:00
mniip
65cf8021c9 Reorganize the constructors of non-owning PlaneAdapter 2023-05-04 19:41:47 +02:00
jacob1
03e7826080
Merge pull request #918 from triclops200/patch-1
Update README.md to reflect name change
2023-05-03 23:51:16 -04:00
Victoria Hoyle
29655db976
Update IntroText.h
Name change here as well
2023-05-03 23:34:53 -04:00
Victoria Hoyle
23fca18f51
Update README.md
I've changed my name :)
2023-05-03 23:30:35 -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
jacob1
8b7a96b5ef
Fix RIME's description (it is formed through deposition, not sublimation) 2023-04-23 22:52:29 -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
5fc8770ee2
Fix pmap usage in Simulation::flood_water
flood_water would occasionally corrupt pmap by moving the pmap entry at i's location even if the entry itself didn't refer to i. pmap updates are tricky, they are best handled by Simulation::move.
2023-04-16 11:05:42 +02:00
Tamás Bálint Misius
54d08f3496
Protect new math.random against division by 0 2023-04-15 23:22:20 +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
9c3b966c18
Expose new features to Lua
math.random now uses our rngs. In most cases, this means the interface rng, but it means the sim rng during simulation events.
2023-04-15 22:19:54 +02:00
Tamás Bálint Misius
0b82796ba4
Add Simulation::frameCount, save blockair/blockairh and rng state
Saving blockair/blockairh is nice because RecalculateBlockAirMaps uses the sim rng, which means the sim rng would get advanced in Simulation::Load. Also rename RecalculateBlockAirMaps to ApproximateBlockAirMaps because that's what it is, an approximation, and it's needed only if there are no block air maps in the save.

Simulation::frameCount keeps track of frames elapsed since the beginning of the simulation, zeroed at clear_sim. It overflows when it reaches the 64-bit limit, which means anything that depends on it should either handle this, or not fail catastrophically. sandcolour (the only thing that depends on it as of now) is a good example of the latter: sandcolour has a periodicity of 360 frames, which means that there is one sandcolour period that is cut short by the overflow. This is not "handled" (the period is cut short, which is detectable by users) but is not catastrophic either (it's not a big deal, and it won't ever happen unless someone hacks the save).

Also restrict saves with determinism data to 98.0.
2023-04-15 22:19:50 +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
e1d230f814 New text width ops 2023-04-10 23:54:46 +02:00
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