Updated Jooleem project - it crashes with HW accel enabled somewhere in SDL code but wirks in SW mode,
so I've added some debug to SDL_androidvideo-1.2.c, and I'm planning to make test SDL project to check HW accel and alpha surfaces status.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.sourceforge.clonekeenplus"
|
||||
android:versionCode="32202"
|
||||
android:versionName="0.3.2.2.02 - on-screen joystick now acts as analog joystick, with finer control over movement"
|
||||
package="net.sourceforge.jooleem"
|
||||
android:versionCode="01404"
|
||||
android:versionName="0.1.4.04 - added HW acceleration"
|
||||
android:installLocation="preferExternal"
|
||||
>
|
||||
<application android:label="@string/app_name"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
# The namespace in Java file, with dots replaced with underscores
|
||||
SDL_JAVA_PACKAGE_PATH := net_sourceforge_clonekeenplus
|
||||
SDL_JAVA_PACKAGE_PATH := net_sourceforge_jooleem
|
||||
|
||||
# Path to shared libraries - Android 1.6 cannot load them properly, thus we have to specify absolute path here
|
||||
# SDL_SHARED_LIBRARIES_PATH := /data/data/de.schwardtnet.alienblaster/lib
|
||||
@@ -10,7 +10,7 @@ SDL_JAVA_PACKAGE_PATH := net_sourceforge_clonekeenplus
|
||||
# Typically /sdcard/alienblaster
|
||||
# Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder
|
||||
# Your application will just set current directory there
|
||||
SDL_CURDIR_PATH := net.sourceforge.clonekeenplus
|
||||
SDL_CURDIR_PATH := net.sourceforge.jooleem
|
||||
|
||||
# Android Dev Phone G1 has trackball instead of cursor keys, and
|
||||
# sends trackball movement events as rapid KeyDown/KeyUp events,
|
||||
@@ -25,17 +25,17 @@ SDL_VIDEO_RENDER_RESIZE := 1
|
||||
|
||||
SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT := 0
|
||||
|
||||
COMPILED_LIBRARIES := tremor ogg
|
||||
COMPILED_LIBRARIES := sdl_mixer sdl_image sdl_ttf
|
||||
|
||||
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2 -DTREMOR=1 -DBUILD_TYPE=LINUX32 -DTARGET_LNX=1 -Werror=strict-aliasing -Werror=cast-align -Werror=pointer-arith -Werror=address
|
||||
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2
|
||||
|
||||
APPLICATION_ADDITIONAL_LDFLAGS := -ltremor
|
||||
APPLICATION_ADDITIONAL_LDFLAGS :=
|
||||
|
||||
APPLICATION_SUBDIRS_BUILD := src/*
|
||||
APPLICATION_SUBDIRS_BUILD :=
|
||||
|
||||
APPLICATION_CUSTOM_BUILD_SCRIPT :=
|
||||
|
||||
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=LCTRL -DSDL_ANDROID_KEYCODE_1=LALT -DSDL_ANDROID_KEYCODE_2=SPACE -DSDL_ANDROID_KEYCODE_3=RETURN -DSDL_ANDROID_KEYCODE_4=RETURN
|
||||
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN
|
||||
|
||||
SDL_VERSION := 1.2
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ APP_PROJECT_PATH := $(call my-dir)/..
|
||||
|
||||
# Available libraries: mad (GPL-ed!) sdl_mixer sdl_image sdl_ttf sdl_net sdl_blitpool sdl_gfx intl xml2 lua jpeg png ogg flac tremor vorbis freetype xerces
|
||||
|
||||
APP_MODULES := application sdl-1.2 sdl_main stlport jpeg png ogg flac vorbis freetype tremor ogg
|
||||
APP_MODULES := application sdl-1.2 sdl_main stlport jpeg png ogg flac vorbis freetype sdl_mixer sdl_image sdl_ttf
|
||||
|
||||
# To filter out static libs from all libs in makefile
|
||||
APP_AVAILABLE_STATIC_LIBS := jpeg png tremor freetype xerces ogg tremor vorbis flac
|
||||
|
||||
Submodule project/jni/application/commandergenius updated: 1c79ab810d...73122a5870
@@ -1,16 +1,30 @@
|
||||
# The application settings for Android libSDL port
|
||||
AppSettingVersion=12
|
||||
LibSdlVersion=1.2
|
||||
AppName="Jooleem"
|
||||
AppFullName=net.sourceforge.jooleem
|
||||
ScreenOrientation=h
|
||||
InhibitSuspend=n
|
||||
AppDataDownloadUrl="Data files are 10 Mb|http://sourceforge.net/projects/libsdl-android/files/Jooleem/jooleem_0.1.4_data.zip/download|http://sites.google.com/site/xpelyax/Home/jooleem_0.1.4_data.zip?attredirects=0&d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/jooleem_0.1.4_data.zip"
|
||||
SdlVideoResize=y
|
||||
SdlVideoResizeKeepAspect=n
|
||||
NeedDepthBuffer=n
|
||||
AppUsesMouse=y
|
||||
AppNeedsArrowKeys=n
|
||||
AppUsesJoystick=n
|
||||
AppHandlesJoystickSensitivity=n
|
||||
AppUsesMultitouch=n
|
||||
NonBlockingSwapBuffers=n
|
||||
RedefinedKeys=""
|
||||
AppTouchscreenKeyboardKeysAmount=0
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
MultiABI=n
|
||||
AppVersionCode=01403
|
||||
AppVersionName="0.1.4.03"
|
||||
AppVersionCode=01404
|
||||
AppVersionName="0.1.4.04"
|
||||
CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
|
||||
CustomBuildScript=n
|
||||
AppCflags='-finline-functions -O2'
|
||||
AppLdflags=''
|
||||
AppSubdirsBuild=''
|
||||
AppUseCrystaXToolchain=n
|
||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||
|
||||
@@ -1 +1 @@
|
||||
commandergenius
|
||||
scummvm
|
||||
@@ -45,6 +45,9 @@
|
||||
|
||||
#define _THIS SDL_VideoDevice *this
|
||||
|
||||
#define DEBUGOUT(...)
|
||||
//#define DEBUGOUT(...) __android_log_print(ANDROID_LOG_INFO, "libSDL", __VA_ARGS__)
|
||||
|
||||
/* Initialization/Query functions */
|
||||
static int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat);
|
||||
static SDL_Rect **ANDROID_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
|
||||
@@ -259,8 +262,10 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
|
||||
current->pitch = SDL_ANDROID_sFakeWindowWidth * ANDROID_BYTESPERPIXEL;
|
||||
current->pixels = NULL;
|
||||
current->hwdata = NULL;
|
||||
|
||||
HwSurfaceCount = 0;
|
||||
HwSurfaceList = NULL;
|
||||
DEBUGOUT("ANDROID_SetVideoMode() HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
|
||||
if( ! sdl_opengl )
|
||||
{
|
||||
@@ -301,6 +306,7 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
|
||||
HwSurfaceCount++;
|
||||
HwSurfaceList = SDL_realloc( HwSurfaceList, HwSurfaceCount * sizeof(SDL_Surface *) );
|
||||
HwSurfaceList[HwSurfaceCount-1] = current;
|
||||
DEBUGOUT("ANDROID_SetVideoMode() HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,10 +339,12 @@ void ANDROID_VideoQuit(_THIS)
|
||||
{
|
||||
if( ! sdl_opengl )
|
||||
{
|
||||
DEBUGOUT("ANDROID_VideoQuit() in HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
HwSurfaceCount = 0;
|
||||
if(HwSurfaceList)
|
||||
SDL_free(HwSurfaceList);
|
||||
HwSurfaceList = NULL;
|
||||
DEBUGOUT("ANDROID_VideoQuit() out HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
|
||||
if( SDL_CurrentVideoSurface->hwdata )
|
||||
SDL_DestroyTexture((struct SDL_Texture *)SDL_CurrentVideoSurface->hwdata);
|
||||
@@ -371,12 +379,14 @@ static int ANDROID_AllocHWSurface(_THIS, SDL_Surface *surface)
|
||||
if ( ! (surface->w && surface->h) )
|
||||
return(-1);
|
||||
|
||||
DEBUGOUT("ANDROID_AllocHWSurface() surface %p w %d h %d", surface, surface->w, surface->h);
|
||||
Uint32 format = SDL_PIXELFORMAT_RGBA5551; // 1-bit alpha for color key, every surface will have colorkey so it's easier for us
|
||||
if( surface->format->Amask )
|
||||
{
|
||||
SDL_PixelFormat format1;
|
||||
int bpp;
|
||||
format = SDL_PIXELFORMAT_RGBA4444;
|
||||
DEBUGOUT("ANDROID_AllocHWSurface() SDL_PIXELFORMAT_RGBA4444");
|
||||
SDL_zero(format1);
|
||||
SDL_PixelFormatEnumToMasks( format, &bpp,
|
||||
&format1.Rmask, &format1.Gmask,
|
||||
@@ -390,6 +400,7 @@ static int ANDROID_AllocHWSurface(_THIS, SDL_Surface *surface)
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUGOUT("ANDROID_AllocHWSurface() SDL_PIXELFORMAT_RGBA5551");
|
||||
// HW-accel surface should be RGB565
|
||||
if( !( SDL_CurrentVideoSurface->format->BitsPerPixel == surface->format->BitsPerPixel &&
|
||||
SDL_CurrentVideoSurface->format->Rmask == surface->format->Rmask &&
|
||||
@@ -416,9 +427,12 @@ static int ANDROID_AllocHWSurface(_THIS, SDL_Surface *surface)
|
||||
}
|
||||
|
||||
surface->flags |= SDL_HWSURFACE | SDL_HWACCEL;
|
||||
|
||||
|
||||
HwSurfaceCount++;
|
||||
DEBUGOUT("ANDROID_AllocHWSurface() in HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
HwSurfaceList = SDL_realloc( HwSurfaceList, HwSurfaceCount * sizeof(SDL_Surface *) );
|
||||
DEBUGOUT("ANDROID_AllocHWSurface() out HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
|
||||
HwSurfaceList[HwSurfaceCount-1] = surface;
|
||||
|
||||
return 0;
|
||||
@@ -430,7 +444,10 @@ static void ANDROID_FreeHWSurface(_THIS, SDL_Surface *surface)
|
||||
if( !surface->hwdata )
|
||||
return;
|
||||
SDL_DestroyTexture((struct SDL_Texture *)surface->hwdata);
|
||||
|
||||
DEBUGOUT("ANDROID_FreeHWSurface() surface %p w %d h %d in HwSurfaceCount %d HwSurfaceList %p", surface, surface->w, surface->h, HwSurfaceCount, HwSurfaceList);
|
||||
|
||||
|
||||
for( i = 0; i < HwSurfaceCount; i++ )
|
||||
{
|
||||
if( HwSurfaceList[i] == surface )
|
||||
@@ -439,6 +456,7 @@ static void ANDROID_FreeHWSurface(_THIS, SDL_Surface *surface)
|
||||
memmove(HwSurfaceList + i, HwSurfaceList + i + 1, sizeof(SDL_Surface *) * (HwSurfaceCount - i) );
|
||||
HwSurfaceList = SDL_realloc( HwSurfaceList, HwSurfaceCount * sizeof(SDL_Surface *) );
|
||||
i = -1;
|
||||
DEBUGOUT("ANDROID_FreeHWSurface() in HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Commander Genius</string>
|
||||
<string name="app_name">Jooleem</string>
|
||||
|
||||
|
||||
<string name="init">Initializing</string>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
fixed with a hammer and rasp to work with libSDL port */
|
||||
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
class Globals {
|
||||
public static String ApplicationName = "CommanderGenius";
|
||||
public static String ApplicationName = "Jooleem";
|
||||
|
||||
// Should be zip file
|
||||
public static String DataDownloadUrl = "Data files are 2 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-data.zip/download^High-quality GFX and music - 40 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-hqp.zip/download";
|
||||
public static String DataDownloadUrl = "Data files are 10 Mb|http://sourceforge.net/projects/libsdl-android/files/Jooleem/jooleem_0.1.4_data.zip/download|http://sites.google.com/site/xpelyax/Home/jooleem_0.1.4_data.zip?attredirects=0%26d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/jooleem_0.1.4_data.zip";
|
||||
|
||||
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
|
||||
public static boolean NeedDepthBuffer = false;
|
||||
@@ -22,11 +22,11 @@ class Globals {
|
||||
// Readme text to be shown on download page
|
||||
public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n");
|
||||
|
||||
public static boolean AppUsesMouse = false;
|
||||
public static boolean AppUsesMouse = true;
|
||||
|
||||
public static boolean AppNeedsArrowKeys = true;
|
||||
public static boolean AppNeedsArrowKeys = false;
|
||||
|
||||
public static boolean AppUsesJoystick = true;
|
||||
public static boolean AppUsesJoystick = false;
|
||||
|
||||
public static boolean AppHandlesJoystickSensitivity = false;
|
||||
|
||||
@@ -34,9 +34,9 @@ class Globals {
|
||||
|
||||
public static boolean NonBlockingSwapBuffers = false;
|
||||
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 4;
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 0;
|
||||
|
||||
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
|
||||
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 0;
|
||||
|
||||
// Phone-specific config
|
||||
// It will download app data to /sdcard/alienblaster if set to true,
|
||||
@@ -56,5 +56,5 @@ class Globals {
|
||||
}
|
||||
|
||||
class LoadLibrary {
|
||||
public LoadLibrary() { System.loadLibrary("sdl-1.2"); };
|
||||
public LoadLibrary() { System.loadLibrary("sdl-1.2"); System.loadLibrary("sdl_mixer"); System.loadLibrary("sdl_image"); System.loadLibrary("sdl_ttf"); };
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
|
||||
package net.sourceforge.clonekeenplus;
|
||||
package net.sourceforge.jooleem;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user