home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD14675282001.psc / blts.bas next >
Encoding:
BASIC Source File  |  2001-01-27  |  9.2 KB  |  220 lines

  1. Attribute VB_Name = "Bltbas"
  2. Sub bltmapclipped()
  3. mapplx = 10
  4. mapply = 10
  5. Dim r1 As RECT
  6. With r1
  7. .Left = rWin.Left
  8. .Top = rWin.Top
  9. .Right = rWin.Right
  10. .Bottom = rWin.Bottom
  11. End With
  12. If plx > 10 Then
  13. r1.Left = (plx - 10) * 16
  14. r1.Right = r1.Left + (rWin.Right - rWin.Left)
  15. mapplx = 10
  16. Else
  17. mapplx = plx
  18. End If
  19. If (ddmapsize.Right / 48) - plx <= 10 Then
  20. r1.Right = ddmapsize.Right / 2
  21. r1.Left = r1.Right - (rWin.Right - rWin.Left)
  22. mapplx = Round(plx - ((ddmapsize.Right / 48) - ((rWin.Right - rWin.Left) / 48)) + 6.9, 1)
  23. End If
  24. If ply >= 7.5 Then
  25. r1.Top = (ply - 7.5) * 16
  26. r1.Bottom = r1.Top + (rWin.Bottom - rWin.Top)
  27. mapply = 7.5
  28. Else
  29. mapply = ply
  30. End If
  31. If (ddmapsize.Bottom / 48) - ply <= 7.5 Then
  32. r1.Bottom = ddmapsize.Bottom / 2.18
  33. r1.Top = r1.Bottom - (rWin.Bottom - rWin.Top)
  34. mapply = ply - ((ddmapsize.Bottom / 48) - ((rWin.Bottom - rWin.Top) / 48)) + 5
  35. End If
  36. 'MsgBox ddmapsize.Right
  37. 'Debug.Print r1.Left & ":" & r1.Right
  38. DDmapbuffer.Blt rWin, DDMap, r1, DDBLT_WAIT
  39. DDmapbuffer.Blt rWin, DDOppbuffer, r1, DDBLT_KEYSRC
  40. 'If connected = True And plonline > 1 Then
  41. End Sub
  42. Sub Blt()
  43. If GameForm.Visible = False Then Exit Sub
  44. If frmLogin.Visible = True Then Exit Sub
  45. On Error Resume Next
  46. Dim rw As RECT: Dim rhead As RECT: Dim rheadpos As RECT: Dim cw As Integer: Dim ch As Integer
  47. Dim postemp(1) As Integer: Dim scrtemp(1) As Integer
  48. Call DX.GetWindowRect(GameForm.DXPic.hwnd, rw)
  49. If edit <> True Then
  50. bltmapclipped
  51. 'MsgBox connected & ":" & plonline
  52. If connected = True And plonline > 1 Then bltopp
  53. Call bltplayer1(Imgy, Imgx)
  54. r1.Top = 50: r1.Bottom = 530: r1.Left = 0: r1.Right = 640
  55. DDGetReady.Blt r1, DDmapbuffer, rWin, DDBLT_WAIT
  56. BltGUI
  57. If quitmenu = True Then bltmenu
  58. End If
  59. bltNPC
  60. DDPrimSurf.Blt rw, DDGetReady, rWin, DDBLT_WAIT
  61. End Sub
  62. Sub bltNPC()
  63. 'For i = 1 To NPCno
  64.  
  65. 'Next i
  66. End Sub
  67. Sub bltmouseout(mouseout As Integer)
  68. Dim rw As RECT
  69. Dim r5 As RECT: Dim r6 As RECT:
  70. Call DX.GetWindowRect(GameForm.DXPic.hwnd, rw)
  71. r5.Left = GUI(mouseout, 2): r5.Top = GUI(mouseout, 3): r5.Right = GUI(mouseout, 4): r5.Bottom = GUI(mouseout, 5)
  72. r6.Top = GUI(mouseout, 7): r6.Bottom = GUI(mouseout, 9): r6.Left = GUI(mouseout, 6): r6.Right = GUI(mouseout, 8)
  73. rw.Top = rw.Top + r6.Top: rw.Bottom = rw.Top + (r6.Bottom - r6.Top): rw.Left = rw.Left + r6.Left: rw.Right = rw.Left + (r6.Right - r6.Left)
  74. DDGetReady.Blt r6, DDGUI(GUI(mouseout, 12)), r5, DDBLT_KEYSRC
  75. DDPrimSurf.Blt rw, DDGetReady, r6, DDBLT_WAIT
  76. End Sub
  77.  
  78. Sub bltmouseover(mouseover As Integer)
  79. Dim rw As RECT
  80. Dim r5 As RECT: Dim r6 As RECT:
  81. Call DX.GetWindowRect(GameForm.DXPic.hwnd, rw)
  82. For i = 1 To guinumber
  83. If GUI(i, 0) = GUI(mouseover, 10) Then
  84. r5.Left = GUI(i, 2): r5.Top = GUI(i, 3): r5.Right = GUI(i, 4): r5.Bottom = GUI(i, 5)
  85. r6.Top = GUI(i, 7): r6.Bottom = GUI(i, 9): r6.Left = GUI(i, 6): r6.Right = GUI(i, 8)
  86. rw.Top = rw.Top + r6.Top: rw.Bottom = rw.Top + (r6.Bottom - r6.Top): rw.Left = rw.Left + r6.Left: rw.Right = rw.Left + (r6.Right - r6.Left)
  87. DDGetReady.Blt r6, DDGUI(GUI(i, 12)), r5, DDBLT_KEYSRC
  88. DDPrimSurf.Blt rw, DDGetReady, r6, DDBLT_WAIT
  89. End If
  90. Next i
  91. mouseov = mouseover
  92. End Sub
  93. Sub bltmenu()
  94. Dim r5 As RECT: Dim r6 As RECT: Dim rw As RECT
  95. Call DX.GetWindowRect(GameForm.DXPic.hwnd, rw)
  96. If quitmenu = True Then
  97. For i = 1 To guinumber
  98. If GUI(i, 0) = "MenuButton" Then GoTo 1
  99. If Left(GUI(i, 0), 4) = "Menu" Then
  100. r5.Left = GUI(i, 2): r5.Top = GUI(i, 3): r5.Right = GUI(i, 4): r5.Bottom = GUI(i, 5)
  101. r6.Left = GUI(i, 6): r6.Top = GUI(i, 7): r6.Right = GUI(i, 8): r6.Bottom = GUI(i, 9)
  102. DDGetReady.Blt r6, DDGUI(GUI(i, 12)), r5, DDBLT_KEYSRC
  103. End If
  104. 1 Next i
  105. End If
  106. End Sub
  107. Sub BltGUI()
  108. Dim r5 As RECT: Dim r6 As RECT: Dim r7 As RECT: Dim R8 As RECT:
  109. For i = 1 To guinumber
  110. If GUI(i, 11) = "True" Then
  111. r5.Left = GUI(i, 2): r5.Top = GUI(i, 3): r5.Right = GUI(i, 4): r5.Bottom = GUI(i, 5)
  112. r6.Left = GUI(i, 6): r6.Top = GUI(i, 7): r6.Right = GUI(i, 8): r6.Bottom = GUI(i, 9)
  113. DDGetReady.Blt r6, DDGUI(GUI(i, 12)), r5, DDBLT_KEYSRC
  114. End If
  115. 1 Next i
  116.  
  117. For i = 1 To guinumber
  118. If GUI(i, 0) = "Health" Or GUI(i, 0) = "health" Then Let a = i
  119. If GUI(i, 0) = "NoHealth" Then Let b = i
  120. Next i
  121.  
  122. For i = 0 To Playerdetails(2) - 1
  123. r5.Left = GUI(a, 2): r5.Top = GUI(a, 3): r5.Right = GUI(a, 4): r5.Bottom = GUI(a, 5)
  124. r6.Left = (GUI(a, 6) + (GUI(a, 15) * i)): r6.Top = GUI(a, 7): r6.Right = r6.Left + (GUI(a, 4) - GUI(a, 2)): r6.Bottom = GUI(a, 9)
  125. DDGetReady.Blt r6, DDGUI(GUI(a, 12)), r5, DDBLT_KEYSRC
  126. Next i
  127. If Playerdetails(2) < 10 Then
  128. For i = Playerdetails(2) To 9
  129. r5.Left = GUI(b, 2): r5.Top = GUI(b, 3): r5.Right = GUI(b, 4): r5.Bottom = GUI(b, 5)
  130. r6.Left = (GUI(a, 6) + (GUI(a, 15) * i)): r6.Top = GUI(a, 7): r6.Right = r6.Left + (GUI(a, 4) - GUI(a, 2)): r6.Bottom = GUI(a, 9)
  131. DDGetReady.Blt r6, DDGUI(GUI(b, 12)), r5, DDBLT_KEYSRC
  132. Next i
  133. End If
  134.  
  135. Dim c(4) As Integer
  136. For i = 1 To guinumber
  137. If GUI(i, 0) = "box1" Then Let c(1) = i
  138. If GUI(i, 0) = "box2" Then Let c(2) = i
  139. If GUI(i, 0) = "box3" Then Let c(3) = i
  140. If GUI(i, 0) = "box4" Then Let c(4) = i
  141. If GUI(i, 0) = "Numbers" Then Let e = i
  142. Next i
  143. Let f = CInt((GUI(e, 4) - GUI(e, 2)) / 10)
  144.  
  145. For j = 1 To 4
  146. For i = Len(Playerdetails(j + 2)) To 1 Step -1
  147. r6.Left = GUI(e, 2) + (Mid(Playerdetails(j + 2), i, 1) * f): r6.Top = GUI(e, 3): r6.Bottom = GUI(e, 5): r6.Right = r6.Left + f
  148. r7.Left = GUI(c(j), 8) - ((Len(Playerdetails(j + 2)) - (i - 1.5)) * f): r7.Top = GUI(c(j), 7) + 1.5: r7.Bottom = r7.Top + GUI(e, 5) - GUI(e, 3): r7.Right = r7.Left + f
  149. DDGetReady.Blt r7, DDGUI(GUI(e, 12)), r6, DDBLT_KEYSRC
  150. Next i
  151. Next j
  152.  
  153. For i = 1 To guinumber
  154. If GUI(i, 0) = "StaminaFill" Then
  155. r5.Left = GUI(i, 2): r5.Top = GUI(i, 3): r5.Right = GUI(i, 4): r5.Bottom = GUI(i, 5)
  156. r6.Left = GUI(i, 6): r6.Top = GUI(i, 7): r6.Right = GUI(i, 6) + CInt((GUI(i, 8) - GUI(i, 6)) * (Playerdetails(7) / 100)): r6.Bottom = GUI(i, 9)
  157. DDGetReady.Blt r6, DDGUI(GUI(i, 12)), r5, DDBLT_KEYSRC
  158. End If
  159. Next i
  160.  
  161. End Sub
  162.  
  163. Sub bltmap()
  164. Dim rtemp As RECT
  165. Dim Maprect As RECT
  166. For mainheight = 0 To ddmapsize.Bottom / 16
  167. For mainwidth = 0 To ddmapsize.Right / 16
  168. rtemp.Left = mainwidth * 16
  169. rtemp.Right = (mainwidth + 1) * 16
  170. rtemp.Top = mainheight * 16
  171. rtemp.Bottom = (mainheight + 1) * 16
  172. Maprect.Left = map(mainwidth, mainheight, 1) * 16: Maprect.Top = map(mainwidth, mainheight, 2) * 16: Maprect.Right = Maprect.Left + 16: Maprect.Bottom = Maprect.Top + 16
  173. DDMap.Blt rtemp, DDBackround, Maprect, DDBLT_WAIT
  174. Next mainwidth
  175. Next mainheight
  176. 'MsgBox rtemp.Right & ":" & rtemp.Bottom
  177. End Sub
  178. Sub bltopp()
  179. Dim rw As RECT:
  180. Dim rhead As RECT: Dim rheadpos As RECT: Dim cw As Integer: Dim ch As Integer
  181. 'MsgBox "plonline:" & plonline
  182. For j = 1 To plonline
  183. action = oppdetail(j, 4)
  184. For i = 1 To 2
  185. r1.Left = characterdata(action, i, oppdetail(i, 3), 3):
  186. r1.Right = characterdata(action, i, oppdetail(i, 3), 3) + characterdata(action, i, oppdetail(i, 3), 5)
  187. r1.Top = characterdata(action, i, oppdetail(i, 3), 4):
  188. r1.Bottom = characterdata(action, i, oppdetail(i, 3), 4) + characterdata(action, i, oppdetail(i, 3), 6)
  189. r2.Left = (oppdetail(j, 1) * 32) + characterdata(action, i, oppdetail(i, 3), 1):
  190. r2.Right = (oppdetail(j, 1) * 32) + characterdata(action, i, oppdetail(i, 3), 1) + characterdata(action, i, oppdetail(i, 3), 5)
  191. r2.Top = (oppdetail(j, 2) * 32) + characterdata(action, i, oppdetail(i, 3), 2):
  192. r2.Bottom = (oppdetail(j, 2) * 32) + characterdata(action, i, oppdetail(i, 3), 2) + characterdata(action, i, oppdetail(i, 3), 6)
  193. 'MsgBox i & ":" & oppdetail(j, 0) & vbCr & r1.Left & ":" & r1.Top & ":" & r1.Right & ":" & r1.Bottom & vbCr & r2.Left & ":" & r2.Top & ":" & r2.Right & ":" & r2.Bottom
  194. If i = 1 Then DDOppbuffer.Blt r2, DDOpponents(j), r1, DDBLT_KEYSRC
  195. If i = 2 Then DDOppbuffer.Blt r2, DDOpphead(j), r1, DDBLT_KEYSRC
  196. Next i
  197. DDOppbuffer.DrawText (oppdetail(j, 1) * 32 - ((Len(oppdetail(j, 0)) / 2) * 6)), (oppdetail(j, 2) + 0.8) * 32, oppdetail(j, 0), False
  198. If oppdetail(j, 15) <> "" Then DDOppbuffer.DrawText (oppdetail(j, 1) * 32 - ((Len(oppdetail(j, 6)) / 2) * 6)), (oppdetail(j, 2) - 1) * 32, oppdetail(j, 15), False
  199. Next j
  200. End Sub
  201. Sub bltplayer1(action As Integer, Direction As Integer)
  202. Dim rw As RECT:
  203. Dim rhead As RECT: Dim rheadpos As RECT: Dim cw As Integer: Dim ch As Integer
  204. For i = 1 To 2
  205. r1.Left = characterdata(action, i, Direction, 3):
  206. r1.Right = characterdata(action, i, Direction, 3) + characterdata(action, i, Direction, 5)
  207. r1.Top = characterdata(action, i, Direction, 4):
  208. r1.Bottom = characterdata(action, i, Direction, 4) + characterdata(action, i, Direction, 6)
  209. r2.Left = (mapplx * 32) + characterdata(action, i, Direction, 1):
  210. r2.Right = (mapplx * 32) + characterdata(action, i, Direction, 1) + characterdata(action, i, Direction, 5)
  211. r2.Top = (mapply * 32) + characterdata(action, i, Direction, 2):
  212. r2.Bottom = (mapply * 32) + characterdata(action, i, Direction, 2) + characterdata(action, i, Direction, 6)
  213. If i = 1 Then DDmapbuffer.Blt r2, DDCharacter, r1, DDBLT_KEYSRC
  214. If i = 2 Then DDmapbuffer.Blt r2, DDHead, r1, DDBLT_KEYSRC
  215. Next i
  216. DDmapbuffer.DrawText (mapplx * 32 - ((Len(Playerdetails(0)) / 2) * 5)), (mapply * 32) + characterdata(action, 1, Direction, 6) - 5, Playerdetails(0), False
  217. DDmapbuffer.DrawText (mapplx * 32 - ((Len(Playerdetails(1)) / 2) * 5)), (mapply * 32) - characterdata(action, 2, Direction, 6) + 5, Playerdetails(1), False
  218. End Sub
  219.  
  220.