WinCE is using -O3 by default, which includes -finline-functions, which in turn
breaks SCI. By disabling that opimization we get SCI working fine again.
The OS can kill the activity at will after onPause() or onStop()
to free up memory for other application. Provide a parachute when
the engine allows it.
CursorMan allows to push cursors with a width/height of zero. If such a
cursor is restored, we don't need to call glTexSubImage2D() 0xffffffff
times... This fixes delays of multiple minutes when closing GMM
on groovie and sword.
Also, I want that last hour of my life back.
The content of a paletted texture is in _surface.pixels. When recreating
the surface, don't wipe its data unnecessarily. This fixes gfx garbage
on CLUT8 games/cursors when leaving and going back to ScummVM
Split surface code into helper functions to avoid code duplication, and
distinguish between screen resizes and surface recreation. The former
happens when toggling the softkeyb, where we just have to reset the
viewport. Fixes garbled textures in those cases.
Since not every engine respects pauseEngine(), or they're in a state
where it simply gets ignored, put all threads in a group coma. Without
this, code still kept looping and wasting cpu cycles, while the user
might want to do use her/his droid for something else.
Don't just kill the whole process when the Activity is stopped. Instead,
use its events to pause or resume audio and the running engine (if any).
Of course not every engines implements that... but at least an incoming
call doesn't kill the game now (lol).
- make the startup sequence more linear
- use SurfaceHolder events
- get rid of the surface lock
- remove unnecessary JNI calls
- make the ScummVM class implement Runnable
- cleanup
Most games register a music channel, and when there is no music,
they still stream silence (and run through all the Converter::flow
code!). Scan the buffer for that to pause the AudioTrack. Ugly, but
worth it - reduces CPU usage on many games and hence saves battery life.
Only works in situations without any registered channels (or all paused)
at the mixer (like on the launcher or GMM).
CPU usage before (Galaxy Tab):
~5% scummvm
~15% mediaserver
After:
~2% scummvm
0% mediaserver
;)