Log In  
Log In  

I found out what was making my game slow down when in the bottom right corner of the map. It has to do with sprites clipping when they are drawn with negative coordinates. Consider the two examples below:

function _draw()
    cls()
    spr(0,1000,1000,1,1,false,false)
    cursor(0,0)
    print(stat(1))
end

This gives me 11 % CPU use.

function _draw()
    cls()
    spr(0,-1000,-1000,1,1,false,false)
    cursor(0,0)
    print(stat(1))
end

This gives me ~700 % CPU use.

This is bizarre since both obviously are clipped and nothing is ever drawn on the screen. The CPU use has to do with how far in the negative coordinates the sprite is drawn.

P#21382 2016-05-26 04:50 ( Edited 2016-05-26 08:50)


[Please log in to post a comment]

X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-03-23 04:42 | 0.010s | 2097k | Q:10