Skip to content

Commit

Permalink
Merge pull request #1220 from EvilJagaGenius/main
Browse files Browse the repository at this point in the history
New Port: Q2Pro
  • Loading branch information
Cebion authored Jan 23, 2025
2 parents b8e7723 + 7df1223 commit fec5fd1
Show file tree
Hide file tree
Showing 108 changed files with 84,806 additions and 0 deletions.
60 changes: 60 additions & 0 deletions ports/q2pro/Q2Pro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
controlfolder="$XDG_DATA_HOME/PortMaster"
else
controlfolder="/roms/ports/PortMaster"
fi

source $controlfolder/control.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls

GAMEDIR="/$directory/ports/q2pro"

cd $GAMEDIR

> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

export LD_LIBRARY_PATH="$GAMEDIR/libs:$LD_LIBRARY_PATH"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
export ANALOGSTICKS="${ANALOGSTICKS:-2}"
export ANALOG_STICKS="${ANALOG_STICKS:-2}"

$ESUDO chmod 777 $GAMEDIR/q2pro
$ESUDO chmod 777 $GAMEDIR/*/gamearm64.so

# Copy control configs on first run
if [ ! -f "firsttime" ]; then
if [[ "$DISPLAY_WIDTH" -lt "640" ]]; then
sed -i 's/seta con_scale "[0-9]*"/seta con_scale "1"/' "$GAMEDIR/${ANALOG_STICKS}stick.cfg"
sed -i 's/seta scr_scale "[0-9]*"/seta scr_scale "1"/' "$GAMEDIR/${ANALOG_STICKS}stick.cfg"
sed -i 's/seta ui_scale "[0-9]*"/seta ui_scale "1"/' "$GAMEDIR/${ANALOG_STICKS}stick.cfg"
fi
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/baseq2/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/ctf/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/rogue/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/xatrix/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/smd/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/zaero/config.cfg"
cp "$GAMEDIR/${ANALOG_STICKS}stick.cfg" "$GAMEDIR/rerelease/config.cfg"
touch firsttime
fi

if [[ "${CFW_NAME^^}" == 'ROCKNIX' ]] || [[ "${CFW_NAME^^}" == 'JELOS' ]]; then
BINARY=q2pro_legacy
else
BINARY=q2pro_glsl
fi

$GPTOKEYB "$BINARY" -c "$GAMEDIR/q2pro.gptk" &
pm_platform_helper "$GAMEDIR/$BINARY"
./$BINARY

pm_finish
42 changes: 42 additions & 0 deletions ports/q2pro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Notes

Source: [EvilJagaGenius](https://github.com/EvilJagaGenius/q2pro-pm)
Forked from: [skullernet](https://github.com/skullernet/q2pro)

Place the contents from the folders of your Quake 2 install to the matching folders in ports/q2pro/. If you have the Nightdive remaster, add the contents of its baseq2/ folder to ports/q2pro/rerelease/, and copy Q2Game.kpf to ports/q2pro/.

Credit and thanks to Andrey Nazarov (Skuller) for Q2Pro. Many thanks to Slayer366 as well for testing and help with scripts.

| Action | No-stick | 1-stick | 2-stick |
|--|--|--|--|
| Move | D-pad | Left stick | Left stick |
| Look | ABXY | ABXY | Right stick |
| Shoot | R1 | R1 | R1 |
| Jump | L1 | L1 | L1, A |
| Crouch | L2 | L2 | L2, B |
| Zoom | N/A | R2 | R2 |
| Inventory | R2+D-pad | D-pad | D-pad, X, Y |
| Menu | Start | Start | Start |
| Help computer | Select | Select | Select |

Build instructions:
```shell
git clone https://github.com/EvilJagaGenius/q2pro-pm
cd q2pro-pm
meson setup builddir
meson configure -Dsystem-wide=false builddir
meson configure -Dlibcurl=disabled builddir
meson configure -Dx11=disabled builddir
meson configure -Dwayland=disabled builddir
meson configure -Dsdl2=enabled builddir
meson compile -C builddir
```
To enable Wayland (e.g. Rocknix):
```shell
meson configure -Dwayland=enabled builddir
```
To use the legacy (GLES 1) renderer instead of GLSL:
```shell
meson configure -Dopengl-es1=true builddir
```

Binary file added ports/q2pro/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions ports/q2pro/gameinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<gameList>
<game>
<path>./Q2Pro.sh</path>
<name>Q2Pro</name>
<desc>Enhanced Quake 2 engine with work-in-progress support for the Nightdive remaster. Includes support for mods/mission packs The Reckoning, Ground Zero, Zaero, and the Nightdive remaster.</desc>
<developer>id Software, Skuller (Andrey Nazarov)</developer>
<genre>FPS</genre>
<image>./q2pro/cover.png</image>
</game>
</gameList>
31 changes: 31 additions & 0 deletions ports/q2pro/port.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": 3,
"name": "q2pro.zip",
"items": [
"Q2Pro.sh",
"q2pro"
],
"items_opt": [],
"attr": {
"title": "Q2Pro",
"porter": [
"EvilJagaGenius",
"Slayer366"
],
"desc": "Enhanced Quake 2 engine with work-in-progress support for the Nightdive remaster. Includes support for mods/mission packs The Reckoning, Ground Zero, Zaero, and the Nightdive remaster.",
"desc_md": null,
"inst": "Copy the files from your Quake 2 installation to the matching folders in ports/q2pro. For example, copy the contents of Quake 2/baseq2 into ports/q2pro/baseq2. If you have the Nightdive remaster, copy the contents of its baseq2 folder (Quake 2/rerelease/baseq2) into ports/q2pro/rerelease, and copy Q2Game.kpf to ports/q2pro.",
"inst_md": null,
"genres": [
"fps"
],
"image": null,
"rtr": false,
"exp": false,
"runtime": null,
"reqs": [],
"arch": [
"aarch64"
]
}
}
136 changes: 136 additions & 0 deletions ports/q2pro/q2pro/0stick.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// generated by q2pro, do not modify
bind BACKSPACE "help"
bind TAB "inven"
bind ENTER "invuse"
bind PAUSE "pause"
bind ESCAPE "togglemenu"
bind SPACE "+moveup"
bind ' "invdrop"
bind + "sizeup"
bind , "+moveleft"
bind - "sizedown"
bind . "+moveright"
bind / "weapnext"
bind 0 "use BFG10K"
bind 1 "use Blaster"
bind 2 "use Shotgun"
bind 3 "use Super Shotgun"
bind 4 "use Machinegun"
bind 5 "use Chaingun"
bind 6 "use Grenade Launcher"
bind 7 "use Rocket Launcher"
bind 8 "use HyperBlaster"
bind 9 "use Railgun"
bind = "sizeup"
bind [ "invprev"
bind \ "+mlook"
bind ] "invnext"
bind ` "toggleconsole"
bind a "+right"
bind b "+lookdown"
bind c "+movedown"
bind e "use environment suit"
bind g "use grenades"
bind h "wave 0"
bind i "use invulnerability"
bind j "wave 1"
bind k "wave 2"
bind l "+movedown"
bind p "use power shield"
bind q "use quad damage"
bind r "+inventorybinds"
bind s "use silencer"
bind t "messagemode"
bind u "wave 4"
bind x "+lookup"
bind y "+left"
bind z "+lookdown"
bind ~ "toggleconsole"
bind DEL "+lookdown"
bind UPARROW "+forward"
bind DOWNARROW "+back"
bind LEFTARROW "+moveleft"
bind RIGHTARROW "+moveright"
bind ALT "+strafe"
bind CTRL "+attack"
bind SHIFT "+speed"
bind F1 "cmd help"
bind F2 "menu_savegame"
bind F3 "menu_loadgame"
bind F4 "menu_keys"
bind F5 "menu_startserver"
bind F6 "echo Quick Saving...; wait; save quick"
bind F9 "echo Quick Loading...; wait; load quick"
bind F10 "menu_quit"
bind F12 "screenshot"
bind INS "+klook"
bind PGDN "+lookup"
bind END "centerview"
bind MOUSE1 "+attack"
bind MOUSE2 "+moveup"
bind MOUSE3 "+forward"
seta _ui_nextserver "q2dm1"
seta _vid_fullscreen "1"
seta adr0 ""
seta adr1 ""
seta adr10 ""
seta adr11 ""
seta adr12 ""
seta adr13 ""
seta adr14 ""
seta adr15 ""
seta adr2 ""
seta adr3 ""
seta adr4 ""
seta adr5 ""
seta adr6 ""
seta adr7 ""
seta adr8 ""
seta adr9 ""
seta allow_download "1"
seta allow_download_maps "1"
seta allow_download_models "1"
seta allow_download_pics "1"
seta allow_download_players "1"
seta allow_download_sounds "1"
seta allow_download_textures "1"
seta cl_run "1"
seta cl_vwep "1"
seta con_scale "2"
seta crosshair "1"
seta fov "90"
seta freelook "1"
seta g_select_empty "0"
seta gender "male"
seta gender_auto "1"
seta gl_brightness "0.120000"
seta gl_celshading "0"
seta gl_coloredlightmaps "0.200000"
seta gl_modulate "1"
seta gl_partshape "1"
seta gl_partstyle "1"
seta gl_shadows "1"
seta gl_swapinterval "1"
seta gl_texturemode "GL_NEAREST"
seta hand "0"
seta hostname "noname"
seta lookspring "1"
seta lookstrafe "0"
seta m_pitch "0.022"
seta msg "1"
seta name "Player"
seta ogg_enable "1"
seta ogg_volume "0.300000"
seta rate "15000"
seta s_enable "2"
seta s_khz "44"
seta s_mixahead "0.1"
seta s_volume "0.7"
seta scr_scale "2"
seta sensitivity "3"
seta skin "male/grunt"
seta ui_scale "2"
seta vid_fullscreen "1"
seta vid_gamma "1"
seta vid_geometry "640x480"
seta viewsize "100"
Loading

0 comments on commit fec5fd1

Please sign in to comment.