Open modTypesFind:
Code:
Public Type TileRec
Ground As Integer
Mask As Integer
Anim As Integer
Fringe As Integer
Type As Byte
Data1 As Integer
Data2 As Integer
Data3 As Integer
End Type
Replace With:
Code:
Public Type TileRec
Ground As Integer
Mask As Integer
Anim As Integer
ReMask As Integer
ReAnim As Integer
Fringe As Integer
FAnim As Integer
Over As Integer
OverAnim As Integer
Type As Byte
Data1 As Integer
Data2 As Integer
Data3 As Integer
End Type
Find:
Code:
Public Type TilePosRec
PosX As Long
PosY As Long
Ground As DXVBLib.RECT
Mask As DXVBLib.RECT
Anim As DXVBLib.RECT
Fringe As DXVBLib.RECT
End Type
Replace With:
Code:
Public Type TilePosRec
PosX As Long
PosY As Long
Ground As DXVBLib.RECT
Mask As DXVBLib.RECT
Anim As DXVBLib.RECT
ReMask As DXVBLib.RECT
ReAnim As DXVBLib.RECT
Fringe As DXVBLib.RECT
FAnim As DXVBLib.RECT
Over As DXVBLib.RECT
OverAnim As DXVBLib.RECT
End Type
Open modGameEditorsFind:
Code:
With Map.Tile(CurX, CurY)
If frmMirage.optGround.Value Then .Ground = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optMask.Value Then .Mask = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optAnim.Value Then .Anim = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optFringe.Value Then .Fringe = EditorTileY * TILESHEET_WIDTH + EditorTileX
End With
Replace With:
Code:
With Map.Tile(CurX, CurY)
If frmMirage.optGround.Value Then .Ground = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optMask.Value Then .Mask = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optAnim.Value Then .Anim = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optReMask.Value Then .ReMask = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optReAnim.Value Then .ReAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optFringe.Value Then .Fringe = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optFAnim.Value Then .FAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optOver.Value Then .Over = EditorTileY * TILESHEET_WIDTH + EditorTileX
If frmMirage.optOverAnim.Value Then .OverAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
End With
Find:
Code:
With Map.Tile(CurX, CurY)
If frmMirage.optGround.Value Then .Ground = 0
If frmMirage.optMask.Value Then .Mask = 0
If frmMirage.optAnim.Value Then .Anim = 0
If frmMirage.optFringe.Value Then .Fringe = 0
End With
Replace With:
Code:
With Map.Tile(CurX, CurY)
If frmMirage.optGround.Value Then .Ground = 0
If frmMirage.optMask.Value Then .Mask = 0
If frmMirage.optAnim.Value Then .Anim = 0
If frmMirage.optReMask.Value Then .ReMask = 0
If frmMirage.optReAnim.Value Then .ReAnim = 0
If frmMirage.optFringe.Value Then .Fringe = 0
If frmMirage.optFAnim.Value Then .FAnim = 0
If frmMirage.optOver.Value Then .Over = 0
If frmMirage.optOverAnim.Value Then .OverAnim = 0
End With
Replace
Public Sub MapEditorClearLayer With:
Code:
Public Sub MapEditorClearLayer()
Dim X As Long
Dim Y As Long
' Ground layer
If frmMirage.optGround.Value Then
If MsgBox("Are you sure you wish to clear the ground layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Ground = 0
Next
Next
End If
End If
' Mask layer
If frmMirage.optMask.Value Then
If MsgBox("Are you sure you wish to clear the mask layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Mask = 0
Next
Next
End If
End If
' Animation layer
If frmMirage.optAnim.Value Then
If MsgBox("Are you sure you wish to clear the animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Anim = 0
Next
Next
End If
End If
' Re-Mask layer
If frmMirage.optReMask.Value Then
If MsgBox("Are you sure you wish to clear the re-mask layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).ReMask = 0
Next
Next
End If
End If
' Re-Animation layer
If frmMirage.optReAnim.Value Then
If MsgBox("Are you sure you wish to clear the re-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).ReAnim = 0
Next
Next
End If
End If
' Fringe layer
If frmMirage.optFringe.Value Then
If MsgBox("Are you sure you wish to clear the fringe layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Fringe = 0
Next
Next
End If
End If
' Fringe Animation layer
If frmMirage.optFAnim.Value Then
If MsgBox("Are you sure you wish to clear the fringe-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).FAnim = 0
Next
Next
End If
End If
' Over layer
If frmMirage.optOver.Value Then
If MsgBox("Are you sure you wish to clear the over layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Over = 0
Next
Next
End If
End If
' Over Animation layer
If frmMirage.optOverAnim.Value Then
If MsgBox("Are you sure you wish to clear the over-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).OverAnim = 0
Next
Next
End If
End If
Call CalcTilePositions
End Sub
Replace
Public Sub MapEditorFillLayer With:
Code:
Public Sub MapEditorFillLayer()
Dim X As Long
Dim Y As Long
' Ground layer
If frmMirage.optGround.Value Then
If MsgBox("Are you sure you wish to fill the ground layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Ground = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Mask layer
If frmMirage.optMask.Value Then
If MsgBox("Are you sure you wish to fill the mask layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Mask = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Animation layer
If frmMirage.optAnim.Value Then
If MsgBox("Are you sure you wish to fill the animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Anim = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Re-Mask layer
If frmMirage.optReMask.Value Then
If MsgBox("Are you sure you wish to fill the re-mask layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).ReMask = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Re-Animation layer
If frmMirage.optReAnim.Value Then
If MsgBox("Are you sure you wish to fill the re-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).ReAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Fringe layer
If frmMirage.optFringe.Value Then
If MsgBox("Are you sure you wish to fill the fringe layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Fringe = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Fringe Animation layer
If frmMirage.optFAnim.Value Then
If MsgBox("Are you sure you wish to fill the fringe-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).FAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Over layer
If frmMirage.optOver.Value Then
If MsgBox("Are you sure you wish to fill the over layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).Over = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
' Over Animation layer
If frmMirage.optOverAnim.Value Then
If MsgBox("Are you sure you wish to fill the over-animation layer?", vbYesNo, GAME_NAME) = vbYes Then
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
Map.Tile(X, Y).OverAnim = EditorTileY * TILESHEET_WIDTH + EditorTileX
Next
Next
End If
End If
Call CalcTilePositions
End Sub
Replace
Public Sub CalcTilePositions With:
Code:
Public Sub CalcTilePositions()
Dim X As Long
Dim Y As Long
For X = 0 To MAX_MAPX
For Y = 0 To MAX_MAPY
MapTilePosition(X, Y).PosX = X * PIC_X
MapTilePosition(X, Y).PosY = Y * PIC_Y
MapTilePosition(X, Y).Ground.Top = (Map.Tile(X, Y).Ground \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).Ground.Bottom = MapTilePosition(X, Y).Ground.Top + PIC_Y
MapTilePosition(X, Y).Ground.Left = (Map.Tile(X, Y).Ground Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).Ground.Right = MapTilePosition(X, Y).Ground.Left + PIC_X
MapTilePosition(X, Y).Mask.Top = (Map.Tile(X, Y).Mask \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).Mask.Bottom = MapTilePosition(X, Y).Mask.Top + PIC_Y
MapTilePosition(X, Y).Mask.Left = (Map.Tile(X, Y).Mask Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).Mask.Right = MapTilePosition(X, Y).Mask.Left + PIC_X
MapTilePosition(X, Y).Anim.Top = (Map.Tile(X, Y).Anim \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).Anim.Bottom = MapTilePosition(X, Y).Anim.Top + PIC_Y
MapTilePosition(X, Y).Anim.Left = (Map.Tile(X, Y).Anim Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).Anim.Right = MapTilePosition(X, Y).Anim.Left + PIC_X
MapTilePosition(X, Y).ReMask.Top = (Map.Tile(X, Y).ReMask \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).ReMask.Bottom = MapTilePosition(X, Y).ReMask.Top + PIC_Y
MapTilePosition(X, Y).ReMask.Left = (Map.Tile(X, Y).ReMask Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).ReMask.Right = MapTilePosition(X, Y).ReMask.Left + PIC_X
MapTilePosition(X, Y).ReAnim.Top = (Map.Tile(X, Y).ReAnim \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).ReAnim.Bottom = MapTilePosition(X, Y).ReAnim.Top + PIC_Y
MapTilePosition(X, Y).ReAnim.Left = (Map.Tile(X, Y).ReAnim Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).ReAnim.Right = MapTilePosition(X, Y).ReAnim.Left + PIC_X
MapTilePosition(X, Y).Fringe.Top = (Map.Tile(X, Y).Fringe \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).Fringe.Bottom = MapTilePosition(X, Y).Fringe.Top + PIC_Y
MapTilePosition(X, Y).Fringe.Left = (Map.Tile(X, Y).Fringe Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).Fringe.Right = MapTilePosition(X, Y).Fringe.Left + PIC_X
MapTilePosition(X, Y).FAnim.Top = (Map.Tile(X, Y).FAnim \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).FAnim.Bottom = MapTilePosition(X, Y).FAnim.Top + PIC_Y
MapTilePosition(X, Y).FAnim.Left = (Map.Tile(X, Y).FAnim Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).FAnim.Right = MapTilePosition(X, Y).FAnim.Left + PIC_X
MapTilePosition(X, Y).Over.Top = (Map.Tile(X, Y).Over \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).Over.Bottom = MapTilePosition(X, Y).Over.Top + PIC_Y
MapTilePosition(X, Y).Over.Left = (Map.Tile(X, Y).Over Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).Over.Right = MapTilePosition(X, Y).Over.Left + PIC_X
MapTilePosition(X, Y).OverAnim.Top = (Map.Tile(X, Y).OverAnim \ TILESHEET_WIDTH) * PIC_Y
MapTilePosition(X, Y).OverAnim.Bottom = MapTilePosition(X, Y).OverAnim.Top + PIC_Y
MapTilePosition(X, Y).OverAnim.Left = (Map.Tile(X, Y).OverAnim Mod TILESHEET_WIDTH) * PIC_X
MapTilePosition(X, Y).OverAnim.Right = MapTilePosition(X, Y).OverAnim.Left + PIC_X
Next
Next
End Sub
Replace
Public Sub BltMapTile With:
Code:
Public Sub BltMapTile(ByVal X As Long, ByVal Y As Long)
' Blit out ground tile without transparency
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).Ground, DDBLTFAST_WAIT)
If MapAnim = 0 Or Map.Tile(X, Y).Anim <= 0 Then
If Map.Tile(X, Y).Mask > 0 Then
If TempTile(X, Y).DoorOpen = NO Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).Mask, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
End If
Else
' Is there an animation tile to draw?
If Map.Tile(X, Y).Anim > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).Anim, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
End If
'Second Mask
If MapAnim = 0 Or Map.Tile(X, Y).ReAnim <= 0 Then
If Map.Tile(X, Y).ReMask > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).ReMask, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
Else
' Is there an animation tile to draw?
If Map.Tile(X, Y).ReAnim > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).ReAnim, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
End If
End Sub
Replace
Public Sub BltMapFringeTile With:
Code:
Public Sub BltMapFringeTile(ByVal X As Long, ByVal Y As Long)
If MapAnim = 0 Or Map.Tile(X, Y).FAnim <= 0 Then
If Map.Tile(X, Y).Fringe > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).Fringe, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
Else
' Is there an animation tile to draw?
If Map.Tile(X, Y).FAnim > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).FAnim, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
End If
If MapAnim = 0 Or Map.Tile(X, Y).OverAnim <= 0 Then
If Map.Tile(X, Y).Over > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).Over, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
Else
' Is there an animation tile to draw?
If Map.Tile(X, Y).OverAnim > 0 Then
Call DD_BltFast(MapTilePosition(X, Y).PosX, MapTilePosition(X, Y).PosY, DDS_Tile.Surface, MapTilePosition(X, Y).OverAnim, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End If
End If
End Sub