Get rid of the ancient Android backend

Doesn't seem to have been properly maintained since 2009
This commit is contained in:
GenericHeroGuy 2025-05-25 22:28:52 +02:00
parent eab0f94106
commit c89333a924
29 changed files with 0 additions and 1146 deletions

View file

@ -1,6 +0,0 @@
# Build both the native piece of SRB2 for Android, and the Java frontend.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SRB2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,5 +0,0 @@
#Mon Nov 09 14:38:16 EST 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

View file

@ -1,17 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := user
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := SRB2
LOCAL_CERTIFICATE := media
LOCAL_REQUIRED_MODULES := libsrb2
LOCAL_JNI_SHARED_LIBRARIES := libsrb2
include $(BUILD_PACKAGE)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.srb2"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SRB2Game"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>

View file

@ -1,13 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-4
# Indicates whether an apk should be generated for each density.
split.density=false

View file

@ -1,26 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package org.srb2;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int SoftwareRendererDisplay=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SurfaceView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/SoftwareRendererDisplay"></SurfaceView>
</LinearLayout>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, SRB2Game!</string>
<string name="app_name">SRB2</string>
</resources>

View file

@ -1,25 +0,0 @@
package org.srb2;
import org.srb2.nativecode.SRB2;
import android.graphics.Canvas;
import android.util.Log;
import android.view.SurfaceHolder;
public class GameThread extends Thread {
public static String TAG = "SRB2-GameThread";
private SurfaceHolder sh;
private SRB2 srb2;
public GameThread(SurfaceHolder h) {
super();
this.srb2 = new SRB2(h);
this.sh = h;
}
@Override
public void run() {
Log.d(TAG, "Starting thread!");
this.srb2.run();
}
}

View file

@ -1,39 +0,0 @@
package org.srb2;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.SurfaceHolder.Callback;
import android.app.Activity;
import android.os.Bundle;
public class SRB2Game extends Activity implements Callback {
public static String TAG = "SRB2-Activity";
private SurfaceView sv;
private GameThread thread;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
sv = (SurfaceView) findViewById(R.id.SoftwareRendererDisplay);
sv.getHolder().addCallback(this);
}
public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
Log.e(TAG, "Output surface changed? OHSHI-");
}
public void surfaceCreated(SurfaceHolder arg0) {
Log.d(TAG, "Output surface ready! Instantiating and starting game...");
thread = new GameThread(sv.getHolder());
thread.start();
}
public void surfaceDestroyed(SurfaceHolder arg0) {
// TODO shutdown SRB2 as cleanly as possible.
}
}

View file

@ -1,13 +0,0 @@
package org.srb2.nativecode;
import java.nio.ByteBuffer;
public class Main {
private SRB2 srb2;
public Main(SRB2 srb2) {
this.srb2 = srb2;
}
public native int main(Video v);
}

View file

@ -1,35 +0,0 @@
package org.srb2.nativecode;
import android.util.Log;
import android.view.SurfaceHolder;
/// Wraps the entire native game. This object should be wholly owned
/// by the thread it's going to run in.
public class SRB2 {
public static String TAG = "SRB2-Wrapper";
private Main main;
public Video video;
public SRB2(SurfaceHolder videoOut) {
try {
Log.i(TAG, "Loading native SRB2 shared object from package...");
System.load("/data/data/org.srb2/lib/libsrb2.so");
} catch (UnsatisfiedLinkError ule) {
Log.i(TAG, "... it doesn't appear to be installed in the package. Looking for native library in the global search path.");
try {
System.load("libsrb2.so");
} catch (UnsatisfiedLinkError ule2) {
Log.e("JNI", "... no luck. Could not load libsrb2.so!");
return;
}
}
this.video = new Video(this, videoOut);
this.main = new Main(this);
}
public void run() {
this.main.main(this.video);
}
}

View file

@ -1,39 +0,0 @@
package org.srb2.nativecode;
import java.nio.ByteBuffer;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.SurfaceHolder;
public class Video {
public static int width = 340;
public static int height = 240;
private SurfaceHolder sh;
public ByteBuffer fb;
public Bitmap bmp;
public Video(SRB2 srb2, SurfaceHolder sh) {
this.sh = sh;
fb = ByteBuffer.allocateDirect(fbSize());
bmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
}
private int fbSize() {
// naively assuming RGBA8888 now, even though that is entirely wrong.
// ... well, at least, that's what the Canvas/Bitmap will expect.
return width * height * 4;
}
public void gotFrame() {
Canvas canvas = sh.lockCanvas();
canvas.drawARGB(0xff, 0, 0, 0);
// ugh, an extra copy. the only way to avoid this, I suppose,
// is to use the surface in native code directly.
bmp.copyPixelsFromBuffer(fb);
canvas.drawBitmap(bmp, 0, 0, null);
sh.unlockCanvasAndPost(canvas);
}
}

