Advertisement
GalaxyHells

Icones NPO

Oct 13th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. 1. Procura por:
  2. Call BltPlayer(i)
  3.  
  4. em baixo add:
  5. Call BltCharShadow(i, 1)
  6.  
  7. 3. Em baixo de:
  8. ' gfx buffers
  9.  
  10. Add:
  11. Public DDS_CharShadow As DirectDrawSurface7
  12.  
  13. 4. Em baixo de:
  14. ' descriptions
  15.  
  16. Add:
  17. Public DDSD_CharShadow As DDSURFACEDESC2
  18.  
  19. 5. em baixo de:
  20. ' load persistent surfaces
  21.  
  22. Add:
  23. If FileExist(App.Path & "\data files\graphics\char_shadow_1.bmp", True) Then Call InitDDSurf("char_shadow_1", DDSD_CharShadow, DDS_CharShadow)
  24.  
  25. 6. no fim do modDirectDraw7 add:
  26. Public Sub BltCharShadow(ByVal Index As Long, ByVal Tipe As Byte, Optional ByVal npcNum As Long)
  27. Dim sRECT As DxVBLib.RECT
  28. Dim Width As Long, Height As Long
  29. Dim x As Long, Y As Long
  30. Dim XOffSet As Long, YOffSet As Long
  31.  
  32. ' If debug mode, handle error then exit out
  33. If Options.Debug = 1 Then On Error GoTo errorhandler
  34.  
  35. If Tipe = 2 Then
  36. 'If Npc(npcNum).Shadow <= 0 Then Exit Sub
  37. End If
  38.  
  39.  
  40. If DDS_CharShadow Is Nothing Then Exit Sub
  41.  
  42. Width = DDSD_CharShadow.lWidth
  43. Height = DDSD_CharShadow.lHeight
  44.  
  45. With sRECT
  46. .top = 0
  47. .Bottom = Height
  48. .Left = 0
  49. .Right = Width
  50. End With
  51.  
  52. Dim name As String
  53. Dim TextX As Long
  54. Dim TextY As Long
  55.  
  56. If Options.NomeLevel = 0 Then 'Ativado
  57. name = "Lv." & GetPlayerLevel(Index) & " : " & Trim$(Player(Index).name)
  58. Else
  59. name = Trim$(Player(Index).name)
  60. End If
  61.  
  62. ' calc pos
  63. TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffSet + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(name)))
  64. If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
  65. TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet - 16
  66. Else
  67. ' Determine location for text
  68. TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 25
  69. End If
  70.  
  71. XOffSet = 0
  72. YOffSet = 0
  73. x = TextX + 90 'ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffSet
  74. Y = TextY - 10 'ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffSet + 8
  75.  
  76. ' clipping
  77. If Y < 0 Then
  78. With sRECT
  79. .top = .top - Y
  80. End With
  81. Y = 0
  82. End If
  83.  
  84. If x < 0 Then
  85. With sRECT
  86. .Left = .Left - x
  87. End With
  88. x = 0
  89. End If
  90.  
  91. If Y + Height > DDSD_BackBuffer.lHeight Then
  92. sRECT.Bottom = sRECT.Bottom - (Y + Height - DDSD_BackBuffer.lHeight)
  93. End If
  94.  
  95. If x + Width > DDSD_BackBuffer.lWidth Then
  96. sRECT.Right = sRECT.Right - (x + Width - DDSD_BackBuffer.lWidth)
  97. End If
  98.  
  99. ' /clipping
  100. Select Case Tipe
  101. Case 1
  102. Call Engine_BltFast(x, Y, DDS_CharShadow, sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
  103. Case 2
  104. 'Call Engine_BltFast(x, Y, DDS_CharShadow(Npc(npcNum).Shadow), sRECT, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
  105. End Select
  106.  
  107. ' Error handler
  108. Exit Sub
  109. errorhandler:
  110. HandleError "BltCharShadow", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
  111. Err.Clear
  112. Exit Sub
  113. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement