Skip to content

Commit

Permalink
v1.1.0harmattan50-free
Browse files Browse the repository at this point in the history
  • Loading branch information
glKarin committed May 7, 2024
1 parent 20cadc9 commit c994d92
Show file tree
Hide file tree
Showing 340 changed files with 6,122 additions and 1,687 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Q3E/build

build.log
gradle assembleDebug.bat
gradle assembleRelease.bat
gradle assembleRelease.bat

idTech4Amm/src/main/assets/source/DIII4A.source.tgz
15 changes: 13 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@

----------------------------------------------------------------------------------

> 1.1.0harmattan50 (2024-04-30)
* Support new stage rendering of heatHaze shaders(e.g. heat haze distortion of BFG9000's projectile, Rocket Gun's explosion) and colorProcess shader(e.g. blood film on mirror of marscity2).
* Support new shader stage rendering of GLSL shaders in Quake 4(e.g. sniper scope effect of machine gun and bullet hole of machine gun).
* Add control on-screen joystick visible mode in `Control` tab(always show; hidden; only show when pressed).
* Improving Phong/Blinn-Phong light model interaction shader with high-precision.
* Force disable using compression texture in The Dark Mod.
* Game data directories are standalone in Settings: DOOM3 -> doom3/; Quake4 -> quake4/; Prey -> prey/; Quake1 -> quake1/; Quake2 -> quake2/; Quake3 -> quake3/; RTCW -> rtcw/; The Dark Mod -> darkmod/ (always).

----------------------------------------------------------------------------------

