Change white.png to w.png for save some part of texture text width (prevent going over 65536 bytes)).

This commit is contained in:
SFENCE 2022-04-04 07:53:36 +02:00
parent 980d04028a
commit ab54fef34a
5 changed files with 15 additions and 8 deletions

View File

@ -20,3 +20,9 @@ CC BY-SA 4.0 - check LICENSE file
Copyright (c) 2012-2022 jix xi, Jaspen den Quden, SFENCE and contributor (CC BY-SA 4.0):
All textures not mentioned below.
Developers:
-------------
w.png texture should be identical to sculpture w.png texture.

View File

@ -31,7 +31,7 @@ function painting.to_imagestring(data, res)
n = n+1
for _,p in pairs(ps) do
local y,x = unpack(p)
t[n] = ":"..p[1]..","..p[2].."=white.png"
t[n] = ":"..p[1]..","..p[2].."=w.png"
n = n+1
end
t[n] = "^[colorize:#"..hexcolour..")^"
@ -40,10 +40,10 @@ function painting.to_imagestring(data, res)
n = n-1
if n == 0 then
minetest.log("error", "[painting] no texels")
return "white.png"
return "w.png"
end
t[n] = t[n]:sub(1,-2)
--print(table.concat(t))
--print("Image string len: "..string.len(table.concat(t)))
return table.concat(t)
end

View File

@ -48,7 +48,7 @@ end
minetest.register_node("painting:pic", {
description = S("Picture"),
tiles = { "white.png" },
tiles = { "painting_white.png" },
inventory_image = "painting_painted.png",
drawtype = "nodebox",
sunlight_propagates = true,
@ -89,7 +89,7 @@ minetest.register_node("painting:pic", {
minetest.register_entity("painting:picent", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = { "white.png" },
textures = { "painting_white.png" },
on_activate = function(self, staticdata)
local pos = self.object:get_pos()
@ -185,7 +185,8 @@ local function apply_color(self, x, y, a, color)
r = math.round((add_clr.r*aa + have_clr.r*ha)/ja),
g = math.round((add_clr.g*aa + have_clr.g*ha)/ja),
b = math.round((add_clr.b*aa + have_clr.b*ha)/ja),
a = math.round(ja*255),
--a = math.round(ja*255),
a = 255, -- always without transparency
}
self.grid[x][y] = RGBAToHex(new_clr)
@ -225,7 +226,7 @@ local paintbox = {
minetest.register_entity("painting:paintent", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = { "white.png" },
textures = { "painting_white.png" },
on_punch = function(self, puncher)
--check for brush.
@ -370,7 +371,7 @@ local canvasbox = {
minetest.register_node("painting:canvasnode", {
description = S("Canvas"),
tiles = { "white.png" },
tiles = { "painting_white.png" },
inventory_image = "painting_painted.png",
drawtype = "nodebox",
sunlight_propagates = true,

BIN
textures/painting_white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

View File

Before

Width:  |  Height:  |  Size: 67 B

After

Width:  |  Height:  |  Size: 67 B