SDL 1.2 now works in SW mode, though it's really slow (that was Alien Blaster drawing to wrong surface)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
LibSdlVersion=1.3
|
LibSdlVersion=1.2
|
||||||
AppName="Alien Blaster"
|
AppName="Alien Blaster"
|
||||||
AppFullName=de.schwardtnet.alienblaster
|
AppFullName=de.schwardtnet.alienblaster
|
||||||
ScreenOrientation=h
|
ScreenOrientation=h
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ typedef SDL_Surface SdlCompat_AcceleratedSurface;
|
|||||||
|
|
||||||
static inline SdlCompat_AcceleratedSurface * SdlCompat_CreateAcceleratedSurface(SDL_Surface * surface)
|
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
|
#endif
|
||||||
|
|||||||
@@ -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());
|
__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);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
#if SDL_VERSION_ATLEAST(1,3,0)
|
||||||
// Dummy texture
|
// Dummy texture
|
||||||
screen2 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 );
|
screen2 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 );
|
||||||
SDL_Surface * screen3 = SDL_DisplayFormat( screen2 );
|
SDL_Surface * screen3 = SDL_DisplayFormat( screen2 );
|
||||||
@@ -62,17 +63,19 @@ SdlCompat_AcceleratedSurface *Video::init(){
|
|||||||
screen->w = SCREEN_WIDTH;
|
screen->w = SCREEN_WIDTH;
|
||||||
screen->h = SCREEN_HEIGHT;
|
screen->h = SCREEN_HEIGHT;
|
||||||
SDL_FreeSurface(screen3);
|
SDL_FreeSurface(screen3);
|
||||||
|
#else
|
||||||
|
screen = screen2;
|
||||||
|
#endif
|
||||||
SDL_WM_SetCaption("AlienBlaster", "AlienBlaster");
|
SDL_WM_SetCaption("AlienBlaster", "AlienBlaster");
|
||||||
SDL_WM_SetIcon(SDL_LoadBMP( FN_ALIENBLASTER_ICON.c_str() ), NULL);
|
SDL_WM_SetIcon(SDL_LoadBMP( FN_ALIENBLASTER_ICON.c_str() ), NULL);
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Initializing video done");
|
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Initializing video done");
|
||||||
|
|
||||||
screen3 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 );
|
SDL_Surface * empty2 = SDL_CreateRGBSurface( 0, 16, 16, 16, 0xff, 0x00ff, 0x0000ff, 0 );
|
||||||
SDL_FillRect(screen3, NULL, SDL_MapRGB(screen3->format, 0, 0, 0) );
|
SDL_FillRect(empty2, NULL, SDL_MapRGB(empty2->format, 0, 0, 0) );
|
||||||
empty = SdlCompat_CreateAcceleratedSurface(screen3);
|
empty = SdlCompat_CreateAcceleratedSurface(empty2);
|
||||||
SDL_FreeSurface(screen3);
|
SDL_FreeSurface(empty2);
|
||||||
|
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
../sdl/sdl-1.3
|
../sdl/sdl-1.2
|
||||||
Reference in New Issue
Block a user