Support for Team Arena

- just set the following in the commandline.txt:

+set fs_game missionpack
This commit is contained in:
Simon 2022-02-13 15:00:32 +00:00
parent dba25f1d52
commit efe1e29eee
14 changed files with 105 additions and 26 deletions

View file

@ -14,7 +14,7 @@ BUILD_CLIENT=1
BUILD_CLIENT_SMP=0
BUILD_GAME_QVM=0
BUILD_GAME_SO=1
BUILD_MISSIONPACK=0
BUILD_MISSIONPACK=1
BUILD_SERVER=0
BUILD_STANDALONE=0
GENERATE_DEPENDENCIES=0

View file

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.ioq3quest"
android:installLocation="preferExternal"
android:versionCode="13"
android:versionName="0.9.0">
android:versionCode="14"
android:versionName="0.10.0">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<uses-feature android:glEsVersion="0x00030001" />

Binary file not shown.

View file

@ -16,9 +16,12 @@ add_custom_target(copy_libs
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/libioquake3_opengl2.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libioquake3_opengl2.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/libSDL2.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libSDL2.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/libvrapi.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libvrapi.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/cgameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libcgameaarch64.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/qagameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libqagameaarch64.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/uiaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libuiaarch64.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/cgameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libcgameaarch64_baseq3.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/qagameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libqagameaarch64_baseq3.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/baseq3/uiaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libuiaarch64_baseq3.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/missionpack/cgameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libcgameaarch64_missionpack.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/missionpack/qagameaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libqagameaarch64_missionpack.so
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../../../../../build/${BUILD_FOLDER}/missionpack/uiaarch64.so ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libuiaarch64_missionpack.so
)
add_dependencies(main copy_libs)

View file

