23-12-2006, 10:01 PM
Author: Enigmewave
Difficulty: 3/5
:: CLIENT SIDE ::
In modDirectX.bas, add:
In sub InitSurfaces, replace:With:Replace:With:Replace:With:
After that, whatever color the top left pixel is on the sprites surface, tiles surface, or items surface will be the transparent color for that surface.
Difficulty: 3/5
:: CLIENT SIDE ::
In modDirectX.bas, add:
Code:
Public Sub SetMaskColorFromPixel(ByRef TheSurface As DirectDrawSurface7, ByVal X As Long, ByVal Y As Long)
Dim TmpR As RECT
Dim TmpDDSD As DDSURFACEDESC2
Dim TmpColorKey As DDCOLORKEY
With TmpR
.Left = X
.Top = Y
.Right = X
.Bottom = Y
End With
TheSurface.Lock TmpR, TmpDDSD, DDLOCK_WAIT Or DDLOCK_READONLY, 0
With TmpColorKey
.low = TheSurface.GetLockedPixel(X, Y)
.high = .low
End With
TheSurface.SetColorKey DDCKEY_SRCBLT, TmpColorKey
TheSurface.Unlock TmpR
End Sub
In sub InitSurfaces, replace:
Code:
DD_SpriteSurf.SetColorKey DDCKEY_SRCBLT, key
Code:
SetMaskColorFromPixel DD_SpriteSurf, 0, 0
Code:
DD_TileSurf.SetColorKey DDCKEY_SRCBLT, key
Code:
SetMaskColorFromPixel DD_TileSurf, 0, 0
Code:
DD_ItemSurf.SetColorKey DDCKEY_SRCBLT, key
Code:
SetMaskColorFromPixel DD_ItemSurf, 0, 0
After that, whatever color the top left pixel is on the sprites surface, tiles surface, or items surface will be the transparent color for that surface.