Fixed video init
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "SDL.h"
|
||||
#include <stdlib.h>
|
||||
#include "global.h"
|
||||
#include <android/log.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -38,16 +39,21 @@ SDL_Surface *Video::init(){
|
||||
// --------------------------------------------------
|
||||
// SDL initialisation
|
||||
// -----------------------------------------------------
|
||||
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "SDL_InitSubSystem(SDL_INIT_VIDEO)");
|
||||
|
||||
fullscreen = false;
|
||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError());
|
||||
printf("Couldn't initialize SDL video subsystem: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF /* | SDL_FULLSCREEN */ );
|
||||
if (!screen) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Couldn't set %dx%d, %dbit video mode: %s\n", SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_GetError());
|
||||
printf("Couldn't set %dx%d, %dbit video mode: %s\n", SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_GetError());
|
||||
exit(2);
|
||||
}
|
||||
__android_log_print(ANDROID_LOG_INFO, "Alien Blaster", "Video initialized");
|
||||
|
||||
SDL_WM_SetCaption("AlienBlaster", "AlienBlaster");
|
||||
SDL_WM_SetIcon(SDL_LoadBMP( FN_ALIENBLASTER_ICON.c_str() ), NULL);
|
||||
|
||||
Reference in New Issue
Block a user