Fixed few GFX bugs in TeeWorlds, it still crashes

This commit is contained in:
pelya
2010-09-06 13:17:43 +03:00
parent 1ef6967d7d
commit 10f1178f0b
16 changed files with 56 additions and 37 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.googlecode.opentyrian"
android:versionCode="2108"
android:versionName="2.1.08"
package="com.teeworlds"
android:versionCode="5201"
android:versionName="0.5.2.01"
android:installLocation="preferExternal"
>
<application android:label="@string/app_name"

View File

@@ -1,6 +1,6 @@
# The namespace in Java file, with dots replaced with underscores
SDL_JAVA_PACKAGE_PATH := com_googlecode_opentyrian
SDL_JAVA_PACKAGE_PATH := com_teeworlds
# 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 := com_googlecode_opentyrian
# 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 := com.googlecode.opentyrian
SDL_CURDIR_PATH := com.teeworlds
# Android Dev Phone G1 has trackball instead of cursor keys, and
# sends trackball movement events as rapid KeyDown/KeyUp events,
@@ -21,15 +21,15 @@ SDL_TRACKBALL_KEYUP_DELAY := 1
# If the application designed for higher screen resolution enable this to get the screen
# resized in HW-accelerated way, however it eats a tiny bit of CPU
SDL_VIDEO_RENDER_RESIZE := 1
SDL_VIDEO_RENDER_RESIZE := 0
COMPILED_LIBRARIES := sdl_net
COMPILED_LIBRARIES := sdl_image sdl_mixer
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2
APPLICATION_ADDITIONAL_CFLAGS := -O2 -DCONF_FAMILY_UNIX=1
APPLICATION_ADDITIONAL_LDFLAGS :=
APPLICATION_ADDITIONAL_LDFLAGS := -Lbin/ndk/local/armeabi -lfreetype
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=SPACE -DSDL_ANDROID_KEYCODE_1=RETURN -DSDL_ANDROID_KEYCODE_2=LCTRL -DSDL_ANDROID_KEYCODE_3=LALT -DSDL_ANDROID_KEYCODE_4=RETURN
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=RETURN -DSDL_ANDROID_KEYCODE_1=RSHIFT -DSDL_ANDROID_KEYCODE_2=KP_PLUS -DSDL_ANDROID_KEYCODE_3=KP_MINUS -DSDL_ANDROID_KEYCODE_4=ESCAPE -DSDL_ANDROID_KEYCODE_5=F10
# If SDL_Mixer should link to libMAD
SDL_MIXER_USE_LIBMAD :=

View File

@@ -5,6 +5,6 @@ APP_PROJECT_PATH := $(call my-dir)/..
# sdl_image depends on png and jpeg
# sdl_ttf depends on freetype
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_net
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_image sdl_mixer
APP_ABI := armeabi

View File

@@ -1 +1 @@
opentyrian
teeworlds

View File

@@ -67,6 +67,13 @@
#define CONF_PLATFORM_STRING "beos"
#endif
#if defined(ANDROID)
#define CONF_FAMILY_UNIX 1
#define CONF_FAMILY_STRING "unix"
#define CONF_PLATFORM_LINUX 1
#define CONF_PLATFORM_STRING "android"
#endif
/* architectures */
#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(CONF_PLATFORM_WIN32)
@@ -99,6 +106,18 @@
#define CONF_ARCH_ENDIAN_BIG 1
#endif
#if defined(__ARMEB__)
#define CONF_ARCH_ARM 1
#define CONF_ARCH_STRING "arm"
#define CONF_ARCH_ENDIAN_BIG 1
#endif
#if defined(__ARMEL__)
#define CONF_ARCH_ARM 1
#define CONF_ARCH_STRING "arm"
#define CONF_ARCH_ENDIAN_LITTLE 1
#endif
#ifndef CONF_FAMILY_STRING
#define CONF_FAMILY_STRING "unknown"

View File

@@ -30,6 +30,9 @@
#if defined(CONF_PLATFORM_MACOSX)
#include <Carbon/Carbon.h>
#endif
#ifdef ANDROID
#include <android/log.h>
#endif
#elif defined(CONF_FAMILY_WINDOWS)
#define WIN32_LEAN_AND_MEAN
@@ -107,6 +110,10 @@ static void logger_stdout(const char *line)
{
printf("%s\n", line);
fflush(stdout);
#ifdef ANDROID
__android_log_print(ANDROID_LOG_INFO, "Teeworlds", "%s", line);
#endif
}
static void logger_debugger(const char *line)

View File

@@ -149,18 +149,9 @@ static void flush()
#ifdef ANDROID
{
int i;
for(i = 0; i < num_vertices; i++)
for(i = 0; i < num_vertices / 4; i++)
{
glDrawArrays(GL_TRIANGLE_FAN, 0, num_vertices);
glVertexPointer(3, GL_FLOAT,
sizeof(VERTEX),
(char*)(vertices+i));
glTexCoordPointer(2, GL_FLOAT,
sizeof(VERTEX),
(char*)(vertices+i) + sizeof(float)*3);
glColorPointer(4, GL_FLOAT,
sizeof(VERTEX),
(char*)(vertices+i) + sizeof(float)*5);
glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
}
}
#else
@@ -188,7 +179,9 @@ static int try_init()
#ifdef ANDROID
config.gfx_screen_width = SDL_ListModes(NULL, SDL_OPENGL|SDL_GL_DOUBLEBUFFER|SDL_FULLSCREEN)[0]->w;
config.gfx_screen_width = SDL_ListModes(NULL, SDL_OPENGL|SDL_GL_DOUBLEBUFFER|SDL_FULLSCREEN)[0]->h;
config.gfx_screen_height = SDL_ListModes(NULL, SDL_OPENGL|SDL_GL_DOUBLEBUFFER|SDL_FULLSCREEN)[0]->h;
dbg_msg("gfx", "Physical display resolution is %dx%d", config.gfx_screen_width, config.gfx_screen_height);
#endif
screen_width = config.gfx_screen_width;

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">OpenTyrian</string>
<string name="app_name">TeeWorlds</string>
</resources>

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;
import android.content.Context;

View File

@@ -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 com.googlecode.opentyrian;
package com.teeworlds;
import java.io.Writer;
import java.util.ArrayList;

View File

@@ -1,14 +1,14 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;
import android.content.Context;
class Globals {
public static String ApplicationName = "OpenTyrian";
public static String ApplicationName = "TeeWorlds";
// Should be zip file
public static String DataDownloadUrl = "Data files size is 11 Mb|http://sites.google.com/site/xpelyax/Home/tyrian21-data.zip?attredirects=0%26d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/tyrian21-data.zip";
public static String DataDownloadUrl = "Game data is 5 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download";
// 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;
@@ -27,7 +27,7 @@ class Globals {
public static boolean AppUsesMultitouch = false;
public static int AppTouchscreenKeyboardKeysAmount = 4;
public static int AppTouchscreenKeyboardKeysAmount = 2;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
@@ -48,5 +48,5 @@ class Globals {
}
class LoadLibrary {
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_net"); };
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_image"); System.loadLibrary("sdl_mixer"); };
}

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.teeworlds;
import javax.microedition.khronos.opengles.GL10;