4 Commits

Author SHA1 Message Date
CoolCat467
8878f095fb
Basically only imortant from #408
Leave blackSqare and step counters alone, but make it be able to handle textures where width and height are not the same so no more invalid color error.
For example, with original code, materials.newDebugTexture(8, 16, 40) has odd color because when it gets to pixel (1, 9), color value is (15, 9, -2) in RGB. After color.RGBToInteger inside color.HSBToInteger, integer value for color would be -2. The reason it's not apparent is likely from optimization of colors from palette, turning -2 into 65535 or (0, 255, 255), instead of an invalid color.
This has the effect of screwing up the colors for the image
If steps are swapped as this proposes, this issue is fixed and the colors wouldn't go crazy.
2022-01-08 09:12:03 -06:00
IgorTimofeev
ae6c876d82 Revert "Merge pull request #408 from CoolCat467/patch-1"
This reverts commit d56f4f0b2348cdfd8c0bec6bbc480fd4c6677d04, reversing
changes made to 2af4200a57e8548321f3bdda9adb390e5fcd732b.
2022-01-08 19:16:34 +07:00
CoolCat467
299acd9a91
Fix materials.newDebugTexture and simplify
I was testing a copy of this in Python, and noticed that bStep and sStep appear to be swapped, as bStep changed b up by 1/height, but the loop is by width, leading b to exceed 1 if the height is smaller than width. This is only apparent if the width and height of the new debug texture is not the same. And then I also noticed that the whole "invert blackSquare in two places" part could be simplified to if x + y is an odd number for each pixel in the texture. I don't claim to know the specifics of how to make lua faster, and this may be slower, so whatever is better.
2022-01-07 22:46:43 -06:00
Igor Timofeev
b8bc282b94 Переходим на MineOS Standalone #1 2019-01-19 11:31:04 +03:00