Skip to content

Commit

Permalink
drop portal shape images to 2bit
Browse files Browse the repository at this point in the history
Save some bits. Unfortunately PNG can't do 3bit-indexed images :(
  • Loading branch information
Treer authored and SmallJoker committed Feb 15, 2020
1 parent 39d655b commit 4c3545f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions portal_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ nether.PortalShape_Traditional = {
is_horizontal = false, -- whether the wormhole is a vertical or horizontal surface
diagram_image = {
image = "nether_book_diagram_traditional.png", -- The diagram to be shown in the Book of Portals
width = 144,
width = 142,
height = 305
},

Expand Down Expand Up @@ -280,7 +280,7 @@ nether.PortalShape_Circular = {
is_horizontal = false, -- whether the wormhole is a vertical or horizontal surface
diagram_image = {
image = "nether_book_diagram_circular.png", -- The diagram to be shown in the Book of Portals
width = 150,
width = 149,
height = 243
},

Expand Down Expand Up @@ -1724,6 +1724,9 @@ function test_shapedef_is_valid(shape_defintion)
local p1, p2 = shape_defintion:get_p1_and_p2_from_anchorPos(origin, 0)
assert(vector.equals(shape_defintion.size, vector.add(vector.subtract(p2, p1), 1)), "p1 and p2 of shape definition '" .. shape_defintion.name .. "' don't match shapeDef.size")

assert(shape_defintion.diagram_image ~= nil and shape_defintion.diagram_image.image ~= nil, "Shape definition '" .. shape_defintion.name .. "' does not provide an image for Help/Book of Portals")
assert(shape_defintion.diagram_image.width > 0 and shape_defintion.diagram_image.height > 0, "Shape definition '" .. shape_defintion.name .. "' does not provide the size of the image for Help/Book of Portals")

-- todo

return result
Expand Down
Binary file modified textures/nether_book_diagram_circular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/nether_book_diagram_platform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textures/nether_book_diagram_traditional.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c3545f

Please sign in to comment.