Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem loading Tiles
#12
Code:
Public Sub BltTile(ByVal x As Long, ByVal y As Long)

Dim Ground As Long
Dim Anim1 As Long
Dim Anim2 As Long

    With Map.Tile(x, y)
        Ground = .Ground
        Anim1 = .Mask
        Anim2 = .Anim
    End With
    
    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = x * PIC_X
        .Right = .Left + PIC_X
    End With
    
    With rec
        .top = Int(Ground / 7) * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = (Ground - Int(Ground / 7) * 7) * PIC_X
        .Right = .Left + PIC_X
    End With
    Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT)
    
    If (MapAnim = 0) Or (Anim2  0 Then
            With rec
                .top = Int(Anim2 / 7) * PIC_Y
                .Bottom = .top + PIC_Y
                .Left = (Anim2 - Int(Anim2 / 7) * 7) * PIC_X
                .Right = .Left + PIC_X
            End With
            Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        End If
    End If
End Sub

Public Sub BltItem(ByVal ItemNum As Long)
'****************************************************************
'* WHEN        WHO        WHAT
'* ----        ---        ----
'* 07/12/2005  Shannara   Optimized function.
'****************************************************************
    
    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = MapItem(ItemNum).y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = MapItem(ItemNum).x * PIC_X
        .Right = .Left + PIC_X
    End With

    With rec
        .top = Item(MapItem(ItemNum).Num).Pic * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = 0
        .Right = .Left + PIC_X
    End With
    
    Call DD_BackBuffer.BltFast(MapItem(ItemNum).x * PIC_X, MapItem(ItemNum).y * PIC_Y, DD_ItemSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
End Sub

That is the bltTile Sub

Code:
Public Sub BltFringeTile(ByVal x As Long, ByVal y As Long)
Dim Fringe As Long

    ' Only used if ever want to switch to blt rather then bltfast
    With rec_pos
        .top = y * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = x * PIC_X
        .Right = .Left + PIC_X
    End With
    
    Fringe = Map.Tile(x, y).Fringe
        
    If Fringe > 0 Then
        With rec
            .top = Int(Fringe / 7) * PIC_Y
            .Bottom = .top + PIC_Y
            .Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X
            .Right = .Left + PIC_X
        End With
        Call DD_BackBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
    End If
End Sub

That is the blt Fringe Tile sub. Anything else needed for review?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)