Just testing my game this morning and noticed that resource usage (in TaskManager) went through the roof. I've narrowed it down to use of SetColor. The code below uses a largeish image(512x512) to emphasise the effect though it happens with smaller graphics as well.
Import mojo
Function Main()
New myApp
End
Class myApp Extends App
Field img:Image
Method OnCreate()
Self.img = LoadImage("1.jpg")
SetUpdateRate(30)
End
Method OnRender()
Cls
SetColor Rnd(0,255),Rnd(0,255),Rnd(0,255)
DrawImage(Self.img,0,0)
End Method
End I'm testing in HTML5 though the app will be released for iOS. If you run the program and watch TaskManager you'll see that memory usage quickly grows to over 300MB. I've read somewhere that using SetColor is a bit dodgy in HTML5, and that's fine. But does this problem also affect apps running in iOS, or Android for that matter? I don't know much about it but I'd imagine hogging over 300MB because I'm using SetColor, is going to be a massive problem on mobile devices.
|