Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Map Editor
#13
Ah, okay. I'm not very familiar with MSE2, but for the problem you describe I don't think the solution should differ much from 3.0.3. If you're subs look like this, I'm fairly certain it should work. Maybe someone with more experience with MSE2 can verify?

Code:
Public Sub BltAnimations()
Dim rec As DXVBLib.RECT
Dim X As Byte, Y As Byte
    
    For X = 0 To MAX_MAPX
        For Y = 0 To MAX_MAPY
            With Map.Tile(X, Y)
                ' Is there an animation tile to plot?
                If .Anim > 0 Then
                    rec.Top = Int(.Anim / 16) * PIC_Y
                    rec.Bottom = rec.Top + PIC_Y
                    rec.Left = Int(.Anim Mod 16) * PIC_X
                    rec.Right = rec.Left + PIC_X
                    Call DD_MiddleBuffer.BltFast(X * PIC_X, Y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                End If
            End With
        Next Y
    Next X
End Sub

Code:
Public Sub BltMap()
Dim rec As DXVBLib.RECT
Dim X As Byte, Y As Byte
    
    With rec
        .Top = 0
        .Bottom = (MAX_MAPY + 1) * PIC_Y
        .Left = 0
        .Right = (MAX_MAPX + 1) * PIC_X
    End With
        
    ' clear buffers
    DD_LowerBuffer.BltColorFill rec, RGB(0, 0, 0)
    DD_UpperBuffer.BltColorFill rec, RGB(0, 0, 0)

    For X = 0 To MAX_MAPX
        For Y = 0 To MAX_MAPY
            With Map.Tile(X, Y)
                rec.Top = Int(.Ground / 16) * PIC_Y
                rec.Bottom = rec.Top + PIC_Y
                rec.Left = Int(.Ground Mod 16) * PIC_X
                rec.Right = rec.Left + PIC_X
                Call DD_LowerBuffer.BltFast(X * PIC_X, Y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

                If .Mask > 0 And TempTile(X, Y).DoorOpen = NO Then
                    rec.Top = Int(.Mask / 16) * PIC_Y
                    rec.Bottom = rec.Top + PIC_Y
                    rec.Left = Int(.Mask Mod 16) * PIC_X
                    rec.Right = rec.Left + PIC_X
                    Call DD_LowerBuffer.BltFast(X * PIC_X, Y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                End If
                If .Fringe > 0 Then
                    rec.Top = Int(.Fringe / 16) * PIC_Y
                    rec.Bottom = rec.Top + PIC_Y
                    rec.Left = Int(.Fringe Mod 16) * PIC_X
                    rec.Right = rec.Left + PIC_X
                    Call DD_UpperBuffer.BltFast(X * PIC_X, Y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
                End If
            End With
        Next Y
    Next X
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)