Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Practicing DirectX
#1
Code:
Sub DisplaySpellIcons()
' Icons
        Dim M As Long
        Dim Mm As Long
        Dim TI As Long
        Dim sDc As Long
              
        If GetTickCount > TI + 500 Then
            For M = 0 To MAX_PLAYER_SPELLS - 1
                Mm = Player(MyIndex).Spell(M + 1)
    With rec
        .top = Spell(Mm).Pic * PIC_Y
        .Bottom = .top + PIC_Y
        .Left = 0
        .Right = .Left + PIC_X
    End With
  
    With rec_pos
        .top = 0
        .Bottom = PIC_Y
        .Left = 0
        .Right = PIC_X
    End With

    DD_SpellIconSurf.BltToDC frmMirage.picSpell(M).hDC, rec, rec_pos
    frmMirage.picSpell(M).Refresh
    'Call BitBlt(frmMirage.picSpell(M).hDC, 0, 0, PIC_X, PIC_Y, frmMirage.picSpellIcons.hDC, (Spell(Mm).Pic - Int(Spell(Mm).Pic / 6) * 6) * PIC_X, Int(Spell(Mm).Pic / 6) * PIC_Y, SRCCOPY)
            Next M
        End If
End Sub

It originally used BitBlt, and Im making it use BltToDc instead because I heard it was better, and I successfully did it with something else, but with this I am getting an RTE 9 on this line..

Code:
.top = Spell(Mm).Pic * PIC_Y

Any ideas?
Reply
#2
Remove the timer. BltToDC only requires you to do it once.

That's why it's better than BitBlt.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Robin Wrote:Remove the timer. BltToDC only requires you to do it once.

That's why it's better than BitBlt.


Ahh ok gotcha Tongue

And there is no timer, that's a separate sub that's Called in the Game Loop, Its just that one line giving me problems for some reason >.>
Reply
#4
Add a check to make sure that mm isn't over the max inventory (24?) or under 0 (or 1?).
Reply
#5
Well if in mod types, spells are
Code:
Public Spell(1 To MAX_SPELLS) As SpellRec

Then why is this..
Code:
0 To MAX_PLAYER_SPELLS - 1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)