From 7c227d2a004068267dbe713259d57374a70c29e4 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 22 Feb 2022 19:17:40 +0100 Subject: [PATCH] Add TGA test nodes to devtest (#11978) --- games/devtest/mods/testnodes/textures.lua | 117 ++++++++++++++++++ .../testnodes_tga_type10_32bpp_bt.tga | Bin 0 -> 179 bytes .../testnodes_tga_type10_32bpp_tb.tga | Bin 0 -> 179 bytes .../textures/testnodes_tga_type1_24bpp_bt.tga | Bin 0 -> 120 bytes .../textures/testnodes_tga_type1_24bpp_tb.tga | Bin 0 -> 120 bytes .../textures/testnodes_tga_type2_16bpp_bt.tga | Bin 0 -> 172 bytes .../textures/testnodes_tga_type2_16bpp_tb.tga | Bin 0 -> 172 bytes .../textures/testnodes_tga_type2_32bpp_bt.tga | Bin 0 -> 300 bytes .../textures/testnodes_tga_type2_32bpp_tb.tga | Bin 0 -> 300 bytes .../textures/testnodes_tga_type3_16bpp_bt.tga | Bin 0 -> 172 bytes .../textures/testnodes_tga_type3_16bpp_tb.tga | Bin 0 -> 172 bytes 11 files changed, 117 insertions(+) create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_bt.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_tb.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_bt.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_tb.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_bt.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_tb.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_bt.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_tb.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_bt.tga create mode 100644 games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_tb.tga diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua index dc581b0c7..2faacdd78 100644 --- a/games/devtest/mods/testnodes/textures.lua +++ b/games/devtest/mods/testnodes/textures.lua @@ -171,3 +171,120 @@ minetest.register_node("testnodes:generated_png_dst_emb", { groups = { dig_immediate = 2 }, }) + +--[[ + +The following nodes can be used to demonstrate the TGA format support. + +Minetest supports TGA types 1, 2, 3 & 10. While adding the support for +TGA type 9 (RLE-compressed, color-mapped) is easy, it is not advisable +to do so, as it is not backwards compatible with any Minetest pre-5.5; +content creators should therefore either use TGA type 1 or 10, or PNG. + +TODO: Types 1, 2 & 10 should have two test nodes each (i.e. bottom-top +and top-bottom) for 16bpp (A1R5G5B5), 24bpp (B8G8R8), 32bpp (B8G8R8A8) +colors. + +Note: Minetest requires the optional TGA footer for a texture to load. +If a TGA image does not load in Minetest, append eight (8) null bytes, +then the string “TRUEVISION-XFILE.”, then another null byte. + +]]-- + +minetest.register_node("testnodes:tga_type1_24bpp_bt", { + description = S("TGA Type 1 (color-mapped RGB) 24bpp bottom-top Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type1_24bpp_bt.tga" }, + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type1_24bpp_tb", { + description = S("TGA Type 1 (color-mapped RGB) 24bpp top-bottom Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type1_24bpp_tb.tga" }, + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type2_16bpp_bt", { + description = S("TGA Type 2 (uncompressed RGB) 16bpp bottom-top Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type2_16bpp_bt.tga" }, + use_texture_alpha = "clip", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type2_16bpp_tb", { + description = S("TGA Type 2 (uncompressed RGB) 16bpp top-bottom Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type2_16bpp_tb.tga" }, + use_texture_alpha = "clip", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type2_32bpp_bt", { + description = S("TGA Type 2 (uncompressed RGB) 32bpp bottom-top Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type2_32bpp_bt.tga" }, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type2_32bpp_tb", { + description = S("TGA Type 2 (uncompressed RGB) 32bpp top-bottom Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type2_32bpp_tb.tga" }, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type3_16bpp_bt", { + description = S("TGA Type 3 (uncompressed grayscale) 16bpp bottom-top Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type3_16bpp_bt.tga" }, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type3_16bpp_tb", { + description = S("TGA Type 3 (uncompressed grayscale) 16bpp top-bottom Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type3_16bpp_tb.tga" }, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type10_32bpp_bt", { + description = S("TGA Type 10 (RLE-compressed RGB) 32bpp bottom-top Test Node"), + tiles = { "testnodes_tga_type10_32bpp_bt.tga" }, + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) + +minetest.register_node("testnodes:tga_type10_32bpp_tb", { + description = S("TGA Type 10 (RLE-compressed RGB) 32bpp top-bottom Test Node"), + drawtype = "glasslike", + paramtype = "light", + sunlight_propagates = true, + tiles = { "testnodes_tga_type10_32bpp_tb.tga" }, + use_texture_alpha = "blend", + groups = { dig_immediate = 2 }, +}) diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_bt.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_bt.tga new file mode 100644 index 0000000000000000000000000000000000000000..2dc587bc39b9de661dd99bb3777c39398bfdab51 GIT binary patch literal 179 zcmY+6?FoP|3`EcVDo)`7x{_ki3^8K#fu!9*w^glM_H2iPKEx wc2Z@%$S+{pQS;7eX=enXf1gyv*pE#5)J;+)Z&b-@owu;ZB~D{|^l=Cs9$v37y#N3J literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_tb.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_tb.tga new file mode 100644 index 0000000000000000000000000000000000000000..b44a81c799b56f08c3882a5f34075d47ceb6e2bf GIT binary patch literal 179 zcmZQz;9`IP4h9fZ&}d>{`2W8JDAvFTB0#)W6kZdE32DFP67DT}x_TNZMvc7@5NeD=w!vORxqrtI=8A(lkDMcg> f%;`l`{M{`AbvwC-qcyJME>At{zD@5^*D~V+v|bC* literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_bt.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_bt.tga new file mode 100644 index 0000000000000000000000000000000000000000..0206216bb4bb6cc2d8d0ef5281c7de497ed8ca12 GIT binary patch literal 172 zcmZQzU}As)4h9Ye0Y-)f7?cOHKo|z)fjkKRK{E&<U literal 0 HcmV?d00001 diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_tb.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_tb.tga new file mode 100644 index 0000000000000000000000000000000000000000..216de063444160b9e2e69dbc90b8ae35c6370b22 GIT binary patch literal 300 zcmZQzU}As(4h9fZ&|qNr{~v)F8i2A`Fh~tHahMoT9vNb&h00@y!}J4bkbaOnkVbM4 w!d@ivLGmEAFdE%$AaNK*mqXSE)ejV6U1(9v~k0JtfPDoIwYnW%Sr@x9)-gZOv;yMZA{1ft#zC(YfK;@zC2?+{y4f724^!L+^aP#zW)nfnv)Y?BP literal 0 HcmV?d00001