Commit Graph

7 Commits

Author SHA1 Message Date
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
9911442977 texmod: Fix :mask(...) and .mask name collision 2023-05-29 21:22:59 +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
0b521bbb61 Fix texmod:write emitting unnecessary parens 2023-05-24 22:37:55 +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