From 04d2ac18ca5f5f4091bdc167f76fe5c288743050 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 20 Jul 2020 23:04:07 +0100 Subject: [PATCH] Few small changes.. - Don't let the game run a graphics performance selection (pointless) - Raised weapons slightly - Ensured trilinear mip mapping by default - Included copying of demo and weapons pack in base apk --- .gitignore | 2 + Projects/Android/AndroidManifest.xml | 4 +- Projects/Android/jni/rtcw/src/game/q_shared.h | 2 +- .../Android/jni/rtcw/src/qcommon/common.c | 5 +- Projects/Android/jni/rtcw/src/ui/ui_main.c | 2 +- .../Android/jni/rtcw/src/unix/unix_shared.c | 2 +- assets/weapons_hd.cfg | 22 ++--- .../drbeef/rtcwquest/GLES3JNIActivity.java | 98 +------------------ 8 files changed, 26 insertions(+), 111 deletions(-) diff --git a/.gitignore b/.gitignore index f280047..e0ea7d3 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ assets/pak6.pak Projects/Android/Android.iml Projects/Projects.iml VrSamples-Quake2Quest.iml +assets/pak0.pk3 +assets/sp_pak_weapons.pk3 diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index 7a00b4f..417c058 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="16" + android:versionName="0.16.0" android:installLocation="auto" > diff --git a/Projects/Android/jni/rtcw/src/game/q_shared.h b/Projects/Android/jni/rtcw/src/game/q_shared.h index eef54bd..d9df7df 100644 --- a/Projects/Android/jni/rtcw/src/game/q_shared.h +++ b/Projects/Android/jni/rtcw/src/game/q_shared.h @@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms // q_shared.h -- included first by ALL program modules. // A user mod should never modify this file -#define Q3_VERSION "RTCWQuest 0.15.0 (Wolf 1.41)" +#define Q3_VERSION "RTCWQuest 0.16.0 (Wolf 1.41)" // ver 1.0.0 - release // ver 1.0.1 - post-release work // ver 1.1.0 - patch 1 (12/12/01) diff --git a/Projects/Android/jni/rtcw/src/qcommon/common.c b/Projects/Android/jni/rtcw/src/qcommon/common.c index b28844a..e8af434 100644 --- a/Projects/Android/jni/rtcw/src/qcommon/common.c +++ b/Projects/Android/jni/rtcw/src/qcommon/common.c @@ -2115,10 +2115,11 @@ void Com_Init( char *commandLine ) { Sys_ShowConsole( com_viewlog->integer, qfalse ); } - if ( !com_recommendedSet->integer ) { + //Use our own settings - don't go for "recommended" +/* if ( !com_recommendedSet->integer ) { Com_SetRecommended( qtrue ); Cvar_Set( "com_recommendedSet", "1" ); - } + }*/ if ( !com_dedicated->integer ) { //Cbuf_AddText ("cinematic gmlogo.RoQ\n"); diff --git a/Projects/Android/jni/rtcw/src/ui/ui_main.c b/Projects/Android/jni/rtcw/src/ui/ui_main.c index 80dd05f..6fcf406 100644 --- a/Projects/Android/jni/rtcw/src/ui/ui_main.c +++ b/Projects/Android/jni/rtcw/src/ui/ui_main.c @@ -4419,7 +4419,7 @@ static void UI_Update( const char *name ) { trap_Cvar_SetValue( "r_fastSky", 0 ); trap_Cvar_SetValue( "r_inGameVideo", 1 ); trap_Cvar_SetValue( "cg_brassTime", 2500 ); - trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" ); //----(SA) modified so wolf never sets trilinear automatically + trap_Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" ); trap_Cvar_SetValue( "cg_shadows", 0 ); break; case 2: // fast diff --git a/Projects/Android/jni/rtcw/src/unix/unix_shared.c b/Projects/Android/jni/rtcw/src/unix/unix_shared.c index 9cabfcb..c6c3e46 100644 --- a/Projects/Android/jni/rtcw/src/unix/unix_shared.c +++ b/Projects/Android/jni/rtcw/src/unix/unix_shared.c @@ -371,7 +371,7 @@ int Sys_GetProcessorId( void ) { int Sys_GetHighQualityCPU() { // TODO TTimo see win_shared.c IsP3 || IsAthlon - return 0; + return 1; } void Sys_ShowConsole( int visLevel, qboolean quitOnClose ) { diff --git a/assets/weapons_hd.cfg b/assets/weapons_hd.cfg index 415c671..083b1d5 100644 --- a/assets/weapons_hd.cfg +++ b/assets/weapons_hd.cfg @@ -34,21 +34,21 @@ // Values are: scale,right,up,forward,pitch,yaw,roll seta vr_weapon_adjustment_20 "0.50,-11.0,12.40,-22.42,0.80,-1.40,0.00" -seta vr_weapon_adjustment_19 "0.50,-9.12,10.72,-20.60,-2.80,-4.60,0.00" +seta vr_weapon_adjustment_19 "0.50,-9.12,13.72,-20.60,-2.80,-4.60,0.00" seta vr_weapon_adjustment_14 "0.54,-10.78,14.78,-19.89,0.00,7.20,-8.00" -seta vr_weapon_adjustment_8 "0.54,-9.08,8.38,-6.61,0.00,0.00,0.00" -seta vr_weapon_adjustment_5 "0.55,-8.70,5.91,-16.49,0.00,1.40,0.00" -seta vr_weapon_adjustment_4 "0.50,-8.65,8.80,-1.39,-1.20,-1.80,0.00" +seta vr_weapon_adjustment_8 "0.54,-9.08,11.38,-6.61,0.00,0.00,0.00" +seta vr_weapon_adjustment_5 "0.55,-8.70,8.91,-16.49,0.00,1.40,0.00" +seta vr_weapon_adjustment_4 "0.50,-8.65,11.80,-1.39,-1.20,-1.80,0.00" seta vr_weapon_adjustment_22 "0.49,-11.93,14.43,-21.31,0.00,0.00,0.00" -seta vr_weapon_adjustment_13 "0.55,-9.38,7.32,-1.27,0.00,-1.80,0.00" +seta vr_weapon_adjustment_13 "0.55,-9.38,10.32,-1.27,0.00,-1.80,0.00" seta vr_weapon_adjustment_10 "0.54,-8.41,4.83,0.00,0.00,0.00,0.00" seta vr_weapon_adjustment_9 "0.54,-9.52,4.83,4.39,0.00,0.00,0.00" -seta vr_weapon_adjustment_7 "0.91,-5.53,6.43,1.19,0.00,0.00,0.00" -seta vr_weapon_adjustment_18 "0.50,-8.53,9.52,0.00,-5.20,0.00,0.00" -seta vr_weapon_adjustment_12 "0.64,-7.66,7.35,-8.82,-3.20,0.00,0.00" -seta vr_weapon_adjustment_11 "0.50,-9.60,10.40,-22.42,0.80,-1.40,0.00" +seta vr_weapon_adjustment_7 "0.91,-5.53,9.43,1.19,0.00,0.00,0.00" +seta vr_weapon_adjustment_18 "0.50,-8.53,12.52,0.00,-5.20,0.00,0.00" +seta vr_weapon_adjustment_12 "0.64,-7.66,10.35,-8.82,-3.20,0.00,0.00" +seta vr_weapon_adjustment_11 "0.50,-9.60,13.40,-22.42,0.80,-1.40,0.00" seta vr_weapon_adjustment_6 "0.54,-10.78,14.78,-19.89,0.00,7.20,-8.00" -seta vr_weapon_adjustment_3 "0.60,-8.23,5.95,-9.46,-2.00,0.00,0.00" -seta vr_weapon_adjustment_2 "0.50,-8.99,10.81,-21.90,-5.20,-4.20,0.00" +seta vr_weapon_adjustment_3 "0.60,-8.23,8.95,-9.46,-2.00,0.00,0.00" +seta vr_weapon_adjustment_2 "0.50,-8.99,13.81,-21.90,-5.20,-4.20,0.00" seta vr_weapon_adjustment_1 "0.52,-4.62,8.89,-10.08,24.20,-2.80,-4.80" diff --git a/java/com/drbeef/rtcwquest/GLES3JNIActivity.java b/java/com/drbeef/rtcwquest/GLES3JNIActivity.java index ec62152..0ae390f 100644 --- a/java/com/drbeef/rtcwquest/GLES3JNIActivity.java +++ b/java/com/drbeef/rtcwquest/GLES3JNIActivity.java @@ -164,15 +164,17 @@ import static android.system.Os.setenv; } public void create() { - //Configuration files - copy_asset("/sdcard/RTCWQuest", "commandline.txt"); - //Make the directories new File("/sdcard/RTCWQuest/Main").mkdirs(); //Copy the weapon adjustment config copy_asset("/sdcard/RTCWQuest/Main", "weapons_hd.cfg"); + //and the demo version + copy_asset("/sdcard/RTCWQuest/Main", "pak0.pk3"); + + //and the weapons + copy_asset("/sdcard/RTCWQuest/Main", "sp_pak_weapons.pk3"); //Read these from a file and pass through commandLineParams = new String("rtcw"); @@ -329,94 +331,4 @@ import static android.system.Os.setenv; } } - // Audio - - /** - * This method is called by SDL using JNI. - */ - public static int audioOpen(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) { - int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO; - int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT; - int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1); - - Log.v(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer"); - - // Let the user pick a larger buffer if they really want -- but ye - // gods they probably shouldn't, the minimums are horrifyingly high - // latency already - desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize); - - if (mAudioTrack == null) { - mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, - channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM); - - // Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid - // Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java - // Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState() - - if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) { - Log.e(TAG, "Failed during initialization of Audio Track"); - mAudioTrack = null; - return -1; - } - - mAudioTrack.play(); - } - - Log.v(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer"); - - return 0; - } - - /** - * This method is called by SDL using JNI. - */ - public static void audioWriteShortBuffer(short[] buffer) { - for (int i = 0; i < buffer.length; ) { - int result = mAudioTrack.write(buffer, i, buffer.length - i); - if (result > 0) { - i += result; - } else if (result == 0) { - try { - Thread.sleep(1); - } catch(InterruptedException e) { - // Nom nom - } - } else { - Log.w(TAG, "SDL audio: error return from write(short)"); - return; - } - } - } - - /** - * This method is called by SDL using JNI. - */ - public static void audioWriteByteBuffer(byte[] buffer) { - for (int i = 0; i < buffer.length; ) { - int result = mAudioTrack.write(buffer, i, buffer.length - i); - if (result > 0) { - i += result; - } else if (result == 0) { - try { - Thread.sleep(1); - } catch(InterruptedException e) { - // Nom nom - } - } else { - Log.w(TAG, "SDL audio: error return from write(byte)"); - return; - } - } - } - - /** This method is called by SDL using JNI. */ - public static void audioClose() { - if (mAudioTrack != null) { - mAudioTrack.stop(); - mAudioTrack.release(); - mAudioTrack = null; - } - } - }