mt-mods / signs_lib

Other
4 stars 12 forks source link

out-of-bounds combine textures #24

Closed Emojigit closed 4 months ago

Emojigit commented 6 months ago

The server client log is spammed with these:

2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (258,17) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (174,34) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (255,51) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (255,17) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (147,51) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (275,51) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (263,34) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (271,34) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (256,17) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (256,34) for [combine
2024-02-03 09:41:29: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (258,34) for [combine
2024-02-03 09:41:31: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (258,0) for [combine
2024-02-03 09:41:31: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (270,0) for [combine
2024-02-03 09:41:31: WARNING[Main]: generateImagePart(): Skipping "signs_lib_color_16px_n.png" as it's out-of-bounds (258,0) for [combine
OgelGames commented 6 months ago

That's a new warning added in this commit: https://github.com/minetest/minetest/commit/ffec698d3ea707f521fc6ac66a2c786d3851ae60

Niklp09 commented 6 months ago

server log

Those warnings are in the client log

Emojigit commented 6 months ago

server log

Those warnings are in the client log

Sorry, you're right. I will edit my description now.

appgurueu commented 6 months ago

Yes. The function fill_line (or rather probably invalid usage of it, though I think there's an off-by-one error in this function as well) in api.lua generates [combine parts which are out of bounds. This is most probably a bug which was just masked by this being a no-op in previous Minetest versions.

(btw, fill_line is also needlessly inefficient; it could be achieved using a single [resize + [multiply to be escaped and fed into [combine rather than one sub-modifier per pixel)

tenplus1 commented 6 months ago

@appgurueu - Could you suggest a better routine to accomplish this to avoid the error ?

appgurueu commented 6 months ago

@appgurueu - Could you suggest a better routine to accomplish this to avoid the error ?

I can imagine some simple monkey-patching (effectively doing the same check Minetest does before handing the texture modifier to Minetest), but I'm not sure how to properly fix this, mainly because I'm not sure what purpose fill_line serves. It seems it might be related to wrapping lines?

tenplus1 commented 6 months ago

Ook! I fixed the issue on my local fork of signs_lib that we use for Xanadu, just need to download the latest signs_lib from here and do the same.

My own fork: https://codeberg.org/tenplus1/signs_lib

Update: mt-mods signs_lib is working but editing character sheets is taking a while.

tenplus1 commented 6 months ago

The latest signs_lib has been converted to use colorize instead of masking to remove out-of-bounds errors, but for some strange reason github will not allow me to create a pull-request, so here is the latest code with all changes (texture edits and lua)

signs_lib_NEW.zip