View file

@ -1,90 +0,0 @@
LOCAL_PATH := $(call my-dir)
srb_module_tags := eng user
include $(CLEAR_VARS)
LOCAL_SRC_FILES := am_map.c \
command.c \
comptime.c \
console.c \
d_clisrv.c \
d_main.c \
d_net.c \
d_netcmd.c \
d_netfil.c \
dehacked.c \
f_finale.c \
f_wipe.c \
filesrch.c \
g_game.c \
g_input.c \
hu_stuff.c \
i_tcp.c \
info.c \
lzf.c \
m_argv.c \
m_bbox.c \
m_cheat.c \
m_fixed.c \
m_menu.c \
m_misc.c \
m_queue.c \
m_random.c \
md5.c \
mserv.c \
p_ceilng.c \
p_enemy.c \
p_fab.c \
p_floor.c \
p_inter.c \
p_lights.c \
p_map.c \
p_maputl.c \
p_mobj.c \
p_polyobj.c \
p_saveg.c \
p_setup.c \
p_sight.c \
p_spec.c \
p_telept.c \
p_tick.c \
p_user.c \
r_bsp.c \
r_data.c \
r_draw.c \
r_main.c \
r_plane.c \
r_segs.c \
r_sky.c \
r_splats.c \
r_things.c \
s_sound.c \
screen.c \
sounds.c \
st_stuff.c \
string.c \
tables.c \
v_video.c \
w_wad.c \
y_inter.c \
z_zone.c \
android/i_cdmus.c \
android/i_main.c \
android/i_net.c \
android/i_sound.c \
android/i_system.c \
android/i_video.c
LOCAL_CFLAGS += -DPLATFORM_ANDROID -DNONX86 -DLINUX -DDEBUGMODE -DNOPIX -DUNIXCOMMON -DNOTERMIOS
LOCAL_MODULE := libsrb2
# we live in an APK, so no prelink for us!
LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES += liblog libdl
LOCAL_CFLAGS += -Idalvik/libnativehelper/include/nativehelper
include $(BUILD_SHARED_LIBRARY)

View file

@ -1,43 +0,0 @@
SRB2 for Google Android!
SYNOPSIS
Port of SRB2 to Android, tested against version 1.6 (donut).
I did this with a full Android tree, rather than the NDK thing.
BUILDING
Assuming a pretty standard Android tree, at $REPO, and the SRB2
tree at $REPO/packages/apps/srb2 (that is, the *whole* SRB2
tree, not just this android/ directory):
cd $REPO
source build/envsetup.sh # this gives us the mm command,
# which is useful for selectively
# building only one component.
cd packages/apps/srb2
mm
An APK is dumped out at (or similar):
out/target/product/generic/system/app/SRB2.apk
Naturally, an SRB2 APK is architecture specific. Since most
Android devices are currently ARMEL, this is pretty okay.
NB. It appears that the Java app (the thing that becomes the APK)
is *not* rebuilt if changes are only made to libsrb2. Grr.
REGENERATION OF JNI HEADERS
Whenever the Java classes in org.srb2.nativecode change,
the C header files that describe the JNI interface to them
need to be regnererated. Make sure you have the project
built (so that the jar files are up to date), and then:
cd $REPO/out/target/common/obj/APPS/SRB2_intermediates
javah -classpath classes.jar -o $REPO/packages/apps/srb2/src/android/jni_main.h org.srb2.nativecode.Main
# ... and no, I don't know how to mash all that into the
# Android.mk build system...

View file

