Commit Graph

18 Commits

Author SHA1 Message Date
Lars Mueller
14de9219b7 Remove unnecessary arguments 2023-06-02 16:24:13 +02:00
Lars Mueller
b56f030127 texmod.read: Unescaped ^ in (...) laxness 2023-06-02 16:19:56 +02:00
Lars Mueller
2b1c9cff7c Add support for new texture modifiers
https://github.com/minetest/minetest/pull/10100
has introduced a few inconsistencies with the formats of previous texture modifiers:

`[fill` is the first texture modifier to have a modifying and a generating variant.
Thus `texmod` "constructors" and `texmod` "modifiers" / methods had to be separated;
`texmod.fill` is not the same as `tm.fill` where `tm` is `texmod` instance.
It is rather dirty that the generating variant would ignore
extraneous parameters of the modifying variant, so this is not replicated by the parser.

`[hsl`, `[colorizehsl`, `[contrast` and `[screen` are pretty standard texture modifiers
as far as the DSL is concerned. `[hsl` and `[colorizehsl` are very similar.

`[hardlight` is the first texture modifier to exist just for swapping the base and parameter.
`a^[overlay:b` and `b^[hardlight:a` are both normalized to `b:[hardlight:a` by the DSL.
`[overlay` (called "overlay blend" in the docs) creates a naming conflict with
literal overlaying (`^`). This is resolved by renaming `:overlay` to `:blit`.
2023-05-31 20:12:18 +02:00
Lars Mueller
a9b5d80ca8 Fix [multiply missing from texmod:calc_dims 2023-05-31 18:59:35 +02:00
Lars Mueller
9911442977 texmod: Fix :mask(...) and .mask name collision 2023-05-29 21:22:59 +02:00
Lars Mueller
5fbb159a41 texmod: Fix broken [sheet assertions 2023-05-28 12:30:13 +02:00
Lars Mueller
520ecc641b texmod.read: Fix [transform followed by a lowercase letter 2023-05-27 19:12:49 +02:00
Lars Mueller
5dc6307661 Fix texmod.colorize crash if ratio is nil 2023-05-27 17:21:41 +02:00
Lars Mueller
73640f11d1 texmod: Stricter file name validation 2023-05-27 14:33:46 +02:00
Lars Mueller
8e5bdc817c Fix handling of multiple texmod transforms 2023-05-27 14:24:54 +02:00
Lars Mueller
e07d646203 texmod.read: Make transforms case-insensitive 2023-05-26 19:27:47 +02:00
Lars Mueller
741746613b Move local var to appropriate scope 2023-05-24 22:42:38 +02:00
Lars Mueller
0b521bbb61 Fix texmod:write emitting unnecessary parens 2023-05-24 22:37:55 +02:00
Lars Mueller
95159c48e8 Refactor texmod:read to pass reader around 2023-05-24 22:27:25 +02:00
Lars Mueller
fe7fb6aeec Remove unused variable in texmod:calc_dims 2023-05-24 22:25:46 +02:00
Lars Mueller
d4ca847b0e Add support for [png to texmod:calc_dims 2023-05-24 21:28:46 +02:00
Lars Mueller
b169077a40 Refactor texmod:calc_dims to use a dispatch table 2023-05-24 21:09:24 +02:00
Lars Mueller
9fc4aaf3b8 Add experimental texture modifier DSL 2023-05-24 19:39:20 +02:00