Merge upstream v1.0.15 into android-port
Conflicts resolved: hle_audio.c keeps the AAudio downmix on Android and takes upstream's 5.1 downmix on Apple; hle_nvn.c keeps mtl_queue_flush / ADPF pacing on Android. Android translates synchronously on the submit thread for now (the Vulkan backend's fence also counts readback commits); Vulkan gets no-op mtl_host_latch / mtl_host_apply; compat adds pthread_attr_set_qos_class_np. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,10 +28,14 @@ with tempfile.TemporaryDirectory() as t:
|
||||
nw=round((x1-x0)*k); nx=round(((x0+x1)/2-ref_w/2)*k)-1
|
||||
# 系统提示框:整份自己写、不继承原版那份——原版带一个铺满的 Confirm 按钮(继承来的子控件删不掉),提示在屏上时它接住功能键和点击:
|
||||
# 按功能键 / 点它压着的地方都只是把提示关掉(面板开不了、下面的格子点不到)。触屏上提示到点自己消失,不要这个按钮
|
||||
# System notification: written entirely by ourselves, not inheriting the original game's one -- the original carries a full-cover Confirm button (an inherited child widget cannot be deleted), which catches the function key and taps while the notification is on screen:
|
||||
# pressing the function key / tapping where it covers only dismisses the notification (the panel cannot open, the cells beneath cannot be tapped). On a touchscreen the notification disappears by itself when its time is up, so this button is not wanted
|
||||
# 停靠高度 y −790(原版 −500;先前为让开经验条提到 −600,仍压着底栏上方那行「生命 / 法力」数值——数值位数多时字伸进框里,触屏版那行更高、直接叠在框中间):
|
||||
# 框的下沿要高过数值行的上沿,触屏版需再上提约 173 单位、手柄版约 77 单位,取一个两版都让开的值。只改布局里的停靠位置,滑入滑出仍是游戏自己的动画
|
||||
# System notice box: written entirely by us, not inheriting the original - the original has a full-size Confirm button (inherited child widgets cannot be removed), which takes the function keys and taps while a notice is on screen:
|
||||
# pressing a function key / tapping where it covers only dismisses the notice (panels cannot be opened, the cells below cannot be tapped). On touch the notice disappears by itself on time, and this button is not wanted
|
||||
# Docking height y -790 (original -500; it was raised to -600 earlier to clear the experience bar, but still covered the "life / mana" numbers above the bottom bar - with many digits the text ran into the box, and the touch layout's row is higher and sat right in the middle of the box):
|
||||
# the lower edge of the box has to be above the upper edge of the number row; the touch layout needs about 173 more units, the gamepad layout about 77, so one value that clears both is taken. Only the docking position in the layout changes; slide-in and slide-out are still the game's own animation
|
||||
note={'type':'NotificationPanel','name':'NotificationPanel',
|
||||
'fields':{'priority':9002,'notificationSeconds':5.0,'transitionSeconds':0.8,'rect':{'x':nx,'y':-600,'width':nw,'height':244},'anchor':{'x':0.5,'y':1.0}},
|
||||
'fields':{'priority':9002,'notificationSeconds':5.0,'transitionSeconds':0.8,'rect':{'x':nx,'y':-790,'width':nw,'height':244},'anchor':{'x':0.5,'y':1.0}},
|
||||
'children':[{'type':'NineTileImageWidget','name':'NotificationBorder',
|
||||
'fields':{'rect':{'x':0,'y':0,'width':nw,'height':244},'anchor':{'x':-0.5,'y':0.0},'filename':'PANEL/TooltipBorder/TooltipBorder','backgroundColor':[0.0,0.0,0.0,0.70],'tileScale':1},
|
||||
'children':[{'type':'TextBoxWidget','name':'Prompt','fields':{'fitToParent':True,'style':'$StyleNotification'}}]}]}
|
||||
@@ -68,9 +72,11 @@ with tempfile.TemporaryDirectory() as t:
|
||||
for rel,gd in (('controller/pauselayoutgardenhd.json',1),('controller/pauselayouthd.json',0)): # 手柄版暂停菜单:一键重开 / 切换难度 / 存放 / 分享诊断日志 | Controller pause menu: one-tap restart / change difficulty / Deposit / Share Diagnostics
|
||||
lp,lt=touch_layout.read_layout(romfs,rel); o=os.path.join(tpad,'pad_pause%d.json'%gd); open(o,'w',encoding='utf-8').write(touch_layout.pad_pause(lt,gd,share=not os.environ.get('DM_OVERLAY_MAC'))); PR[lp.lower()]=o
|
||||
# 大秘境面板(借「消息记录」面板外壳,touch_layout._rift_panel):手柄版同一份。少了它手柄模式点秘境门开出来的是空的原版消息记录面板、进不了秘境;手柄键在 dm_rift_ui.c
|
||||
# Greater Rift panel (borrows the shell of the "Message Log" panel, touch_layout._rift_panel): the controller version uses the same one. Without it,
|
||||
# tapping the Rift portal in controller mode opens an empty original Message Log panel and the Rift cannot be entered; the controller keys are in
|
||||
# dm_rift_ui.c
|
||||
# 手柄版的系统提示框:原版那份(停靠 y −500)下沿压着底栏上方那行「生命 / 法力」数值,数值位数多时字伸进框里。只把停靠位置上提 90 单位(下沿高过数值行),其余原样
|
||||
# Greater Rift panel (borrowing the shell of the "message log" panel, touch_layout._rift_panel): the same for the gamepad layout. Without it, tapping a rift door in gamepad mode opens the empty original message log panel and the rift cannot be entered; gamepad keys are in dm_rift_ui.c
|
||||
# The gamepad layout's system notice box: in the original (docked at y -500) its lower edge sits on the "life / mana" numbers above the bottom bar, and with many digits the text runs into the box. Only the docking position is raised by 90 units (lower edge above the number row); everything else as in the original
|
||||
lp,lt=touch_layout.read_layout(romfs,'controller/notificationpanelhd.json'); assert lt.count('"y": -500')==1, lp # 原版手柄版提示框的停靠位置应是 y -500(原包变了就停在这里) | the original gamepad notice box should dock at y -500 (if the original package changes, stop here)
|
||||
o=os.path.join(tpad,'pad_notification.json'); open(o,'w',encoding='utf-8').write(lt.replace('"y": -500','"y": -590')); PR[lp.lower()]=o
|
||||
lp,lt=touch_layout.read_layout(romfs,'controller/messagelogpanelhd.json'); o=os.path.join(tpad,'pad_rift.json'); open(o,'w',encoding='utf-8').write(touch_layout._rift_panel(lt)[0]); PR[lp.lower()]=o
|
||||
PR.update(merc_slots.build_pad(romfs,tpad)) # 手柄版佣兵面板:同样加六个装备位 | Controller layout mercenary panel: likewise add six equipment slots
|
||||
# 手柄版职业选择页:八个职业的点击矩形同样改成按实际站位分的竖条(touch_layout.CLASS_STRIPS,原因见那里)。手柄用左右键选、原版没暴露;
|
||||
@@ -161,7 +167,7 @@ with tempfile.TemporaryDirectory() as t:
|
||||
# 手柄专用清单:手柄模式下不是原版字节的布局就这几份,一份不许多、一份不许少(改上面某一行时把相邻一行整行替掉过,商人页的刷新钮就从包里掉了)
|
||||
# Controller-only list: these are the only layouts that are not original bytes in controller mode, not one more and not one fewer (once, when a line above was edited, the adjacent line was replaced whole, and the vendor page's refresh button dropped out of the package)
|
||||
PAD_PAGES=('controller/bankexpansionlayouthd.json','controller/console/charactercreatepanelhd.json','controller/console/characteroptionspanelhd.json','controller/console/mainmenubuttonribbonhd.json','controller/console/mainmenupanelhd.json','controller/console/settingspanelhd.json','controller/console/switch/playerinventoryexpansionlayouthd.json','controller/console/videooptionspanelhd.json',
|
||||
'controller/controlleroverlayhd.json','controller/hirelinginventorypanelhd.json','controller/hudmonsterhealthhd.json','controller/messagelogpanelhd.json','controller/pauselayoutgardenhd.json','controller/pauselayouthd.json','controller/vendorpanellayouthd.json')
|
||||
'controller/controlleroverlayhd.json','controller/hirelinginventorypanelhd.json','controller/hudmonsterhealthhd.json','controller/messagelogpanelhd.json','controller/notificationpanelhd.json','controller/pauselayoutgardenhd.json','controller/pauselayouthd.json','controller/vendorpanellayouthd.json')
|
||||
if sorted(k[len(LAY):] for k in PADLAY)!=sorted(PAD_PAGES): raise SystemExit('gen_romfs_overlay:手柄专用布局与清单 PAD_PAGES 不一致:多 %s,少 %s' % (sorted(set(k[len(LAY):] for k in PADLAY)-set(PAD_PAGES)), sorted(set(PAD_PAGES)-set(k[len(LAY):] for k in PADLAY))))
|
||||
def emit(repl, dst, tag, prebuilt=None): # repl → 覆盖层(新 .build.config + 一个新数据档)写到 dst/data | repl → overlay (a new .build.config + one new data archive) written to dst/data
|
||||
repl=to_touch(repl); repl.update(PADLAY)
|
||||
|
||||
+13
-13
@@ -3,26 +3,26 @@
|
||||
# 做进去,再用自签工具整包签名装机——全程不需要 Xcode,也不需要 Mac。
|
||||
# shell_build.sh [ios|mac] ios(缺省)= 真机用的壳;mac = 「Mac 上跑的 iOS 包」变体,只给我们自己在 Mac 上验这条路用
|
||||
# 产物($DM_ROOT/build/shell/<ios|mac>/):
|
||||
# D2RMobile-shell.ipa 壳。里面没有:游戏程序、着色器库、覆盖层、界面素材、任何从游戏文件生成的表
|
||||
# D2RMobile-shell-build-input.zip 壳(构建原料,不能直接安装:不用 .ipa 扩展名,自签工具认不出来;装上去缺游戏内容也只会弹框说明)。里面没有:游戏程序、着色器库、覆盖层、界面素材、任何从游戏文件生成的表
|
||||
# shell_manifest.txt 壳里缺的东西的清单(安装包内路径,一行一个;以 / 结尾 = 整个目录)。d2rm_pack.py 照它核对做全了没有
|
||||
# ref/ 对照:用本机游戏文件生成的那些内容(不发布,只用来核对工具的产出)
|
||||
# 做法:把源码树拷到临时副本里构建,不动当前工作树(三份「从游戏文件生成、编进代码」的文件要换成替身,换在副本里)。
|
||||
# 出壳的这台机器要有游戏文件与全套构建环境(和平时出包一样):要用真实的生成结果定表的大小、定清单。
|
||||
# Build the "shell": an unsigned install package with no game content at all. Users use their own game files (dm/tools/d2rm_pack.py) to put the game program and derived content
|
||||
# into it, then sign the whole package with a sideloading tool and install it -- no Xcode and no Mac needed at any point.
|
||||
# shell_build.sh [ios|mac] ios (default) = the shell for real devices; mac = the "iOS app running on Mac" variant, only for ourselves to verify this path on a Mac
|
||||
# Build outputs ($DM_ROOT/build/shell/<ios|mac>/):
|
||||
# D2RMobile-shell.ipa The shell. Not inside: game program, shader libraries, overlay, UI assets, any table generated from the game files
|
||||
# shell_manifest.txt Manifest of what the shell lacks (paths inside the install package, one per line; ending with / = a whole directory). d2rm_pack.py checks against it whether everything has been made
|
||||
# ref/ Reference: the content generated from this machine's game files (not published, only used to check the tool's output)
|
||||
# Approach: copy the source tree to a temporary copy and build there, leaving the current worktree untouched (the three files "generated from the game files and compiled into the code" have to be replaced with stubs, and the replacing is done in the copy).
|
||||
# The machine that builds the shell must have the game files and the full build environment (same as for a normal package build): the real generation results are needed to fix the table sizes and the manifest.
|
||||
# Build the "shell": an unsigned install package with no game content. Users build the game program and derived content into it from their own game files (dm/tools/d2rm_pack.py),
|
||||
# then sign the whole package with a sideloading tool and install it, with no Xcode and no Mac needed.
|
||||
# shell_build.sh [ios|mac] ios (default) = the shell for devices; mac = the "iOS package running on Mac" variant, only for us to check this path on a Mac
|
||||
# Output ($DM_ROOT/build/shell/<ios|mac>/):
|
||||
# D2RMobile-shell-build-input.zip the shell (build input, not installable: it does not use the .ipa extension so sideloading tools do not recognize it; installed as is, it lacks the game content and only shows a message). It does not contain: the game program, shader library, overlay, UI art, or any table generated from the game files
|
||||
# shell_manifest.txt list of what the shell lacks (paths inside the package, one per line; a trailing / = a whole directory). d2rm_pack.py checks against it that everything was built in
|
||||
# ref/ reference: that content generated from the local game files (not published, only used to check the tool's output)
|
||||
# Method: copy the source tree to a temporary copy and build there, leaving the current work tree alone (three files that are generated from the game files and compiled into the code are replaced with stand-ins, in the copy).
|
||||
# The machine that builds the shell needs the game files and the full build environment (same as a normal build): the real generated results determine the table sizes and the manifest.
|
||||
set -u
|
||||
KIND=${1:-ios}; case $KIND in ios|mac) ;; *) echo "用法:shell_build.sh [ios|mac]"; exit 2;; esac
|
||||
HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd); SRC=$(cd "$HERE/../.." && pwd) # SRC = dm/
|
||||
ROOT=${DM_ROOT:-$HOME/dm-work}; O=$ROOT/build/shell/$KIND; W=$O/tree; DD=$O/dd
|
||||
t() { echo "[$(date +%T)] $*"; }; die() { t "🔴 $*"; exit 1; }
|
||||
mkdir -p "$O" && rm -rf "$W" "$O/ref" "$O/app" "$O/D2RMobile-shell.ipa" "$O/shell_manifest.txt" && mkdir -p "$W" "$O/ref" || die "建不了 $O"
|
||||
mkdir -p "$O" && rm -rf "$W" "$O/ref" "$O/app" "$O/D2RMobile-shell-build-input.zip" "$O/shell_manifest.txt" && mkdir -p "$W" "$O/ref" || die "建不了 $O"
|
||||
rsync -a --exclude '/ios/Gen' --exclude '/ios/DmIOS.xcodeproj' --exclude '.iosdd*' --exclude '/ios/local.env' "$SRC/" "$W/dm/" || die "拷源码树失败"
|
||||
# 壳的包名只是占位:自签工具装机时会换成使用者自己的。团队号同理(不签名,用不到)
|
||||
# The shell's package name is only a placeholder: the sideloading tool replaces it with the user's own at install time. Same for the team ID (not signed, so it is not used)
|
||||
@@ -104,5 +104,5 @@ for d, _, fs in os.walk(app):
|
||||
print('内容核对:%d 个特征串(另有 %d 个是源码里本来就有的,不算)× %d 个文件,命中 %d 个文件' % (len(needles), len(own), sum(len(fs) for _, _, fs in os.walk(app)), bad)); sys.exit(1 if bad else 0)
|
||||
PYEOF
|
||||
( cd "$A" && find . -type f | sort | while read -r f; do printf '%s\t%s\n' "$(stat -f %z "$f")" "$f"; done ) > "$O/shell_files.tsv"
|
||||
( cd "$O" && rm -rf Payload && mkdir Payload && cp -R app Payload/DmIOS.app && zip -qry D2RMobile-shell.ipa Payload && rm -rf Payload ) || die "打包失败"
|
||||
t "壳:$O/D2RMobile-shell.ipa($(du -h "$O/D2RMobile-shell.ipa" | cut -f1),$(wc -l < "$O/shell_files.tsv" | tr -d ' ') 个文件);缺的内容 $(wc -l < "$O/shell_manifest.txt" | tr -d ' ') 项,清单 $O/shell_manifest.txt"
|
||||
( cd "$O" && rm -rf Payload && mkdir Payload && cp -R app Payload/DmIOS.app && zip -qry D2RMobile-shell-build-input.zip Payload && rm -rf Payload ) || die "打包失败"
|
||||
t "壳:$O/D2RMobile-shell-build-input.zip($(du -h "$O/D2RMobile-shell-build-input.zip" | cut -f1),$(wc -l < "$O/shell_files.tsv" | tr -d ' ') 个文件);缺的内容 $(wc -l < "$O/shell_manifest.txt" | tr -d ' ') 项,清单 $O/shell_manifest.txt"
|
||||
|
||||
Reference in New Issue
Block a user