mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-04-22 23:11:02 +00:00
Now building..
but obviously won't run
This commit is contained in:
parent
15880317b4
commit
8ec8eb9adb
10 changed files with 42 additions and 87 deletions
|
@ -907,7 +907,7 @@ void RenderFrame( ovrRenderer * renderer, const ovrJava * java,
|
|||
{
|
||||
//if we are now shutting down, drop out here
|
||||
//TODO
|
||||
if (true)//isHostAlive()) {
|
||||
if (qtrue)//isHostAlive()) {
|
||||
{
|
||||
int time;
|
||||
|
||||
|
@ -917,7 +917,7 @@ void RenderFrame( ovrRenderer * renderer, const ovrJava * java,
|
|||
time = global_time - oldtime;
|
||||
} while (time < 1);
|
||||
|
||||
Qcommon_BeginFrame (time * 1000);
|
||||
// RTCW_BeginFrame (time * 1000);
|
||||
|
||||
// Render the eye images.
|
||||
for (int eye = 0; eye < renderer->NumBuffers && isHostAlive(); eye++) {
|
||||
|
@ -939,7 +939,7 @@ void RenderFrame( ovrRenderer * renderer, const ovrJava * java,
|
|||
GL(glDisable(GL_SCISSOR_TEST));
|
||||
|
||||
//Now do the drawing for this eye (or draw for left eye twice if using screen layer)
|
||||
Qcommon_Frame(useScreenLayer() ? 0 : eye);
|
||||
// RTCW_Frame(useScreenLayer() ? 0 : eye);
|
||||
}
|
||||
|
||||
//Clear edge to prevent smearing
|
||||
|
@ -948,7 +948,7 @@ void RenderFrame( ovrRenderer * renderer, const ovrJava * java,
|
|||
ovrFramebuffer_Advance(frameBuffer);
|
||||
}
|
||||
|
||||
Qcommon_EndFrame(time * 1000);
|
||||
// RTCW_EndFrame(time * 1000);
|
||||
|
||||
oldtime = global_time;
|
||||
}
|
||||
|
@ -1447,18 +1447,18 @@ void * AppThreadFunction( void * parm )
|
|||
if (argc != 0)
|
||||
{
|
||||
//TODO
|
||||
RTCW_Init(argc, (const char**)argv);
|
||||
// RTCW_Init(argc, (const char**)argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
int argc = 1; char *argv[] = { "rtcw" };
|
||||
|
||||
RTCW_Init(argc, (const char**)argv);
|
||||
// RTCW_Init(argc, (const char**)argv);
|
||||
}
|
||||
|
||||
FS_AddDirToSearchPath("/sdcard/RTCWQuest", true);
|
||||
// FS_AddDirToSearchPath("/sdcard/RTCWQuest", true);
|
||||
|
||||
rtcw_initialised = true;
|
||||
rtcw_initialised = qtrue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1466,13 +1466,13 @@ void * AppThreadFunction( void * parm )
|
|||
{
|
||||
//If we get here, then user has opted not to quit
|
||||
//jni_resumeAudio();
|
||||
appState.Resumed = true;
|
||||
appState.Resumed = qtrue;
|
||||
break;
|
||||
}
|
||||
case MESSAGE_ON_PAUSE:
|
||||
{
|
||||
//jni_pauseAudio();
|
||||
appState.Resumed = false;
|
||||
appState.Resumed = qfalse;
|
||||
break;
|
||||
}
|
||||
case MESSAGE_ON_STOP:
|
||||
|
|
|
@ -22,7 +22,7 @@ void handleTrackedControllerButton(ovrInputStateTrackedRemote * trackedRemoteSta
|
|||
{
|
||||
if ((trackedRemoteState->Buttons & button) != (prevTrackedRemoteState->Buttons & button))
|
||||
{
|
||||
Key_Event(key, (trackedRemoteState->Buttons & button) != 0, global_time);
|
||||
// Key_Event(key, (trackedRemoteState->Buttons & button) != 0, global_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ LOCAL_C_INCLUDES = $(LOCAL_PATH) \
|
|||
|
||||
|
||||
ANDROID_SRC = \
|
||||
code/android/ifaddrs.c \
|
||||
# code/android/android-jni.cpp \
|
||||
# code/android/in_android.c \
|
||||
code/android/ifaddrs.c \
|
||||
|
||||
SPLINES_FILES = \
|
||||
src/splines/math_angles.cpp \
|
||||
|
@ -184,17 +184,17 @@ SERVER_FILES = \
|
|||
src/qcommon/vm_none.c \
|
||||
|
||||
UNIX_FILES = \
|
||||
# src/android/android_main.c \
|
||||
src/unix/unix_net.c \
|
||||
src/unix/unix_shared.c \
|
||||
src/unix/linux_common.c\
|
||||
src/unix/linux_qgl.c \
|
||||
src/android/android_glimp.c \
|
||||
src/android/android_snd.c \
|
||||
src/game/q_shared.c \
|
||||
src/game/q_math.c \
|
||||
src/android/android_main.c
|
||||
# src/android/android-jni.cpp \
|
||||
# src/android/in_android.c \
|
||||
src/game/q_shared.c \
|
||||
src/game/q_math.c
|
||||
|
||||
|
||||
RTCWVR_SRC_FILES := ../RTCWVR/RTCWVR_SurfaceView.c \
|
||||
|
@ -208,12 +208,12 @@ RTCWVR_SRC_FILES := ../RTCWVR/RTCWVR_SurfaceView.c \
|
|||
|
||||
LOCAL_SRC_FILES = $(UNIX_FILES) $(RENDERER_FILES) $(SPLINES_FILES) $(BOTLIB_FILES) $(JPEGLIB_FILES) $(CLIENT_FILES) $(COMMON_FILES) $(SOUND_FILES) $(SERVER_FILES) $(VM_FILES) $(RTCWVR_SRC_FILES)
|
||||
|
||||
LOCAL_LDLIBS := -lGLESv3 -lEGL -ldl -llog -lOpenSLES -lz -lm
|
||||
LOCAL_LDLIBS := -lGLESv3 -landroid -lEGL -ldl -llog -lOpenSLES -lz -lm
|
||||
|
||||
LOCAL_LDLIBS += -fuse-ld=bfd
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libjpeg libpng
|
||||
LOCAL_SHARED_LIBRARIES := vrapi qagamearm gl4es cgamearm uiarm
|
||||
LOCAL_SHARED_LIBRARIES := vrapi qagamearm gl4es cgamearm
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
|
|
@ -247,9 +247,7 @@ static qboolean GLW_StartDriverAndSetMode( const char *drivername,
|
|||
}
|
||||
|
||||
|
||||
extern int android_screen_width;
|
||||
extern int android_screen_height;
|
||||
|
||||
void Android_GetScreenRes(int *width, int *height);
|
||||
|
||||
/*
|
||||
** GLW_InitExtensions
|
||||
|
@ -478,7 +476,9 @@ void GLimp_Init( void ) {
|
|||
ri.Cvar_Set( "r_glDriver", r_previousglDriver->string );
|
||||
}
|
||||
|
||||
|
||||
int android_screen_width;
|
||||
int android_screen_height;
|
||||
Android_GetScreenRes(&android_screen_width, &android_screen_height);
|
||||
glConfig.vidWidth = android_screen_width;
|
||||
glConfig.vidHeight = android_screen_height;
|
||||
glConfig.colorBits = 32;
|
||||
|
|
|
@ -442,7 +442,7 @@ void Sys_ConsoleInputInit() {
|
|||
characters EOF, EOL, EOL2, ERASE, KILL, REPRINT,
|
||||
STATUS, and WERASE, and buffers by lines.
|
||||
ISIG: when any of the characters INTR, QUIT, SUSP, or
|
||||
DSUSP are received, generate the corresponding sig
|
||||
DSUSP are received, generate the corresponding sig<EFBFBD>
|
||||
nal
|
||||
*/
|
||||
tc.c_lflag &= ~( ECHO | ICANON );
|
||||
|
@ -700,53 +700,17 @@ void *Sys_LoadDll( const char *name,
|
|||
|
||||
#ifdef __ANDROID__
|
||||
char path[500];
|
||||
char *libdir = (char*)getenv("YQUAKE2_GAMELIBDIR");
|
||||
|
||||
#ifdef WOLF_SP_DEMO
|
||||
snprintf( path, sizeof( path ), "%s/lib%sarm_d.so", getLibPath(), name );
|
||||
#else
|
||||
snprintf( path, sizeof( path ), "%s/lib%sarm.so", getLibPath(), name );
|
||||
snprintf( path, sizeof( path ), "%s/lib%sarm.so", libdir, name );
|
||||
#endif
|
||||
|
||||
LOGI("Trying to load Android lib: %s",path);
|
||||
libHandle = dlopen (path, RTLD_LAZY );
|
||||
|
||||
if (!libHandle) //Some devices put an extra 1 on the end!!!
|
||||
{
|
||||
LOGI("TRYING -0 LIBRARY");
|
||||
#ifdef WOLF_SP_DEMO
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw/lib/lib%sarm_d.so", name );
|
||||
#else
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw/lib/lib%sarm.so", name );
|
||||
#endif
|
||||
|
||||
|
||||
libHandle = dlopen (path, Q_RTLD );
|
||||
}
|
||||
|
||||
if (!libHandle) //Some devices put an extra 1 on the end!!!
|
||||
{
|
||||
LOGI("TRYING -1 LIBRARY");
|
||||
#ifdef WOLF_SP_DEMO
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw-1/lib/lib%sarm_d.so", name );
|
||||
#else
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw-1/lib/lib%sarm.so", name );
|
||||
#endif
|
||||
libHandle = dlopen (path, Q_RTLD );
|
||||
|
||||
}
|
||||
|
||||
if (!libHandle) //Just in case...
|
||||
{
|
||||
LOGI("TRYING -2 LIBRARY");
|
||||
#ifdef WOLF_SP_DEMO
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw-2/lib/lib%sarm_d.so", name );
|
||||
#else
|
||||
snprintf( path, sizeof( path ), "/data/data/com.beloko.rtcw-2/lib/lib%sarm.so", name );
|
||||
#endif
|
||||
libHandle = dlopen (path, Q_RTLD );
|
||||
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
// bk001129 - from cvs1.17 (mkv), was fname not fn
|
||||
|
@ -1147,7 +1111,7 @@ sysEvent_t Sys_GetEvent( void ) {
|
|||
}
|
||||
*/
|
||||
// check for other input devices
|
||||
IN_Frame();
|
||||
//IN_Frame();
|
||||
|
||||
// check for network packets
|
||||
MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) );
|
||||
|
|
|
@ -792,7 +792,10 @@ usercmd_t CL_CreateCmd( void ) {
|
|||
CL_JoystickMove( &cmd );
|
||||
|
||||
#ifdef __ANDROID__
|
||||
CL_AndroidMove ( &cmd );
|
||||
|
||||
//NEED TO DO OUR OWN THING HERE
|
||||
|
||||
// CL_AndroidMove ( &cmd );
|
||||
#endif
|
||||
|
||||
// check to make sure the angles haven't wrapped
|
||||
|
|
|
@ -1163,7 +1163,7 @@ int CL_UISystemCalls( int *args ) {
|
|||
return CL_GetLimboString( args[1], VMA( 2 ) );
|
||||
// -NERVE - SMF
|
||||
case UI_CIN_SHOWSOFTKEYBOARD:
|
||||
showKeyboard(args[1]);
|
||||
// showKeyboard(args[1]);
|
||||
return 0;
|
||||
default:
|
||||
Com_Error( ERR_DROP, "Bad UI system trap: %i", args[0] );
|
||||
|
|
|
@ -524,7 +524,7 @@ __inline void Matrix4Multiply( const vec4_t a[4], const vec4_t b[4], vec4_t dst[
|
|||
|
||||
// TTimo: const vec_t ** would require explicit casts for ANSI C conformance
|
||||
// see unix/const-arg.c in Wolf MP source
|
||||
__inline void Matrix4MultiplyInto3x3AndTranslation( /*const*/ vec4_t a[4], /*const*/ vec4_t b[4], vec3_t dst[3], vec3_t t ) {
|
||||
void Matrix4MultiplyInto3x3AndTranslation( /*const*/ vec4_t a[4], /*const*/ vec4_t b[4], vec3_t dst[3], vec3_t t ) {
|
||||
dst[0][0] = a[0][0] * b[0][0] + a[0][1] * b[1][0] + a[0][2] * b[2][0] + a[0][3] * b[3][0];
|
||||
dst[0][1] = a[0][0] * b[0][1] + a[0][1] * b[1][1] + a[0][2] * b[2][1] + a[0][3] * b[3][1];
|
||||
dst[0][2] = a[0][0] * b[0][2] + a[0][1] * b[1][2] + a[0][2] * b[2][2] + a[0][3] * b[3][2];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package com.drbeef.quake2quest;
|
||||
package com.drbeef.rtcwquest;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
@ -41,10 +41,10 @@ import static android.system.Os.setenv;
|
|||
// Load the gles3jni library right away to make sure JNI_OnLoad() gets called as the very first thing.
|
||||
static
|
||||
{
|
||||
System.loadLibrary( "yquake2" );
|
||||
System.loadLibrary( "rtcw_client" );
|
||||
}
|
||||
|
||||
private static final String TAG = "Quake2Quest";
|
||||
private static final String TAG = "RTCWQuest";
|
||||
|
||||
private int permissionCount = 0;
|
||||
private static final int READ_EXTERNAL_STORAGE_PERMISSION_ID = 1;
|
||||
|
@ -161,32 +161,20 @@ import static android.system.Os.setenv;
|
|||
|
||||
public void create()
|
||||
{
|
||||
//This will copy the shareware version of quake2 if user doesn't have anything installed
|
||||
copy_asset("/sdcard/Quake2Quest", "pak0.pak");
|
||||
|
||||
//HD Textures
|
||||
copy_asset("/sdcard/Quake2Quest", "pak6.pak");
|
||||
|
||||
//Custom weapons
|
||||
copy_asset("/sdcard/Quake2Quest", "pak99.pak");
|
||||
|
||||
//Configuration files
|
||||
copy_asset("/sdcard/Quake2Quest", "config.cfg");
|
||||
copy_asset("/sdcard/Quake2Quest", "autoexec.cfg");
|
||||
copy_asset("/sdcard/Quake2Quest", "commandline.txt");
|
||||
|
||||
//Comfort Vignette Mask
|
||||
copy_asset("/sdcard/Quake2Quest", "vignette.tga");
|
||||
copy_asset("/sdcard/RTCWQuest", "config.cfg");
|
||||
copy_asset("/sdcard/RTCWQuest", "autoexec.cfg");
|
||||
copy_asset("/sdcard/RTCWQuest", "commandline.txt");
|
||||
|
||||
//Read these from a file and pass through
|
||||
commandLineParams = new String("quake2");
|
||||
commandLineParams = new String("rtcw");
|
||||
|
||||
//See if user is trying to use command line params
|
||||
if(new File("/sdcard/Quake2Quest/commandline.txt").exists()) // should exist!
|
||||
if(new File("/sdcard/RTCWQuest/commandline.txt").exists()) // should exist!
|
||||
{
|
||||
BufferedReader br;
|
||||
try {
|
||||
br = new BufferedReader(new FileReader("/sdcard/Quake2Quest/commandline.txt"));
|
||||
br = new BufferedReader(new FileReader("/sdcard/RTCWQuest/commandline.txt"));
|
||||
String s;
|
||||
StringBuilder sb=new StringBuilder(0);
|
||||
while ((s=br.readLine())!=null)
|
||||
|
@ -204,7 +192,7 @@ import static android.system.Os.setenv;
|
|||
}
|
||||
|
||||
try {
|
||||
setenv("YQUAKE2_GAMELIBDIR", getFilesDir().getParentFile().getPath() + "/lib", true);
|
||||
setenv("RTCW_GAMELIBDIR", getFilesDir().getParentFile().getPath() + "/lib", true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package com.drbeef.quake2quest;
|
||||
package com.drbeef.rtcwquest;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.Surface;
|
||||
|
|
Loading…
Reference in a new issue