From 877004dbdd967d2f57d494b1aaa1cb55aae0fd52 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 21:14:19 +0200 Subject: BACKENDS: Adapt various backends code to set up Surface::format correctly. Note that this change is not tested at all (not even compile wise!). --- backends/platform/android/gfx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/android/gfx.cpp') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 86232030ff..fae428d29f 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -628,13 +628,13 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) { GLTHREADCHECK; const Graphics::Surface *surface = _overlay_texture->surface_const(); - assert(surface->bytesPerPixel == sizeof(buf[0])); + assert(surface->format.bytesPerPixel == sizeof(buf[0])); const byte *src = (const byte *)surface->pixels; uint h = surface->h; do { - memcpy(buf, src, surface->w * surface->bytesPerPixel); + memcpy(buf, src, surface->w * surface->format.bytesPerPixel); src += surface->pitch; // This 'pitch' is pixels not bytes buf += pitch; -- cgit v1.2.3 From a50c36d1381be2e7d0748a2c734e41357fd4920f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 3 May 2011 14:29:01 +0200 Subject: ANDROID: Fix various forbidden symbol clashes --- backends/platform/android/gfx.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'backends/platform/android/gfx.cpp') diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index fae428d29f..ebce58e291 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -25,6 +25,23 @@ #if defined(__ANDROID__) +// Allow use of stuff in +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h + +// Disable printf override in common/forbidden.h to avoid +// clashes with log.h from the Android SDK. +// That header file uses +// __attribute__ ((format(printf, 3, 4))) +// which gets messed up by our override mechanism; this could +// be avoided by either changing the Android SDK to use the equally +// legal and valid +// __attribute__ ((format(printf, 3, 4))) +// or by refining our printf override to use a varadic macro +// (which then wouldn't be portable, though). +// Anyway, for now we just disable the printf override globally +// for the Android port +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "common/endian.h" #include "graphics/conversion.h" -- cgit v1.2.3