> 1.1.0harmattan39 (2024-04-10)
* Support perforated surface shadow in shadow mapping.
* Support perforated surface shadow in shadow mapping(cvar `r_forceShadowMapsOnAlphaTestedSurfaces`, default 0).
* Add `LibreCoop` mod of DOOM3 support, game data directory named `librecoop`. More view in [LibreCoop](https://www.moddb.com/mods/librecoop-dhewm3-coop).
* Add `Quake II` support, game data directory named `baseq2`. More view in [Quake II](https://store.steampowered.com/app/2320/Quake_II/).
* Add `Quake III Arena` support, game data directory named `baseq3`; Add `Quake III Team Arena` support, game data directory named `missionpack`. More view in [Quake III Arena](https://store.steampowered.com/app/2200/Quake_III_Arena/).
* Add `Return to Castle Wolfenstein` support, game data directory named `main`. More view in [Return to Castle Wolfenstein](https://www.moddb.com/games/return-to-castle-wolfenstein).
* Add `The Dark Mod` 2.11 support, game data directory named `darkmod`. More view in [The Dark Mod](https://www.thedarkmod.com).
* Add `The Dark Mod` 2.12 support, game data directory named `darkmod`. More view in [The Dark Mod](https://www.thedarkmod.com).
* Add a on-screen button theme.

----------------------------------------------------------------------------------
Expand Down
15 changes: 13 additions & 2 deletions CHANGES.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@

----------------------------------------------------------------------------------

> 1.1.0harmattan50 (2024-04-30)
* 支持新渲染通道: 热浪(例如 BFG9000飞行物的扭曲, 火箭炮的爆炸), colorProcess(例如 marscity2镜子前的血色影片).
* 雷神之锤4支持新GLSL渲染通道(例如 机枪的瞄准镜特效和弹孔).
* `Control`选项卡新增控制虚拟摇杆的显示模式(总是显示; 隐藏; 仅按下显示).
* 改进Phong/Blinn-Phong光照模型着色器使用高精度.
* The Dark Mod中强制禁用压缩纹理.
* 设置中可以启用每个游戏的数据文件夹独立放置: 毁灭战士3 -> doom3/; 雷神之锤4 -> quake4/; 掠食(2006) -> prey/; 雷神之锤1 -> quake1/; 雷神之锤2 -> quake2/; 雷神之锤3 -> quake3/; 重返德军总部 -> rtcw/; The Dark Mod -> darkmod/ (总是独立).

----------------------------------------------------------------------------------

> 1.1.0harmattan39 (2024-04-10)
* 阴影映射支持镂空图层阴影.
* 阴影映射支持镂空图层阴影(cvar `r_forceShadowMapsOnAlphaTestedSurfaces`, 默认0).
* 新增毁灭战士3 mod `LibreCoop`支持, 游戏数据文件夹命名为`librecoop`. 详情[LibreCoop](https://www.moddb.com/mods/librecoop-dhewm3-coop).
* 新增`雷神之锤2`支持, 游戏数据文件夹命名为`baseq2`. 详情[Quake II](https://store.steampowered.com/app/2320/Quake_II/).
* 新增`雷神之锤3竞技场`支持, 游戏数据文件夹命名为`baseq3`; 新增`雷神之锤3团队竞技场`支持, 游戏数据文件夹命名为`missionpack`. 详情[Quake III Arena](https://store.steampowered.com/app/2200/Quake_III_Arena/).
* 新增`重返德军总部`支持, 游戏数据文件夹命名为`main`. 详情[Return to Castle Wolfenstein](https://www.moddb.com/games/return-to-castle-wolfenstein).
* 新增`The Dark Mod`v2.11支持, 游戏数据文件夹命名为`darkmod`. 详情[The Dark Mod](https://www.thedarkmod.com).
* 新增`The Dark Mod`v2.12支持, 游戏数据文件夹命名为`darkmod`. 详情[The Dark Mod](https://www.thedarkmod.com).
* 新增一个虚拟按键主题.

----------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions CHECK_FOR_UPDATE.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"release":39,
"update":"2024-04-10",
"version":"1.1.0harmattan39",
"apk_url":"https://github.com/glKarin/com.n0n3m4.diii4a/releases/download/v1.1.0harmattan39/idTech4A++_1.1.0harmattan39.apk",
"changes":" * Support perforated surface shadow in shadow mapping.\n * Add `LibreCoop` mod of DOOM3 support, game data directory named `librecoop`.\n * Add `Quake II` support, game data directory named `baseq2`.\n * Add `Quake III Arena` support, game data directory named `baseq3`; Add `Quake III Team Arena` support, game data directory named `missionpack`.\n * Add `Return to Castle Wolfenstein` support, game data directory named `main`.\n * Add `The Dark Mod` 2.11 support, game data directory named `darkmod`.\n * Add a on-screen button theme."
"release":50,
"update":"2024-04-30",
"version":"1.1.0harmattan50",
"apk_url":"https://github.com/glKarin/com.n0n3m4.diii4a/releases/download/v1.1.0harmattan50/idTech4A++_1.1.0harmattan50.apk",
"changes":" * Support new stage rendering of heatHaze shaders(e.g. heat haze distortion of BFG9000's projectile, Rocket Gun's explosion) and colorProcess shader(e.g. blood film on mirror of marscity2).\n * Support new shader stage rendering of GLSL shaders in Quake 4(e.g. sniper scope effect of machine gun and bullet hole of machine gun).\n * Add control on-screen joystick visible mode in `Control` tab(always show; hidden; only show when pressed).\n * Improving Phong/Blinn-Phong light model interaction shader with high-precision.\n * Force disable using compression texture in The Dark Mod.\n * Game data directories are standalone in Settings: DOOM3 -> doom3/; Quake4 -> quake4/; Prey -> prey/; Quake1 -> quake1/; Quake2 -> quake2/; Quake3 -> quake3/; RTCW -> rtcw/; The Dark Mod -> darkmod/ (always)."
}
Binary file added Q3E/src/main/assets/btn_score.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Q3E/src/main/assets/controls_theme.zipak
Binary file not shown.
Binary file modified Q3E/src/main/assets/pak/darkmod/glprogs.pk4
Binary file not shown.
Binary file modified Q3E/src/main/assets/pak/glslprogs.pk4
Binary file not shown.
39 changes: 31 additions & 8 deletions Q3E/src/main/java/com/n0n3m4/q3e/Q3EAudioTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import android.media.AudioTrack;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;

import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;

public class Q3EAudioTrack extends AudioTrack
{
Expand All @@ -17,17 +18,22 @@ public class Q3EAudioTrack extends AudioTrack
private boolean m_inited = false;
//k byte[] mAudioData;

private Q3EAudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes, int mode) throws IllegalStateException
public Q3EAudioTrack(int streamType, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes, int mode) throws IllegalStateException
{
super(streamType, sampleRateInHz, channelConfig, audioFormat,
bufferSizeInBytes, mode);
}

private void Init(int size)
protected void Init(int size)
{
if (m_inited)
return;

if (getState() != AudioTrack.STATE_INITIALIZED) {
Log.e(TAG, "Failed during initialization of Audio Track");
return;
}

m_thread = new HandlerThread(TAG);
m_thread.start();
m_handler = new Handler(m_thread.getLooper());
Expand Down Expand Up @@ -118,7 +124,7 @@ public synchronized void Shutdown()
release();
}

private class AudioOptRunnable implements Runnable
protected class AudioOptRunnable implements Runnable
{
private byte[] m_data = null;
public int m_length = 0;
Expand Down Expand Up @@ -154,20 +160,37 @@ public AudioOptRunnable(byte[] audioData, int offset, int len)
len = -len;
}
m_data = new byte[len];
System.arraycopy(audioData, 0, m_data, 0, len);
System.arraycopy(audioData, offset, m_data, 0, len);
m_length = len;
}
}

@Override
public void run()
{
if (m_inited)
if (Q3EAudioTrack.this.m_inited)
{
if (m_length > 0)
write(m_data, 0, m_length);
{
int i = 0;
while ( i < m_data.length ) {
int result = Q3EAudioTrack.this.write(m_data, i, m_length - i/*, AudioTrack.WRITE_BLOCKING*/);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException ignored) {
// Nom nom
}
} else {
Log.w(TAG, "Audio: error return from write(byte)");
}
}
// Q3EAudioTrack.this.write(m_data, 0, m_length);
}
if (m_flush)
flush();
Q3EAudioTrack.this.flush();
}
m_data = null;
}
Expand Down
42 changes: 40 additions & 2 deletions Q3E/src/main/java/com/n0n3m4/q3e/Q3ECallbackObj.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package com.n0n3m4.q3e;

import android.app.Activity;
import android.content.Context;

import com.n0n3m4.q3e.karin.KOnceRunnable;
import com.n0n3m4.q3e.onscreen.Q3EGUI;
Expand Down Expand Up @@ -105,10 +104,15 @@ public void init(int size)
"' */

if (mAudioTrack != null) return;
mAudioTrack = Q3EAudioTrack.Instance(size);
mAudioTrack = Instance(size);
reqThreadrunning = true;
}

public static Q3EAudioTrack Instance(int size)
{
return Q3EAudioTrack.Instance(size);
}

//k NEW:
// Now call directly by native of libidtech4*.so, and don't need call requestAudioData in Java.
// if offset >= 0 and length > 0, only write.
Expand Down Expand Up @@ -244,5 +248,39 @@ public void ShowToast(String text)
if(null != gui)
gui.Toast(text);
}

public void CloseVKB()
{
if (null != vw)
{
vw.post(new Runnable() {
@Override
public void run() {
Q3EUtils.CloseVKB(vw);
}
});
}
}

public void OpenVKB()
{
if (null != vw)
{
vw.post(new Runnable() {
@Override
public void run() {
Q3EUtils.OpenVKB(vw);
}
});
}
}

public void ToggleToolbar(boolean on)
{
if (null != vw)
{
vw.ToggleToolbar(on);
}
}
}

30 changes: 13 additions & 17 deletions Q3E/src/main/java/com/n0n3m4/q3e/Q3EGameHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import android.view.Surface;
import android.widget.Toast;

import com.n0n3m4.q3e.karin.KStr;
import com.n0n3m4.q3e.karin.KidTech4Command;

import java.io.File;
Expand Down Expand Up @@ -67,9 +68,10 @@ public void ShowMessage(int resId)

public boolean checkGameFiles()
{
if (!new File(Q3EUtils.q3ei.datadir).exists())
String dataDir = Q3EUtils.q3ei.GetGameDataDirectoryPath(null);
if (!new File(dataDir).exists())
{
ShowMessage(Q3ELang.tr(m_context, R.string.game_files_weren_t_found_put_game_files_to) + Q3EUtils.q3ei.datadir);
ShowMessage(Q3ELang.tr(m_context, R.string.game_files_weren_t_found_put_game_files_to) + dataDir);
return false;
}

Expand All @@ -82,6 +84,8 @@ public void InitGlobalEnv()

if (!Q3EUtils.q3ei.IsInitGame()) // not from GameLauncher::startActivity
{
Q3EUtils.q3ei.standalone = preferences.getBoolean(Q3EPreference.GAME_STANDALONE_DIRECTORY, false);

Q3EKeyCodes.InitD3Keycodes();

Q3EUtils.q3ei.InitD3();
Expand Down Expand Up @@ -157,15 +161,6 @@ public void InitGlobalEnv()
case Q3EGlobals.GAME_QUAKE4:
fs_game = "q4base";
break;
case Q3EGlobals.GAME_QUAKE2:
fs_game = "baseq2";
break;
case Q3EGlobals.GAME_QUAKE3:
fs_game = "baseq3";
break;
case Q3EGlobals.GAME_RTCW:
fs_game = "main";
break;
case Q3EGlobals.GAME_DOOM3:
default:
fs_game = "base";
Expand All @@ -177,13 +172,14 @@ public void InitGlobalEnv()
command.SetProp("harm_fs_gameLibPath", dll);
cmd = command.toString();
}
cmd = Q3EUtils.q3ei.datadir + "/" + cmd + " " + Q3EUtils.q3ei.start_temporary_extra_command/* + " +set harm_fs_gameLibDir " + lib_dir*/;
String binDir = Q3EUtils.q3ei.GetGameDataDirectoryPath(null);
cmd = binDir + "/" + cmd + " " + Q3EUtils.q3ei.start_temporary_extra_command/* + " +set harm_fs_gameLibDir " + lib_dir*/;
Q3EUtils.q3ei.cmd = cmd;
}

private String FindDLL(String fs_game)
{
String DLLPath = Q3EUtils.q3ei.datadir + File.separator + fs_game + File.separator; // /sdcard/diii4a/<fs_game>
String DLLPath = Q3EUtils.q3ei.GetGameDataDirectoryPath(fs_game); // /sdcard/diii4a/<fs_game>
String Suffix = "game" + Q3EGlobals.ARCH + ".so"; // gameaarch64.so(64) / gamearm.so(32)
String[] guess = {
Suffix,
Expand All @@ -193,7 +189,7 @@ private String FindDLL(String fs_game)
String targetDir = m_context.getCacheDir() + File.separator; // /data/user/<package_name>/cache/
for (String f : guess)
{
String p = DLLPath + f;
String p = KStr.AppendPath(DLLPath, f);
File file = new File(p);
if(!file.isFile() || !file.canRead())
continue;
Expand All @@ -217,7 +213,7 @@ public String GetEngineLib()
String libPath = Q3EUtils.GetGameLibDir(m_context) + "/" + Q3EUtils.q3ei.libname;
if(preferences.getBoolean(Q3EPreference.LOAD_LOCAL_ENGINE_LIB, false))
{
String localLibPath = Q3EUtils.q3ei.datadir + "/" + Q3EUtils.q3ei.libname;
String localLibPath = Q3EUtils.q3ei.GetGameDataDirectoryPath(Q3EUtils.q3ei.libname);
File file = new File(localLibPath);
if(!file.isFile() || !file.canRead())
{
Expand Down Expand Up @@ -545,12 +541,12 @@ public void Start(Surface surface, int surfaceWidth, int surfaceHeight)
boolean usingMouse = preferences.getBoolean(Q3EPreference.pref_harm_using_mouse, false) && Q3EUtils.SupportMouse() == Q3EGlobals.MOUSE_EVENT;

Q3EJNI.init(
Q3EMain.gameHelper.GetEngineLib(),
GetEngineLib(),
Q3EUtils.GetGameLibDir(m_context),
width,
height,
Q3EUtils.q3ei.game,
Q3EUtils.q3ei.datadir,
Q3EUtils.q3ei.subdatadir,
cmd,
surface,
glFormat,
Expand Down
Loading

0 comments on commit c994d92

Please sign in to comment.