@ -65,7 +65,7 @@ int main(int argc, char* argv[]) {
engine_t* engine = nullptr;
engine = VR_Init(java);
//sleep(40);
//sleep(30);
//First set up resolution cached values
int width, height;

View file

@ -107,10 +107,12 @@ public class MainActivity extends SDLActivity
public void create() throws IOException {
//Make the directories
new File("/sdcard/ioquake3Quest/baseq3").mkdirs();
new File("/sdcard/ioquake3Quest/missionpack").mkdirs();
//Copy the command line params file
copy_asset("/sdcard/ioquake3Quest", "commandline.txt", false);
copy_asset("/sdcard/ioquake3Quest/baseq3", "autoexec.cfg", false);
copy_asset("/sdcard/ioquake3Quest/missionpack", "autoexec.cfg", false);
//copy demo
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak0.pk3", false);
@ -119,7 +121,14 @@ public class MainActivity extends SDLActivity
copy_asset("/sdcard/ioquake3Quest", "glsl.zip", true);
new File("/sdcard/ioquake3Quest/baseq3/glsl").mkdirs();
unzip(new File("/sdcard/ioquake3Quest/glsl.zip"), new File("/sdcard/ioquake3Quest/baseq3/glsl"));
new File("/sdcard/ioquake3Quest/missionpack/glsl").mkdirs();
unzip(new File("/sdcard/ioquake3Quest/glsl.zip"), new File("/sdcard/ioquake3Quest/missionpack/glsl"));
copy_asset("/sdcard/ioquake3Quest", "ui.zip", true);
unzip(new File("/sdcard/ioquake3Quest/ui.zip"), new File("/sdcard/ioquake3Quest/missionpack"));
new File("/sdcard/ioquake3Quest/glsl.zip").delete();
new File("/sdcard/ioquake3Quest/ui.zip").delete();
//Read these from a file and pass through
commandLineParams = new String();

View file

@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
uiStatic_t uis;
qboolean m_entersound; // after a frame, so caching won't disrupt the sound
extern vr_clientinfo_t *uiVR;
extern vr_clientinfo_t *vr;
void QDECL Com_Error( int level, const char *error, ... ) {
va_list argptr;
@ -57,7 +57,7 @@ void QDECL Com_Printf( const char *msg, ... ) {
float UI_GetXScale()
{
if (uiVR == NULL || uiVR->virtual_screen) {
if (vr == NULL || vr->virtual_screen) {
return uis.xscale;
} else {
return uis.xscale / 2.75f;
@ -66,7 +66,7 @@ float UI_GetXScale()
float UI_GetYScale()
{
if (uiVR == NULL || uiVR->virtual_screen) {
if (vr == NULL || vr->virtual_screen) {
return uis.yscale;
} else {
return uis.yscale / 3.25f;
@ -75,7 +75,7 @@ float UI_GetYScale()
float UI_GetXOffset()
{
if (uiVR == NULL || uiVR->virtual_screen) {
if (vr == NULL || vr->virtual_screen) {
return 0;
} else {
return (uis.glconfig.vidWidth - (640 * UI_GetXScale())) / 2.0f;
@ -84,7 +84,7 @@ float UI_GetXOffset()
float UI_GetYOffset()
{
if (uiVR == NULL || uiVR->virtual_screen) {
if (vr == NULL || vr->virtual_screen) {
return 0;
} else {
return (uis.glconfig.vidHeight - (480 * UI_GetYScale())) / 2.0f;

View file

@ -32,7 +32,7 @@ USER INTERFACE MAIN
#include "ui_local.h"
#include "../vr/vr_clientinfo.h"
vr_clientinfo_t *uiVR = NULL;
vr_clientinfo_t *vr = NULL;
/*
================
@ -49,7 +49,7 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, i
case UI_INIT: {
int ptr[2] = {arg1, arg2};
uiVR = (vr_clientinfo_t *) (*(long *) (ptr));
vr = (vr_clientinfo_t *) (*(long *) (ptr));
UI_Init();
}

View file

@ -249,6 +249,7 @@ static cvar_t *fs_debug;
static cvar_t *fs_homepath;
static cvar_t *fs_forceNativeVM;
static cvar_t *fs_nativeVMBase;
#ifdef __APPLE__
// Also search the .app bundle for .pk3 files
@ -1457,8 +1458,24 @@ int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, i
if(!fs_searchpaths)
Com_Error(ERR_FATAL, "Filesystem call made without initialization");
if(enableDll)
Com_sprintf(dllName, sizeof(dllName), "%s" ARCH_STRING DLL_EXT, name);
if(enableDll) {
//If the game dir is not mission pack, then use the cvar to tell us which
//base game libraries to load
char nativeVMBase[256];
if (strcmp(fs_gamedir, "missionpack") != 0)
{
Com_sprintf(nativeVMBase, sizeof(nativeVMBase), "%s", fs_nativeVMBase->string);
}
else
{
Com_sprintf(nativeVMBase, sizeof(nativeVMBase), "missionpack");
}
Com_sprintf(dllName, sizeof(dllName), "%s"
ARCH_STRING
"_%s"
DLL_EXT, name, nativeVMBase);
}
Com_sprintf(qvmName, sizeof(qvmName), "vm/%s.qvm", name);
@ -3639,7 +3656,7 @@ static void FS_CheckPak0( void )
"from your legitimate Quake 3 Team Arena CDROM. ", PATH_SEP);
}
if((foundTA & 0x0e) != 0x0e)
/* if((foundTA & 0x0e) != 0x0e)
{
Q_strcat(errorText, sizeof(errorText),
"Team Arena Point Release files are missing. Please "
@ -3647,6 +3664,7 @@ static void FS_CheckPak0( void )
}
Com_Error(ERR_FATAL, "%s", errorText);
*/
}
}
#endif
@ -3990,6 +4008,7 @@ void FS_InitFilesystem( void ) {
Com_StartupVariable("fs_game");
fs_forceNativeVM = Cvar_Get( "fs_forceNativeVM", "1", CVAR_ARCHIVE );
fs_nativeVMBase = Cvar_Get( "fs_nativeVMBase", "baseq3", CVAR_ARCHIVE );
if(!FS_FilenameCompare(Cvar_VariableString("fs_game"), com_basegame->string))

View file

@ -26,8 +26,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
User interface building blocks and support functions.
**********************************************************************/
#include "ui_local.h"
#include "../vr/vr_clientinfo.h"
qboolean m_entersound; // after a frame, so caching won't disrupt the sound
extern vr_clientinfo_t *vr;
void QDECL Com_Error( int level, const char *error, ... ) {
va_list argptr;
@ -54,6 +56,42 @@ void QDECL Com_Printf( const char *msg, ... ) {
qboolean newUI = qfalse;
float UI_GetXScale()
{
if (vr == NULL || vr->virtual_screen) {
return uiInfo.uiDC.xscale;
} else {
return uiInfo.uiDC.xscale / 2.75f;
}
}
float UI_GetYScale()
{
if (vr == NULL || vr->virtual_screen) {
return uiInfo.uiDC.yscale;
} else {
return uiInfo.uiDC.yscale / 3.25f;
}
}
float UI_GetXOffset()
{
if (vr == NULL || vr->virtual_screen) {
return 0;
} else {
return (uiInfo.uiDC.glconfig.vidWidth - (640 * UI_GetXScale())) / 2.0f;
}
}
float UI_GetYOffset()
{
if (vr == NULL || vr->virtual_screen) {
return 0;
} else {
return (uiInfo.uiDC.glconfig.vidHeight - (480 * UI_GetYScale())) / 2.0f;
}
}
/*
=================
UI_ClampCvar
@ -420,10 +458,10 @@ Adjusted for resolution and screen aspect ratio
*/
void UI_AdjustFrom640( float *x, float *y, float *w, float *h ) {
// expect valid pointers
*x = *x * uiInfo.uiDC.xscale + uiInfo.uiDC.bias;
*y *= uiInfo.uiDC.yscale;
*w *= uiInfo.uiDC.xscale;
*h *= uiInfo.uiDC.yscale;
*x = *x * UI_GetXScale() + uiInfo.uiDC.bias + UI_GetXOffset();
*y = *y * UI_GetYScale() + UI_GetYOffset();
*w *= UI_GetXScale();
*h *= UI_GetYScale();
}
void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ) {

View file

@ -32,6 +32,9 @@ USER INTERFACE MAIN
//#define PRE_RELEASE_TADEMO
#include "ui_local.h"
#include "../vr/vr_clientinfo.h"
vr_clientinfo_t *vr = NULL;
uiInfo_t uiInfo;
@ -159,8 +162,11 @@ Q_EXPORT intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, i
case UI_GETAPIVERSION:
return UI_API_VERSION;
case UI_INIT:
_UI_Init(arg0);
case UI_INIT: {
int ptr[2] = {arg1, arg2};
vr = (vr_clientinfo_t *) (*(long *) (ptr));
_UI_Init(arg0);
}
return 0;
case UI_SHUTDOWN:

View file

@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define SCROLL_TIME_ADJUSTOFFSET 40
#define SCROLL_TIME_FLOOR 20
extern vr_clientinfo_t *uiVR;
extern vr_clientinfo_t *vr;
typedef struct scrollInfo_s {
int nextScrollTime;
@ -3645,7 +3645,7 @@ qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down) {
void AdjustFrom640(float *x, float *y, float *w, float *h) {
if (uiVR == NULL || uiVR->virtual_screen) {
if (vr == NULL || vr->virtual_screen) {
// expect valid pointers
*x *= DC->xscale;
*y *= DC->yscale;

View file

@ -46,7 +46,7 @@ void VR_InitCvars( void )
// VALUES PROVIDED BY SkillFur - Thank-you!
Cvar_Get ("vr_weapon_adjustment_1", "1,-4.0,7,-10,-20,-15,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_2", "0.8,-3.0,5.5,0,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_3", "0.7,-3.0,5.5,0,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_3", "0.8,-3.3,8,3.7,0,0,0", CVAR_ARCHIVE); // shotgun
Cvar_Get ("vr_weapon_adjustment_4", "0.75,-5.4,6.5,-4,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_5", "0.8,-5.2,6,7.5,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_6", "0.8,-3.3,6,7,0,0,0", CVAR_ARCHIVE);
@ -54,6 +54,10 @@ void VR_InitCvars( void )
Cvar_Get ("vr_weapon_adjustment_8", "0.8,-4.5,6,1.5,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_9", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_10", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_11", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
Cvar_Get ("vr_weapon_adjustment_12", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
}
void VR_Destroy( engine_t* engine )

BIN
ui.zip Normal file

Binary file not shown.