OpenDiablo2/d2common/d2enum/draw_effect.go

69 lines
2.3 KiB
Go
Raw Normal View History

package d2enum
2020-06-30 13:58:53 +00:00
// DrawEffect is a draw effect
type DrawEffect int
// Names courtesy of Necrolis
const (
2020-06-30 13:58:53 +00:00
// DrawEffectPctTransparency25 is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA 25 % transparency (colormaps 49-304 in a .pl2)
DrawEffectPctTransparency25 DrawEffect = iota
2020-06-30 13:58:53 +00:00
// DrawEffectPctTransparency50 is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA 50 % transparency (colormaps 305-560 in a .pl2)
DrawEffectPctTransparency50
// DrawEffectPctTransparency75 is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA 75 % transparency (colormaps 561-816 in a .pl2)
DrawEffectPctTransparency75
// DrawEffectModulate is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_ALPHA, GL_DST_ALPHA (colormaps 817-1072 in a .pl2)
DrawEffectModulate
// DrawEffectBurn is a draw effect that implements the following function:
// GL_MODULATE; GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA (colormaps 1073-1328 in a .pl2)
DrawEffectBurn
// DrawEffectNormal is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA (colormaps 1457-1712 in a .pl2)
DrawEffectNormal
// DrawEffectMod2XTrans is a draw effect that implements the following function:
// GL_MODULATE; GL_SRC_COLOR, GL_DST_ALPHA (colormaps 1457-1712 in a .pl2)
DrawEffectMod2XTrans
// DrawEffectMod2X is a draw effect that implements the following function:
// GL_COMBINE_ARB; GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA (colormaps 1457-1712 in a .pl2)
DrawEffectMod2X
// no effect
DrawEffectNone
)
2020-09-12 20:25:09 +00:00
// Transparent returns true if there is no effect, false otherwise
func (d DrawEffect) Transparent() bool {
2020-09-12 20:25:09 +00:00
return d != DrawEffectNone
}
2021-03-11 08:11:54 +00:00
func (d DrawEffect) String() string {
strings := map[DrawEffect]string{
DrawEffectPctTransparency25: "25% alpha",
DrawEffectPctTransparency50: "50% alpha",
DrawEffectPctTransparency75: "75% alpha",
DrawEffectModulate: "Modulate",
DrawEffectBurn: "Burn",
DrawEffectNormal: "Normal",
DrawEffectMod2XTrans: "Mod2XTrans",
DrawEffectMod2X: "Mod2X",
DrawEffectNone: "None",
}
drawEffect, found := strings[d]
if !found {
return unknown
2021-03-11 08:11:54 +00:00
}
return drawEffect
}