From 7127f6de495e5fae6ae359a11bc2c64e0b3bf7ce Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Thu, 30 Sep 2010 11:36:20 +0000
Subject: [PATCH] android fixes
---
src/sdl-instead/config.c | 10 +++++-----
src/sdl-instead/externals.h | 2 +-
src/sdl-instead/graphics.c | 4 ++++
src/sdl-instead/unix.c | 2 +-
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/sdl-instead/config.c b/src/sdl-instead/config.c
index b3b1531..8a044ea 100644
--- a/src/sdl-instead/config.c
+++ b/src/sdl-instead/config.c
@@ -2,7 +2,11 @@
#include "internals.h"
int opt_fsize = 0;
-#ifndef MAEMO
+#if defined(MAEMO) || defined(ANDROID)
+int opt_fs = 1;
+int opt_owntheme = 0;
+int opt_hl = 0;
+#else
#ifndef _WIN32_WCE
int opt_fs = 0;
int opt_owntheme = 1;
@@ -12,10 +16,6 @@ int opt_fsize = 0;
int opt_owntheme = 1;
int opt_hl = 0;
#endif
-#else
-int opt_fs = 1;
-int opt_owntheme = 0;
-int opt_hl = 0;
#endif
int opt_hz = 22050;
int opt_vol = 127;
diff --git a/src/sdl-instead/externals.h b/src/sdl-instead/externals.h
index d1d60a3..d55f5fa 100644
--- a/src/sdl-instead/externals.h
+++ b/src/sdl-instead/externals.h
@@ -18,7 +18,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c
index 550a6e9..0511e6c 100644
--- a/src/sdl-instead/graphics.c
+++ b/src/sdl-instead/graphics.c
@@ -1039,6 +1039,9 @@ int gfx_set_mode(int w, int h, int fs)
gfx_width = w;
gfx_height = h;
SDL_ShowCursor(SDL_DISABLE);
+#ifdef ANDROID
+ screen = SDL_SetVideoMode(gfx_width, gfx_height, 0, SDL_HWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+#else
#ifndef MAEMO
#ifdef __APPLE__
screen = SDL_SetVideoMode(gfx_width, gfx_height, (fs)?32:0, SDL_SWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
@@ -1053,6 +1056,7 @@ int gfx_set_mode(int w, int h, int fs)
#endif
#else
screen = SDL_SetVideoMode(gfx_width, gfx_height, 16, SDL_DOUBLEBUF | SDL_HWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+#endif
#endif
if (screen == NULL) {
fprintf(stderr, "Unable to set %dx%d video: %s\n", w, h, SDL_GetError());
diff --git a/src/sdl-instead/unix.c b/src/sdl-instead/unix.c
index b29faca..1b3bff8 100644
--- a/src/sdl-instead/unix.c
+++ b/src/sdl-instead/unix.c
@@ -5,7 +5,7 @@
#include
#include
#include
-#include
+#include
#include
#include