diff --git a/alienblaster/AppSettings.cfg b/alienblaster/AppSettings.cfg index b8f6d4573..2a1aa893d 100644 --- a/alienblaster/AppSettings.cfg +++ b/alienblaster/AppSettings.cfg @@ -1,4 +1,4 @@ -LibSdlVersion=1.3 +LibSdlVersion=1.2 AppName="Alien Blaster" AppFullName=de.schwardtnet.alienblaster ScreenOrientation=h diff --git a/alienblaster/project/jni/application/src/SdlForwardCompat.h b/alienblaster/project/jni/application/src/SdlForwardCompat.h index 6e619d6d1..33246a3a3 100644 --- a/alienblaster/project/jni/application/src/SdlForwardCompat.h +++ b/alienblaster/project/jni/application/src/SdlForwardCompat.h @@ -130,7 +130,7 @@ typedef SDL_Surface SdlCompat_AcceleratedSurface; static inline SdlCompat_AcceleratedSurface * SdlCompat_CreateAcceleratedSurface(SDL_Surface * surface) { - return SDL_ConvertSurface(surface, surface->format, 0); // Just copy it + return SDL_ConvertSurface(surface, surface->format, surface->flags | SDL_HWSURFACE); }; #endif diff --git a/alienblaster/project/jni/application/src/video.cpp b/alienblaster/project/jni/application/src/video.cpp index c9e405564..70807bdc6 100644 --- a/alienblaster/project/jni/application/src/video.cpp +++ b/alienblaster/project/jni/application/src/video.cpp @@ -54,6 +54,7 @@ SdlCompat_AcceleratedSurface *Video::init(){ __android_log_print(ANDROID_LOG_ERROR, "Alien Blaster", "Couldn't set %dx%d, %dbit video mode: %s\n", SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_GetError()); exit(2); } +#if SDL_VERSION_ATLEAST(1,3,0) // Dummy texture screen2 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 ); SDL_Surface * screen3 = SDL_DisplayFormat( screen2 ); @@ -62,17 +63,19 @@ SdlCompat_AcceleratedSurface *Video::init(){ screen->w = SCREEN_WIDTH; screen->h = SCREEN_HEIGHT; SDL_FreeSurface(screen3); - +#else + screen = screen2; +#endif SDL_WM_SetCaption("AlienBlaster", "AlienBlaster"); SDL_WM_SetIcon(SDL_LoadBMP( FN_ALIENBLASTER_ICON.c_str() ), NULL); SDL_ShowCursor(SDL_DISABLE); __android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Initializing video done"); - screen3 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 ); - SDL_FillRect(screen3, NULL, SDL_MapRGB(screen3->format, 0, 0, 0) ); - empty = SdlCompat_CreateAcceleratedSurface(screen3); - SDL_FreeSurface(screen3); + SDL_Surface * empty2 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 ); + SDL_FillRect(empty2, NULL, SDL_MapRGB(empty2->format, 0, 0, 0) ); + empty = SdlCompat_CreateAcceleratedSurface(empty2); + SDL_FreeSurface(empty2); return screen; } diff --git a/alienblaster/project/jni/sdl b/alienblaster/project/jni/sdl index d92c7931b..73bcf85be 120000 --- a/alienblaster/project/jni/sdl +++ b/alienblaster/project/jni/sdl @@ -1 +1 @@ -../sdl/sdl-1.3 \ No newline at end of file +../sdl/sdl-1.2 \ No newline at end of file