| Mirage Source http://miragesource.net/forums/ |
|
| Remove the need for BltPlayerTop http://miragesource.net/forums/viewtopic.php?f=210&t=4230 |
Page 1 of 1 |
| Author: | Robin [ Sat Aug 30, 2008 11:35 pm ] |
| Post subject: | Remove the need for BltPlayerTop |
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 y |
|
| Author: | JokeofWeek [ Sat Aug 30, 2008 11:55 pm ] |
| Post subject: | Re: Remove the need for BltPlayerTop |
Aha, such a quick fix, good optimization too, since it saves you the extra MAX_PLAYERS loop |
|
| Author: | Robin [ Sat Aug 30, 2008 11:56 pm ] |
| Post subject: | Re: Remove the need for BltPlayerTop |
It already handles the NPC as well. Look at the code xD I've been meaning to do something like this for ages. I originally had it as: For y = max_mapy to 0 step - 1 Thinking that it should render from bottom to top. Silly mistake tbh xD |
|
| Author: | JokeofWeek [ Sat Aug 30, 2008 11:59 pm ] |
| Post subject: | Re: Remove the need for BltPlayerTop |
Robin wrote: It already handles the NPC as well. Look at the code xD I've been meaning to do something like this for ages. I originally had it as: For y = max_mapy to 0 step - 1 Thinking that it should render from bottom to top. Silly mistake tbh xD :O True xD Hadn't realized that |
|
| Author: | Robin [ Sun Aug 31, 2008 12:05 am ] |
| Post subject: | Re: Remove the need for BltPlayerTop |
I use the same method in Dx8. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|