Merge pull request #7853 from Mailaender/alpha-experiments

Added AlphaImage support
This commit is contained in:
Paul Chote
2015-04-25 19:03:25 +12:00
7 changed files with 28 additions and 6 deletions

View File

@@ -44,7 +44,9 @@ namespace OpenRA
SoftAdditive, SoftAdditive,
Translucency25, Translucency25,
Translucency50, Translucency50,
Translucency75 Translucency75,
Multiplicative,
DoubleMultiplicative
} }
public interface IGraphicsDevice : IDisposable public interface IGraphicsDevice : IDisposable

View File

@@ -267,6 +267,16 @@ namespace OpenRA.Renderer.Sdl2
ErrorHandler.CheckGlError(); ErrorHandler.CheckGlError();
GL.BlendColor(1f, 1f, 1f, 0.75f); GL.BlendColor(1f, 1f, 1f, 0.75f);
break; 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(); ErrorHandler.CheckGlError();

BIN
mods/ts/bits/alpha.pal Normal file

Binary file not shown.

BIN
mods/ts/bits/alphatst.shp Normal file

Binary file not shown.

View File

@@ -1270,10 +1270,14 @@ GALITE:
Range: 2c0 Range: 2c0
Power: Power:
Amount: 0 Amount: 0
# WithIdleOverlay@LIGHTING: WithIdleOverlay@LIGHTING:
# Sequence: lighting Sequence: lighting
Palette: alpha
Selectable: Selectable:
Bounds: 25, 35, 0, -12 Bounds: 25, 35, 0, -12
Buildable:
Queue: Defense
Prerequisites: ~disabled
GAICBM: GAICBM:
Inherits: ^Building Inherits: ^Building

View File

@@ -45,6 +45,9 @@ World:
Filename: unittem.pal Filename: unittem.pal
AllowModifiers: false AllowModifiers: false
ShadowIndex: 1 ShadowIndex: 1
PaletteFromFile@alpha:
Name: alpha
Filename: alpha.pal
PaletteFromRGBA@shadow: PaletteFromRGBA@shadow:
Name: shadow Name: shadow
R: 0 R: 0

View File

@@ -690,9 +690,12 @@ galite:
damaged-idle: gtlite damaged-idle: gtlite
Start: 1 Start: 1
ShadowStart: 3 ShadowStart: 3
# lighting: alphatst lighting: alphatst
# ZOffset: -1c511 BlendMode: DoubleMultiplicative
# BlendMode: Alpha UseTilesetCode: false
icon: liteicon
Offset: 0, 0
UseTilesetCode: false
namntk: namntk:
idle: ntmntk idle: ntmntk