Browse Source

Use hardware overlay instead of an extra face

to display the LEDs, gets rid of Z fighting due
to Irrlicht rounding errors
tags/2019-05-25
Vanessa Dannenberg 1 year ago
parent
commit
df30ce9477
2 changed files with 12 additions and 24 deletions
  1. +11
    -13
      init.lua
  2. +1
    -11
      models/led_marquee.obj

+ 11
- 13
init.lua View File

@@ -369,23 +369,17 @@ for i = 31, 255 do
local groups = { cracky = 2, not_in_creative_inventory = 1}
local light = LIGHT_MAX-2
local description = S("LED marquee panel ("..i..")")
local tiles = {
{ name="led_marquee_base.png", color="white"},
{ name="led_marquee_leds_off.png", color="white"},
"led_marquee_char_"..i..".png",
}
local leds = "led_marquee_char_"..i..".png"

if i == 31 then
tiles = {
{ name="led_marquee_base.png", color="white"},
{ name="led_marquee_leds_off.png", color="white"},
{
name = "led_marquee_char_31.png",
animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.75}
}
leds ={
name = "led_marquee_char_31.png",
animation = {type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 0.75}
}
end

local wimage

if i == 32 then
groups = {cracky = 2}
light = nil
@@ -397,7 +391,11 @@ for i = 31, 255 do
description = description,
drawtype = "mesh",
mesh = "led_marquee.obj",
tiles = tiles,
tiles = {
{ name = "led_marquee_base.png", color = "white" },
{ name = "led_marquee_leds_off.png", color = "white" }
},
overlay_tiles = { "", leds },
inventory_image = wimage,
wield_image = wimage,
palette="led_marquee_palette.png",


+ 1
- 11
models/led_marquee.obj View File

@@ -21,10 +21,6 @@ v -0.500000 -0.453125 0.468750
v -0.500000 -0.453125 -0.468750
v -0.500000 -0.437500 -0.484375
v -0.500000 -0.437500 -0.500000
v 0.500000 -0.449125 -0.468750
v -0.500000 -0.449125 -0.468750
v -0.500000 -0.449125 0.468750
v 0.500000 -0.449125 0.468750
vt 0.681855 0.961799
vt 0.723891 0.992824
vt 0.723891 0.000000
@@ -69,10 +65,6 @@ vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vn 1.0000 0.0000 0.0000
vn 0.0000 -1.0000 -0.0000
vn -1.0000 0.0000 0.0000
@@ -106,7 +98,5 @@ f 7/26/8 6/38/8 19/19/8
f 19/19/6 6/38/6 5/20/6
f 15/22/6 10/39/6 9/23/6
f 8/25/7 17/40/7 16/24/7
g Cube_Cube_LEDs_Cube_Cube_LEDs_leds_off
g Cube_Cube_LEDs_Cube_Cube_LEDs_base_led_marquee_leds_off.png
f 1/41/6 2/42/6 3/43/6 4/44/6
g Cube_Cube_LEDs_Cube_Cube_LEDs_leds_on
f 21/45/6 22/46/6 23/47/6 24/48/6

Loading…
Cancel
Save