diff --git a/OpenRA.Game/Graphics/IGraphicsDevice.cs b/OpenRA.Game/Graphics/IGraphicsDevice.cs index fcb356aad0..2fdafe30d2 100755 --- a/OpenRA.Game/Graphics/IGraphicsDevice.cs +++ b/OpenRA.Game/Graphics/IGraphicsDevice.cs @@ -44,7 +44,9 @@ namespace OpenRA SoftAdditive, Translucency25, Translucency50, - Translucency75 + Translucency75, + Multiplicative, + DoubleMultiplicative } public interface IGraphicsDevice : IDisposable diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs index 2c866d194f..a5b749aa23 100755 --- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs @@ -267,6 +267,16 @@ namespace OpenRA.Renderer.Sdl2 ErrorHandler.CheckGlError(); GL.BlendColor(1f, 1f, 1f, 0.75f); break; + case BlendMode.Multiplicative: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.Zero, BlendingFactorDest.SrcColor); + break; + case BlendMode.DoubleMultiplicative: + GL.Enable(EnableCap.Blend); + ErrorHandler.CheckGlError(); + GL.BlendFunc(BlendingFactorSrc.DstColor, BlendingFactorDest.SrcColor); + break; } ErrorHandler.CheckGlError(); diff --git a/mods/ts/bits/alpha.pal b/mods/ts/bits/alpha.pal new file mode 100644 index 0000000000..42f56dd71f Binary files /dev/null and b/mods/ts/bits/alpha.pal differ diff --git a/mods/ts/bits/alphatst.shp b/mods/ts/bits/alphatst.shp new file mode 100644 index 0000000000..9c4fcb14de Binary files /dev/null and b/mods/ts/bits/alphatst.shp differ diff --git a/mods/ts/rules/civilian-structures.yaml b/mods/ts/rules/civilian-structures.yaml index d7bd1911b1..ae3ca9c2dc 100644 --- a/mods/ts/rules/civilian-structures.yaml +++ b/mods/ts/rules/civilian-structures.yaml @@ -1270,10 +1270,14 @@ GALITE: Range: 2c0 Power: Amount: 0 -# WithIdleOverlay@LIGHTING: -# Sequence: lighting + WithIdleOverlay@LIGHTING: + Sequence: lighting + Palette: alpha Selectable: Bounds: 25, 35, 0, -12 + Buildable: + Queue: Defense + Prerequisites: ~disabled GAICBM: Inherits: ^Building diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index c9abe6a0f7..4c36e7e5ce 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -45,6 +45,9 @@ World: Filename: unittem.pal AllowModifiers: false ShadowIndex: 1 + PaletteFromFile@alpha: + Name: alpha + Filename: alpha.pal PaletteFromRGBA@shadow: Name: shadow R: 0 diff --git a/mods/ts/sequences/civilian.yaml b/mods/ts/sequences/civilian.yaml index 58734dae16..afe0106b74 100644 --- a/mods/ts/sequences/civilian.yaml +++ b/mods/ts/sequences/civilian.yaml @@ -690,9 +690,12 @@ galite: damaged-idle: gtlite Start: 1 ShadowStart: 3 -# lighting: alphatst -# ZOffset: -1c511 -# BlendMode: Alpha + lighting: alphatst + BlendMode: DoubleMultiplicative + UseTilesetCode: false + icon: liteicon + Offset: 0, 0 + UseTilesetCode: false namntk: idle: ntmntk