12
12
rp_module_id=" yquake2"
13
13
rp_module_desc=" yquake2 - The Yamagi Quake II client"
14
14
rp_module_licence=" GPL2 https://raw.githubusercontent.com/yquake2/yquake2/master/LICENSE"
15
- rp_module_repo=" git https://github.com/yquake2/yquake2.git QUAKE2_8_41 "
15
+ rp_module_repo=" git https://github.com/yquake2/yquake2.git QUAKE2_8_50 "
16
16
rp_module_section=" exp"
17
- rp_module_flags=" "
17
+ rp_module_flags=" sdl2 "
18
18
19
19
function depends_yquake2() {
20
20
local depends=(libgl1-mesa-dev libglu1-mesa-dev libogg-dev libopenal-dev libsdl2-dev libvorbis-dev zlib1g-dev libcurl4-openssl-dev)
@@ -25,15 +25,27 @@ function depends_yquake2() {
25
25
function sources_yquake2() {
26
26
gitPullOrClone
27
27
# get the add-ons sources
28
- gitPullOrClone " $md_build /xatrix" " https://github.com/yquake2/xatrix" " XATRIX_2_13"
29
- gitPullOrClone " $md_build /rogue" " https://github.com/yquake2/rogue" " ROGUE_2_12"
28
+ gitPullOrClone " $md_build /xatrix" " https://github.com/yquake2/xatrix" " XATRIX_2_14"
29
+ gitPullOrClone " $md_build /rogue" " https://github.com/yquake2/rogue" " ROGUE_2_13"
30
+
31
+ # 1st enables Guide+Start to quit. 2nd restores buttons to SDL2 style (from SDL3).
32
+ applyPatch " $md_data /hotkey_exit.diff"
33
+ applyPatch " $md_data /sdl2_joylabels.diff"
30
34
}
31
35
32
36
function build_yquake2() {
37
+ local params=(config client game ref_soft)
38
+ local repo
39
+
40
+ isPlatform " gl" || isPlatform " mesa" && params+=(ref_gl1)
41
+ isPlatform " gl3" && params+=(ref_gl3)
42
+ isPlatform " gles" && [[ " $__os_debian_ver " -lt 12 ]] && params+=(ref_gles1)
43
+ isPlatform " gles3" && params+=(ref_gles3)
44
+
33
45
make clean
34
- make
46
+ make ${params[@]}
47
+
35
48
# build the add-ons source
36
- local repo
37
49
for repo in ' xatrix' ' rogue' ; do
38
50
make -C " $repo " clean
39
51
make -C " $repo "
@@ -46,32 +58,32 @@ function build_yquake2() {
46
58
function install_yquake2() {
47
59
md_ret_files=(
48
60
' release/baseq2'
49
- ' release/q2ded'
50
61
' release/quake2'
51
- ' release/ref_gl1.so'
52
- ' release/ref_gl3.so'
53
62
' release/ref_soft.so'
54
63
' LICENSE'
55
64
' README.md'
56
65
' xatrix/xatrix'
57
66
' rogue/rogue'
58
67
)
68
+
69
+ isPlatform " gl" || isPlatform " mesa" && md_ret_files+=(' release/ref_gl1.so' )
70
+ isPlatform " gl3" && md_ret_files+=(' release/ref_gl3.so' )
71
+ isPlatform " gles" && [[ " $__os_debian_ver " -lt 12 ]] && md_ret_files+=(' release/ref_gles1.so' )
72
+ isPlatform " gles3" && md_ret_files+=(' release/ref_gles3.so' )
59
73
}
60
74
61
75
function add_games_yquake2() {
62
76
local cmd=" $1 "
63
77
declare -A games=(
64
- [' baseq2/pak0 ' ]=" Quake II"
65
- [' rogue/pak0 ' ]=" Quake II - Ground Zero "
66
- [' xatrix/pak0 ' ]=" Quake II - The Reckoning "
78
+ [' baseq2' ]=" Quake II"
79
+ [' xatrix ' ]=" Quake II XP1 - The Reckoning "
80
+ [' rogue ' ]=" Quake II XP2 - Ground Zero "
67
81
)
68
82
69
83
local game
70
- local pak
71
84
for game in " ${! games[@]} " ; do
72
- pak=" $romdir /ports/quake2/$game .pak"
73
- if [[ -f " $pak " ]]; then
74
- addPort " $md_id " " quake2" " ${games[$game]} " " $cmd " " ${game%%/* } "
85
+ if [[ -f " $romdir /ports/quake2/$game /pak0.pak" ]]; then
86
+ addPort " $md_id " " quake2" " ${games[$game]} " " $cmd " " $game "
75
87
fi
76
88
done
77
89
}
@@ -92,24 +104,30 @@ function game_data_yquake2() {
92
104
93
105
94
106
function configure_yquake2() {
95
- local params=()
107
+ local config=" $md_conf_root /quake2/yquake2/baseq2/yq2.cfg"
108
+ local renderer=" soft"
109
+
110
+ mkRomDir " ports/quake2"
111
+
112
+ moveConfigDir " $home /.yq2" " $md_conf_root /quake2/yquake2"
113
+ mkUserDir " $md_conf_root /quake2/yquake2/baseq2"
114
+
115
+ copyDefaultConfig " $md_data /yq2.cfg" " $config "
116
+ iniConfig " " ' "' " $config "
96
117
97
118
if isPlatform " gl3" ; then
98
- params+=(" +set vid_renderer gl3" )
119
+ renderer=" gl3"
120
+ elif isPlatform " gles3" ; then
121
+ renderer=" gles3"
122
+ elif isPlatform " gles" && [[ " $__os_debian_ver " -lt 11 ]]; then
123
+ renderer=" gles1"
124
+ iniSet " set gl1_pointparameters" " 1"
99
125
elif isPlatform " gl" || isPlatform " mesa" ; then
100
- params+=(" +set vid_renderer gl1" )
101
- else
102
- params+=(" +set vid_renderer soft" )
103
- fi
104
-
105
- if isPlatform " kms" ; then
106
- params+=(" +set r_mode -1" " +set r_customwidth %XRES%" " +set r_customheight %YRES%" " +set r_vsync 1" )
126
+ renderer=" gl1"
107
127
fi
108
128
109
- mkRomDir " ports/quake2"
110
-
111
- moveConfigDir " $home /.yq2" " $md_conf_root /quake2/yquake2"
129
+ iniSet " set vid_renderer" " $renderer "
112
130
113
131
[[ " $md_mode " == " install" ]] && game_data_yquake2
114
- add_games_yquake2 " $md_inst /quake2 -datadir $romdir /ports/quake2 ${params[*]} +set game %ROM%"
132
+ add_games_yquake2 " $md_inst /quake2 -datadir $romdir /ports/quake2 +set game %ROM%"
115
133
}
0 commit comments