@ -1,37 +0,0 @@
#include "../command.h"
#include "../s_sound.h"
#include "../i_sound.h"
//
// CD MUSIC I/O
//
UINT8 cdaudio_started = 0;
consvar_t cd_volume = CVAR_INIT ("cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL);
consvar_t cdUpdate = CVAR_INIT ("cd_update","1",CV_SAVE, NULL, NULL);
void I_InitCD(void){}
void I_StopCD(void){}
void I_PauseCD(void){}
void I_ResumeCD(void){}
void I_ShutdownCD(void){}
void I_UpdateCD(void){}
void I_PlayCD(UINT8 track, UINT8 looping)
{
(void)track;
(void)looping;
}
boolean I_SetVolumeCD(INT32 volume)
{
(void)volume;
return false;
}

View file

@ -1,53 +0,0 @@
#define LOG_TAG "SRB2-main"
#include "utils/Log.h"
#include "../doomdef.h"
#include "../d_main.h"
#include "../m_argv.h"
#include "i_video.h"
#include "jni_main.h"
int srb2_main()
{
// startup SRB2
CONS_Printf ("Setting up SRB2Kart (fo' real)...");
D_SRB2Main();
CONS_Printf ("Entering main game loop...");
// never return
D_SRB2Loop();
LOGD("Control left SRB2Kart. Good bye.");
// return to OS
return 0;
}
JNIEXPORT jint JNICALL Java_org_srb2_nativecode_Main_main
(JNIEnv * env, jobject self, jobject video) {
jobject fbBuf;
jfieldID fbBufField;
// a global reference to JNI Env, so my callbacks can use it:
jni_env = env;
androidVideo = video;
jclass videoClass = (*env)->FindClass(env, "org/srb2/nativecode/Video");
if(videoClass == NULL) {
LOGE("Could not find Video class from JNI!");
return -1;
}
fbBufField = (*env)->GetFieldID(env, videoClass, "fb", "Ljava/nio/ByteBuffer;");
fbBuf = (*env)->GetObjectField(env, video, fbBufField);
if(fbBuf == NULL) {
LOGE("Couldn't get Video object from JNI!");
return -1;
}
videoFrameCB = (*env)->GetMethodID(env, videoClass, "gotFrame", "()V");
if(videoFrameCB == NULL) {
LOGE("Couldn't get method ID of Video#gotFrame() callback!");
return -1;
}
android_surface = (UINT8*) (*env)->GetDirectBufferAddress(env, fbBuf);
return srb2_main();
}

View file

@ -1,6 +0,0 @@
#include "../i_net.h"
boolean I_InitNetwork(void)
{
return false;
}

View file

@ -1,214 +0,0 @@
#include "../i_sound.h"
UINT8 sound_started = 0;
void *I_GetSfx(sfxinfo_t *sfx)
{
(void)sfx;
return NULL;
}
void I_FreeSfx(sfxinfo_t *sfx)
{
(void)sfx;
}
void I_StartupSound(void){}
void I_ShutdownSound(void){}
//
// SFX I/O
//
INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel)
{
(void)id;
(void)vol;
(void)sep;
(void)pitch;
(void)priority;
(void)channel;
return -1;
}
void I_StopSound(INT32 handle)
{
(void)handle;
}
INT32 I_SoundIsPlaying(INT32 handle)
{
(void)handle;
return false;
}
void I_UpdateSoundParams(INT32 handle, INT32 vol, INT32 sep, INT32 pitch)
{
(void)handle;
(void)vol;
(void)sep;
(void)pitch;
}
void I_SetSfxVolume(INT32 volume)
{
(void)volume;
}
/// ------------------------
// MUSIC SYSTEM
/// ------------------------
UINT8 music_started = 0;
UINT8 digmusic_started = 0;
void I_InitMusic(void){}
void I_ShutdownMusic(void){}
/// ------------------------
// MUSIC PROPERTIES
/// ------------------------
musictype_t I_SongType(void)
{
return MU_NONE;
}
boolean I_SongPlaying(void)
{
return false;
}
boolean I_SongPaused(void)
{
return false;
}
/// ------------------------
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
{
(void)speed;
return false;
}
/// ------------------------
// MUSIC SEEKING
/// ------------------------
UINT32 I_GetSongLength(void)
{
return 0;
}
boolean I_SetSongLoopPoint(UINT32 looppoint)
{
(void)looppoint;
return false;
}
UINT32 I_GetSongLoopPoint(void)
{
return 0;
}
boolean I_SetSongPosition(UINT32 position)
{
(void)position;
return false;
}
UINT32 I_GetSongPosition(void)
{
return 0;
}
/// ------------------------
// MUSIC PLAYBACK
/// ------------------------
UINT8 midimusic_started = 0;
boolean I_LoadSong(char *data, size_t len)
{
(void)data;
(void)len;
return -1;
}
void I_UnloadSong()
{
}
boolean I_PlaySong(boolean looping)
{
(void)handle;
(void)looping;
return false;
}
void I_StopSong(void)
{
(void)handle;
}
void I_PauseSong(void)
{
(void)handle;
}
void I_ResumeSong(void)
{
(void)handle;
}
void I_SetMusicVolume(INT32 volume)
{
(void)volume;
}
/// ------------------------
// MUSIC FADING
/// ------------------------
void I_SetInternalMusicVolume(UINT8 volume)
{
(void)volume;
}
void I_StopFadingSong(void)
{
}
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void));
{
(void)target_volume;
(void)source_volume;
(void)ms;
return false;
}
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void));
{
(void)target_volume;
(void)ms;
return false;
}
boolean I_FadeOutStopSong(UINT32 ms)
{
(void)ms;
return false;
}
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
{
(void)ms;
(void)looping;
return false;
}

