diff options
Diffstat (limited to 'games/devtest/mods/testnodes')
16 files changed, 227 insertions, 2 deletions
diff --git a/games/devtest/mods/testnodes/init.lua b/games/devtest/mods/testnodes/init.lua index 92e2c5630..d355c4278 100644 --- a/games/devtest/mods/testnodes/init.lua +++ b/games/devtest/mods/testnodes/init.lua @@ -8,3 +8,4 @@ dofile(path.."/properties.lua") dofile(path.."/liquids.lua") dofile(path.."/light.lua") dofile(path.."/textures.lua") +dofile(path.."/overlays.lua") diff --git a/games/devtest/mods/testnodes/overlays.lua b/games/devtest/mods/testnodes/overlays.lua new file mode 100644 index 000000000..294e06a16 --- /dev/null +++ b/games/devtest/mods/testnodes/overlays.lua @@ -0,0 +1,93 @@ +local S = minetest.get_translator("testnodes") + +minetest.register_node("testnodes:overlay", { + description = S("Texture Overlay Test Node") .. "\n" .. + S("Uncolorized"), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_color_all", { + description = S("Texture Overlay Test Node, Colorized") .. "\n" .. + S("param2 changes color"), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_color_overlay", { + description = S("Texture Overlay Test Node, Colorized Overlay") .. "\n" .. + S("param2 changes color of overlay"), + tiles = {{name = "testnodes_overlayable.png", color="white"}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_color_overlayed", { + description = S("Texture Overlay Test Node, Colorized Base") .. "\n" .. + S("param2 changes color of base texture"), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png", color="white"}}, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) + +local global_overlay_color = "#FF2000" +minetest.register_node("testnodes:overlay_global", { + description = S("Texture Overlay Test Node, Global Color") .. "\n" .. + S("Global color = @1", global_overlay_color), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + color = global_overlay_color, + + + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_global_color_all", { + description = S("Texture Overlay Test Node, Global Color + Colorized") .. "\n" .. + S("Global color = @1", global_overlay_color) .. "\n" .. + S("param2 changes color"), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + color = global_overlay_color, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_global_color_overlay", { + description = S("Texture Overlay Test Node, Global Color + Colorized Overlay") .. "\n" .. + S("Global color = @1", global_overlay_color) .. "\n" .. + S("param2 changes color of overlay"), + tiles = {{name = "testnodes_overlayable.png", color=global_overlay_color}}, + overlay_tiles = {{name = "testnodes_overlay.png"}}, + color = global_overlay_color, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) +minetest.register_node("testnodes:overlay_global_color_overlayed", { + description = S("Texture Overlay Test Node, Global Color + Colorized Base") .. "\n" .. + S("Global color = @1", global_overlay_color) .. "\n" .. + S("param2 changes color of base texture"), + tiles = {{name = "testnodes_overlayable.png"}}, + overlay_tiles = {{name = "testnodes_overlay.png", color=global_overlay_color}}, + color = global_overlay_color, + paramtype2 = "color", + palette = "testnodes_palette_full.png", + + + groups = { dig_immediate = 2 }, +}) diff --git a/games/devtest/mods/testnodes/properties.lua b/games/devtest/mods/testnodes/properties.lua index 51f703d7c..bacd555cd 100644 --- a/games/devtest/mods/testnodes/properties.lua +++ b/games/devtest/mods/testnodes/properties.lua @@ -13,6 +13,20 @@ minetest.register_node("testnodes:falling", { groups = { falling_node = 1, dig_immediate = 3 }, }) +minetest.register_node("testnodes:falling_facedir", { + description = S("Falling Facedir Node"), + tiles = { + "testnodes_1.png", + "testnodes_2.png", + "testnodes_3.png", + "testnodes_4.png", + "testnodes_5.png", + "testnodes_6.png", + }, + paramtype2 = "facedir", + groups = { falling_node = 1, dig_immediate = 3 }, +}) + -- Same as falling node, but will stop falling on top of liquids minetest.register_node("testnodes:falling_float", { description = S("Falling+Floating Node"), @@ -252,9 +266,9 @@ for i=-100, 100, 25 do end -- Bouncy nodes (various bounce levels) -for i=20, 180, 20 do +for i=-140, 180, 20 do local val = math.floor(((i-20)/200)*255) - minetest.register_node("testnodes:bouncy"..i, { + minetest.register_node(("testnodes:bouncy"..i):gsub("-","NEG"), { description = S("Bouncy Node (@1%)", i), groups = {bouncy=i, dig_immediate=3}, 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_overlay.png b/games/devtest/mods/testnodes/textures/testnodes_overlay.png Binary files differnew file mode 100644 index 000000000..1c69b5e08 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_overlay.png diff --git a/games/devtest/mods/testnodes/textures/testnodes_overlayable.png b/games/devtest/mods/testnodes/textures/testnodes_overlayable.png Binary files differnew file mode 100644 index 000000000..431bc94f4 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_overlayable.png 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 Binary files differnew file mode 100644 index 000000000..2dc587bc3 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_bt.tga 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 Binary files differnew file mode 100644 index 000000000..b44a81c79 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type10_32bpp_tb.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_bt.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_bt.tga Binary files differnew file mode 100644 index 000000000..d2c2ca6d2 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_bt.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_tb.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_tb.tga Binary files differnew file mode 100644 index 000000000..dfcb98864 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type1_24bpp_tb.tga 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 Binary files differnew file mode 100644 index 000000000..0206216bb --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_bt.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_tb.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_tb.tga Binary files differnew file mode 100644 index 000000000..2563f084b --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_16bpp_tb.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_bt.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_bt.tga Binary files differnew file mode 100644 index 000000000..3350500f8 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_bt.tga 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 Binary files differnew file mode 100644 index 000000000..216de0634 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type2_32bpp_tb.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_bt.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_bt.tga Binary files differnew file mode 100644 index 000000000..695bb4bb1 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_bt.tga diff --git a/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_tb.tga b/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_tb.tga Binary files differnew file mode 100644 index 000000000..c08a093b2 --- /dev/null +++ b/games/devtest/mods/testnodes/textures/testnodes_tga_type3_16bpp_tb.tga |