kurosu wrote:Someone is actually
porting scummvm to android, but they are linking against the (normally unavailable) internal libraries, like skia and pixelflinger.
As for the approach used in the port you describe, I'm still uncertain. I've just tested your SDL 1.3 branch, and unfortunately, SDL_DisplayFormat* functions seem to force h/w textures (despite my requesting s/w ones), which doesn't sit well with the fact we want read access to some of those surfaces. Once I worked around this, I finally was able to see a dismal performance: framerate was likely halved compared to 1.2. Maybe this underlines some necessary adaptations, but for now I'll stay with 1.2 then.
I've looked up at your code for handling double-buffering in SDL 1.2, and don't see any reason for it to fail, so the problem is probably in the wormux code.
Well, it was designed to generate only h/w textures, if you don't like h/w accel or doing per-pixel access you should use old SDL_Surface api instead of SDL_Texture. Actually there is small part of code in SDL_renderer_gles.c:839 which does one extra memcpy() on the whole screen before rendering, that's why it's even slower than SDL 1.2. But if you don't use ANY pixel-access operations it should be faster. Well, if you're updating not the whole screen, but part of it, or some texture to blit on it, you may call SDL_DirtyTexture() or SDL_LockTexture() with dirty flag - it will then update only small rectangle of texture, not the whole texture.
Also there are some news - I've found out that latest trunk crashes on Android 2.0+ inside audio code, if you'll disable audio it will work okay. And yet it works on Android 1.6 for some reason, I guess I'll have to dig into AudioTrack and PixelFlinger source (or revert to my slower but working implementation with two threads).
Edit: if you need to render surfaces with alpha channel or colorkey there are RGBA4444 and RGBA5551 (1 bit alpha for colorkey) pixel formats available in OpenGL ES, the color range is of course worse than RGB565 but hey, you have H/W accelerated alpha, no need to do any pixel-access. Alien Blaster also uses images with color key and alpha, the only thing that it lacks is proper use of SDL 1.3 SDL_Texture features (or proper SDL 1.2 port, I'm still working on it

)
Edit2: more news: I've fixed the crashing in current trunk, now I'll be moving it back to SDL 1.2.