View file

@ -1,276 +0,0 @@
#define LOG_TAG "SRB2"
#include "../doomdef.h"
#include "../i_system.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <utils/Log.h>
#define MEMINFO_FILE "/proc/meminfo"
#define MEMTOTAL "MemTotal:"
#define MEMFREE "MemFree:"
UINT8 graphics_started = 0;
UINT8 keyboard_started = 0;
static INT64 start_time; // as microseconds since the epoch
// I should probably return how much memory is remaining
// for this process, considering Android's process memory limit.
UINT32 I_GetFreeMem(UINT32 *total)
{
// what the heck? sysinfo() is partially missing in bionic?
/* struct sysinfo si; */
/* if(sysinfo(&si) != 0) { */
/* I_Error("Couldn't invoke sysinfo()...?"); */
/* } */
/* return si.freeram; */
char buf[1024];
char *memTag;
UINT32 freeKBytes;
UINT32 totalKBytes;
INT32 n;
INT32 meminfo_fd = -1;
meminfo_fd = open(MEMINFO_FILE, O_RDONLY);
n = read(meminfo_fd, buf, 1023);
close(meminfo_fd);
if (n < 0)
{
// Error
*total = 0L;
return 0;
}
buf[n] = '\0';
if (NULL == (memTag = strstr(buf, MEMTOTAL)))
{
// Error
*total = 0L;
return 0;
}
memTag += sizeof (MEMTOTAL);
totalKBytes = atoi(memTag);
if (NULL == (memTag = strstr(buf, MEMFREE)))
{
// Error
*total = 0L;
return 0;
}
memTag += sizeof (MEMFREE);
freeKBytes = atoi(memTag);
if (total)
*total = totalKBytes << 10;
return freeKBytes << 10;
}
INT64 current_time_in_ps() {
struct timeval t;
gettimeofday(&t, NULL);
return (t.tv_sec * (INT64)1000000) + t.tv_usec;
}
void I_Sleep(UINT32 ms){}
precise_t I_GetPreciseTime(void)
{
return 0;
}
UINT64 I_GetPrecisePrecision(void)
{
return 1000000;
}
void I_GetEvent(void){}
void I_OsPolling(void){}
ticcmd_t *I_BaseTiccmd(void)
{
return NULL;
}
ticcmd_t *I_BaseTiccmd2(void)
{
return NULL;
}
void I_Quit(void)
{
LOGD("SRB2Kart quitting!");
exit(0);
}
void I_Error(const char *error, ...)
{
va_list argptr;
char logbuf[8192];
va_start(argptr, error);
vsprintf(logbuf, error, argptr);
va_end(argptr);
LOGE(logbuf);
exit(-1);
}
void I_Tactile(FFType Type, const JoyFF_t *Effect)
{
(void)Type;
(void)Effect;
}
void I_Tactile2(FFType Type, const JoyFF_t *Effect)
{
(void)Type;
(void)Effect;
}
void I_JoyScale(void){}
void I_JoyScale2(void){}
void I_InitJoystick(void){}
void I_InitJoystick2(void){}
INT32 I_NumJoys(void)
{
return 0;
}
const char *I_GetJoyName(INT32 joyindex)
{
(void)joyindex;
return NULL;
}
void I_SetupMumble(void)
{
}
#ifndef NOMUMBLE
void I_UpdateMumble(const mobj_t *mobj, const listener_t listener)
{
(void)mobj;
(void)listener;
}
#endif
void I_OutputMsg(const char *fmt, ...)
{
va_list argptr;
char logbuf[8192];
va_start(argptr, fmt);
vsprintf(logbuf, fmt, argptr);
va_end(argptr);
LOGD(logbuf);
}
void I_StartupMouse(void){}
void I_StartupMouse2(void){}
void I_StartupKeyboard(void){}
INT32 I_GetKey(void)
{
return 0;
}
void I_StartupTimer(void) {
struct timeval t;
gettimeofday(&t, NULL);
start_time = (t.tv_sec * 1000000) + t.tv_usec;
}
void I_AddExitFunc(void (*func)())
{
(void)func;
}
void I_RemoveExitFunc(void (*func)())
{
(void)func;
}
INT32 I_StartupSystem(void)
{
return -1;
}
void I_ShutdownSystem(void){}
void I_GetDiskFreeSpace(INT64* freespace)
{
*freespace = 0;
}
char *I_GetUserName(void)
{
return "Android";
}
INT32 I_mkdir(const char *dirname, INT32 unixright)
{
(void)dirname;
(void)unixright;
return -1;
}
const char *I_LocateWad(void)
{
return "/sdcard/srb2";
}
void I_GetJoystickEvents(void){}
void I_GetJoystick2Events(void){}
void I_GetMouseEvents(void){}
void I_UpdateMouseGrab(void){}
char *I_GetEnv(const char *name)
{
LOGW("I_GetEnv() called?!");
(void)name;
return NULL;
}
INT32 I_PutEnv(char *variable)
{
(void)variable;
return -1;
}
INT32 I_ClipboardCopy(const char *data, size_t size)
{
(void)data;
(void)size;
return -1;
}
char *I_ClipboardPaste(void)
{
return NULL;
}
void I_RegisterSysCommands(void) {}
#include "../sdl/dosstr.c"

