30-08-2008, 11:35 PM
Code:
For y = 0 To MAX_MAPY
' Blit out the npcs
For i = 1 To MAX_MAP_NPCS
If MapNpc(i).y = y Then
Call BltNpc(i)
End If
Next i
' Blit out players
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
If GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
If GetPlayerY(i) = y Then
Call BltPlayer(i)
End If
End If
End If
Next i
Next yQuote: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?



You can do this with BltNPCtop also, but you can't have both fixes, coz what if, for example, the NPC's top had to go over the player's bottom. All in all, a good optimization though
Nice one Robin :wink:
Although, it's probably the easiest to do in DX8, just set the Z value I'd beleive xD Nice optimization for DX7 though