Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Procura por:
- Call BltPlayer(i)
- em baixo add:
- Call BltCharShadow(i, 1)
- 3. Em baixo de:
- ' gfx buffers
- Add:
- Public DDS_CharShadow As DirectDrawSurface7
- 4. Em baixo de:
- ' descriptions
- Add:
- Public DDSD_CharShadow As DDSURFACEDESC2
- 5. em baixo de:
- ' load persistent surfaces
- Add:
- If FileExist(App.Path & "\data files\graphics\char_shadow_1.bmp", True) Then Call InitDDSurf("char_shadow_1", DDSD_CharShadow, DDS_CharShadow)
- 6. no fim do modDirectDraw7 add:
- Public Sub BltCharShadow(ByVal Index As Long, ByVal Tipe As Byte, Optional ByVal npcNum As Long)
- Dim sRECT As DxVBLib.RECT
- Dim Width As Long, Height As Long
- Dim x As Long, Y As Long
- Dim XOffSet As Long, YOffSet As Long
- ' If debug mode, handle error then exit out
- If Options.Debug = 1 Then On Error GoTo errorhandler
- If Tipe = 2 Then
- 'If Npc(npcNum).Shadow <= 0 Then Exit Sub
- End If
- If DDS_CharShadow Is Nothing Then Exit Sub
- Width = DDSD_CharShadow.lWidth
- Height = DDSD_CharShadow.lHeight
- With sRECT
- .top = 0
- .Bottom = Height
- .Left = 0
- .Right = Width
- End With
- Dim name As String
- Dim TextX As Long
- Dim TextY As Long
- If Options.NomeLevel = 0 Then 'Ativado
- name = "Lv." & GetPlayerLevel(Index) & " : " & Trim$(Player(Index).name)
- Else
- name = Trim$(Player(Index).name)
- End If
- ' calc pos
- TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffSet + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(name)))
- If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
- TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet - 16
- Else
- ' Determine location for text
- TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 25
- End If
- XOffSet = 0
- YOffSet = 0
- x = TextX + 90 'ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffSet
- Y = TextY - 10 'ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet + 8
- ' clipping
- If Y < 0 Then
- With sRECT
- .top = .top - Y
- End With
- Y = 0
- End If
- If x < 0 Then
- With sRECT
- .Left = .Left - x
- End With
- x = 0
- End If
- If Y + Height > DDSD_BackBuffer.lHeight Then
- sRECT.Bottom = sRECT.Bottom - (Y + Height - DDSD_BackBuffer.lHeight)
- End If
- If x + Width > DDSD_BackBuffer.lWidth Then
- sRECT.Right = sRECT.Right - (x + Width - DDSD_BackBuffer.lWidth)
- End If
- ' /clipping
- Select Case Tipe
- Case 1
- Call Engine_BltFast(x, Y, DDS_CharShadow, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
- Case 2
- 'Call Engine_BltFast(x, Y, DDS_CharShadow(Npc(npcNum).Shadow), sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
- End Select
- ' Error handler
- Exit Sub
- errorhandler:
- HandleError "BltCharShadow", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
- Err.Clear
- Exit Sub
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement