map_to_icon
proc
GenerateState(x, y, z)
var/list/pixels[1024]
var
pixel_x = x
pixel_y = y
for(var/a = 1, a <= 1024, a ++)
pixels[a] = GenerateTurfColor(pixel_x, pixel_y, z)
pixel_x += x_ratio
if(pixel_x > (32 * x_ratio))
pixel_x = x
pixel_y += y_ratio
var
x_shift = 0
y_shift = 0
icon/state = new('Templates.dmi', "blank")
for(var/a in pixels)
var/icon/pixel = GeneratePixel(x_shift, y_shift, a)
state.Blend(pixel, ICON_ADD)
world << "\t\icon[pixel]"
world << "\t\icon[state]\n"
x_shift ++
if(x_shift >= 32)
x_shift = 0
y_shift ++
AddState(state)
total_states ++
GeneratePixel(x, y, rgb)
var/icon/i = new('Templates.dmi', "pixel")
i.Shift(EAST, x)
i.Shift(NORTH, y)
i.Blend(rgb, ICON_ADD)
return i
Problem description:
Alright, the pixel is generated (I've made a 16x16 square, actually, to test), and its getting shifted and modified with the right color. Problem is, when I try to blend the icon with state, nothing happens. The modified pixel icon is output, but the state icon isn't.
I believe if you use the ICON_OR (which, contrary to the name, is like binary AND) function, you'll get the desired results.