| Mirage Source http://www.miragesource.net/forums/ |
|
| Practicing DirectX http://www.miragesource.net/forums/viewtopic.php?f=201&t=3874 |
Page 1 of 1 |
| Author: | jsventor [ Sun Jun 22, 2008 1:29 am ] |
| Post subject: | Practicing DirectX |
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? |
|
| Author: | Robin [ Sun Jun 22, 2008 1:34 am ] |
| Post subject: | Re: Practicing DirectX |
Remove the timer. BltToDC only requires you to do it once. That's why it's better than BitBlt. |
|
| Author: | jsventor [ Sun Jun 22, 2008 1:41 am ] |
| Post subject: | Re: Practicing DirectX |
Robin wrote: Remove the timer. BltToDC only requires you to do it once. That's why it's better than BitBlt. Ahh ok gotcha 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 >.> |
|
| Author: | GIAKEN [ Sun Jun 22, 2008 2:46 am ] |
| Post subject: | Re: Practicing DirectX |
Add a check to make sure that mm isn't over the max inventory (24?) or under 0 (or 1?). |
|
| Author: | jsventor [ Sun Jun 22, 2008 4:02 am ] |
| Post subject: | Re: Practicing DirectX |
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
|
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|