View file

@ -1,92 +0,0 @@
#include "../doomdef.h"
#include "../command.h"
#include "../i_video.h"
#include "../v_video.h"
#include "../screen.h"
#include "i_video.h"
#include "utils/Log.h"
rendermode_t rendermode = render_soft;
rendermode_t chosenrendermode = render_none;
boolean highcolor = false;
boolean allow_fullscreen = false;
consvar_t cv_vidwait = CVAR_INIT ("vid_wait", "On", CV_SAVE, CV_OnOff, NULL);
void I_StartupGraphics(void){}
void I_ShutdownGraphics(void){}
void VID_StartupOpenGL(void){}
void I_SetPalette(RGBA_t *palette)
{
(void)palette;
}
INT32 VID_NumModes(void)
{
return 1;
}
INT32 VID_GetModeForSize(INT32 w, INT32 h)
{
(void)w;
(void)h;
return 0;
}
void VID_PrepareModeList(void){}
INT32 VID_SetMode(INT32 modenum)
{
vid.modenum = 0;
vid.width = 320;
vid.height = 240;
vid.bpp = 1;
vid.buffer = android_surface;
return 0;
}
boolean VID_CheckRenderer(void)
{
return false;
}
void VID_CheckGLLoaded(rendermode_t oldrender)
{
(void)oldrender;
}
const char *VID_GetModeName(INT32 modenum)
{
return "A320x240";
}
void I_UpdateNoBlit(void){}
void I_FinishUpdate(void) {
LOGD("FRAME!");
(*jni_env)->CallVoidMethod(jni_env, androidVideo, videoFrameCB);
}
void I_UpdateNoVsync(void) {}
void I_WaitVBL(INT32 count)
{
(void)count;
}
void I_ReadScreen(UINT8 *scr)
{
(void)scr;
}
void I_BeginRead(void){}
void I_EndRead(void){}

View file

@ -1,20 +0,0 @@
#ifndef _SRB2_ANDROID_VIDEO_
#define _SRB2_ANDROID_VIDEO_
#include <jni.h>
#ifdef __cplusplus
extern "C" {
#endif
UINT8 *android_surface;
JNIEnv* jni_env;
jobject androidVideo;
jmethodID videoFrameCB;
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View file

@ -1,21 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_srb2_nativecode_Main */
#ifndef _Included_org_srb2_nativecode_Main
#define _Included_org_srb2_nativecode_Main
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_srb2_nativecode_Main
* Method: main
* Signature: (Lorg/srb2/nativecode/Video;)I
*/
JNIEXPORT jint JNICALL Java_org_srb2_nativecode_Main_main
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1920,10 +1920,6 @@ const char *D_Home(void)
{
const char *userhome = NULL;
#ifdef ANDROID
return "/data/data/org.srb2/";
#endif
if (M_CheckParm("-home") && M_IsNextParm())
userhome = M_GetNextParm();
else