BYOND Version: 401.963
Operating System: Vista Home Premium
Web Browser: IE
Video Card (for graphics bugs): GeForce 6150SE nForce430
Descriptive Problem Summary: Adding and Subtracting RGB Alpha has the same result.
Code Snippet (if applicable) to Reproduce Problem:
mob/verb
alphaone()
for(var/turf/alphatest/A in world)
A.icon-=rgb(0,0,0,100)
alphatwo()
for(var/turf/alphatest/A in world)
A.icon+=rgb(0,0,0,100)
Expected Results: alphaone would fade the icon by subtracting the alpha value, alphatwo would bring it back by adding to it.
Actual Results: Both alphaone and alphatwo fade the icon by subtracting the alpha value.
Does the problem occur:
Every time? Or how often? Everytime.
I might just be an idiot and doing it wrong, though I doubt it. Sorry if this has been posted before, but I did a search and couldn't find it anywhere.
Well you're not an idiot, since this would normally seem like a decent way to alter alpha, but it is wrong. ADD and SUBTRACT are basically designed to alter the RGB of an icon and work by choosing the lowest combined opacity.
An OR blend (the | operator, or ICON_OR in Blend()) will choose a higher alpha value. ADD or AND will choose the lower.
A better option is probably to use MapColors().
Lummox JR