Skip to content

Commit

Permalink
Merge pull request #427 from Cebion/cavepacker
Browse files Browse the repository at this point in the history
New Port: Cave Packer
  • Loading branch information
kloptops authored May 23, 2024
2 parents b45a16c + 1fec4d5 commit 458bc17
Show file tree
Hide file tree
Showing 2,085 changed files with 21,413 additions and 0 deletions.
47 changes: 47 additions & 0 deletions ports/cavepacker/Cave Packer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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
source $controlfolder/device_info.txt

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

get_controls

GAMEDIR=/$directory/ports/cavepacker
CONFDIR="$GAMEDIR/conf/"

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

mkdir -p "$GAMEDIR/conf"

# For Ports that use gptokeyb's xbox360 mode, interactive input or config-mode
$ESUDO chmod 666 /dev/uinput

export XDG_DATA_HOME="$CONFDIR"
export DEVICE_ARCH="${DEVICE_ARCH:-aarch64}"
export LD_LIBRARY_PATH="$GAMEDIR/libs.${DEVICE_ARCH}:$LD_LIBRARY_PATH"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
#export TEXTINPUTINTERACTIVE="Y"

# $ESUDO rm -rf ~/.config/warmux
# ln -sfv /$directory/ports/warmux/conf/.config/warmux ~/

cd $GAMEDIR

$GPTOKEYB "cavepacker" -c "./cavepacker.gptk" &
./cavepacker

$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0
31 changes: 31 additions & 0 deletions ports/cavepacker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Notes
Thanks to the [Chris Mohler and Martin Gerhardy](http://www.caveproductions.org/) for creating this game and making it available for free!

## Controls

| Button | Action |
|--|--|
|DPAD| Move|


## Compile

```shell
dget -u http://deb.debian.org/debian/pool/main/c/caveexpress/caveexpress_2.5.2-1.dsc
cd caveexpress-2.5.2/
mkdir build && cd build

rewrite initControllerAndHaptic function in src/modules/gfx/SDLFrontend.cpp to:

void SDLFrontend::initControllerAndHaptic ()
{
// Log controller initialization attempt
Log::info(LOG_GFX, "Controller initialization has been skipped.");

// Immediately exit the function without initializing controllers or haptics
return;
}

cmake .
make
```
39 changes: 39 additions & 0 deletions ports/cavepacker/cavepacker/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Copyright 2014-2016, Martin Gerhardy [email protected]

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License along with
this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
St, Fifth Floor, Boston, MA 02110-1301 USA

All artwork and assets are licensed under the Creative Commons
Attribution-ShareAlike 4.0 International license (CC-BY-SA-4.0).

In addition this project incorporates third party software which is differently
licensed:

Files: src/libs/cJSON/*
Copyright: 2009, Dave Gamble
License: MIT/Expat

Files: src/libs/SDL/include/*
Copyright: 2013-2014, The Khronos Group Inc.
License: MIT/Expat

Files: src/caveexpress/server/entities/Buoyancy.h
Copyright: 2006-2011, Erin Catto http://www.box2d.org
License: zlib

Please also add the full license text of the GPL-3 and CC-BY-SA-4.0 license to
the repository and the release tarball.

Please note that the licenses of the external dependencies that are available
under src/libs are not explicitly stated here, a packager should rely on the
distribution packages.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- create a new campaign
local c = Campaign.new("tutorial")
-- set an ingame icon for this campaign
c:setSetting("icon", "icon-campaign")
-- set the on screen message when this campaign is activated
c:setSetting("text", "Tutorial")
-- set the achievement id that you unlock once you finished this campaign
c:setSetting("achievement", "achievement_finished_tutorials")
-- now add all maps
c:addMaps("tutorial*")
c:unlock()
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- create a new campaign
local c = Campaign.new("xsokoban")
-- set an ingame icon for this campaign
c:setSetting("icon", "xsokoban-campaign")
-- set the on screen message when this campaign is activated
c:setSetting("text", "XSokoban")
-- set the achievement id that you unlock once you finished this campaign
c:setSetting("achievement", "achievement_finished_xsokoban")
-- now add all maps
c:addMaps("xsokoban*")
c:unlock()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- create a new campaign
local c = Campaign.new("ksokoban")
-- set an ingame icon for this campaign
c:setSetting("icon", "ksokoban-campaign")
-- set the on screen message when this campaign is activated
c:setSetting("text", "KSokoban")
-- set the achievement id that you unlock once you finished this campaign
c:setSetting("achievement", "achievement_finished_the_grigorusha_campaign")
-- now add all maps
c:addMaps("microban*")
c:addMaps("sasquatch*")
c:unlock()
11 changes: 11 additions & 0 deletions ports/cavepacker/cavepacker/base/cavepacker/campaigns/03-gri.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- create a new campaign
local c = Campaign.new("gri")
-- set an ingame icon for this campaign
c:setSetting("icon", "gri-campaign")
-- set the on screen message when this campaign is activated
c:setSetting("text", "gri")
-- set the achievement id that you unlock once you finished this campaign
c:setSetting("achievement", "achievement_finsihed_the_gri_campaign")
-- now add all maps
c:addMaps("gri*")
c:unlock()
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- create a new campaign
local c = Campaign.new("mgerhardy")
-- set an ingame icon for this campaign
c:setSetting("icon", "mgerhardy-campaign")
-- set the on screen message when this campaign is activated
c:setSetting("text", "mgerhardy")
-- set the achievement id that you unlock once you finished this campaign
c:setSetting("achievement", "achievement_finsihed_the_mgerhardy_campaign")
-- now add all maps
c:addMaps("mgerhardy*")
c:unlock()
185 changes: 185 additions & 0 deletions ports/cavepacker/cavepacker/base/cavepacker/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
function isMobile()
return (isAndroid() or isIOS()) and not isOUYA();
end

defaultwidth = -1
defaultheight = -1
defaultfullscreen = true
defaultpersister = "sqlite"
defaultfrontend = "sdl"
defaultsoundengine = "sdl"
defaultshowcursor = true
defaultnetwork = true
defaultgamecontroller = false
defaulttexturesize = "auto"
defaultparticles = 100
defaultfpslimit = 60
defaultred = 8
defaultgreen = 8
defaultblue = 8

if isOUYA() then
defaultgamecontroller = true
defaultparticles = 0
defaultred = 6
defaultgreen = 5
defaultblue = 6
elseif isSteamLink() then
defaultwidth = 1280
defaultheight = 720
defaultgamecontroller = true
defaultparticles = 0
defaultnetwork = true
defaultshowcursor = false
elseif isAndroid() then
defaultshowcursor = false
defaultparticles = 0
defaultfpslimit = 30
rendertotexture = 0
defaultpersister = "googleplay"
defaultred = 6
defaultgreen = 5
defaultblue = 6
elseif isIOS() then
defaultshowcursor = false
defaultparticles = 0
defaultfpslimit = 30
rendertotexture = 0
defaultred = 6
defaultgreen = 5
defaultblue = 6
elseif isMobile() then
defaultshowcursor = false
defaultparticles = 0
defaultfpslimit = 30
elseif isHTML5() then
defaultnetwork = false
defaultfrontend = "opengl"
defaultsoundengine = "dummy"
elseif isNaCl() then
defaultpersister = "nop"
defaultnetwork = false
else
defaultgamecontroller = true
end

settings = {
width = defaultwidth,
height = defaultheight,
fullscreen = defaultfullscreen,
frontend = defaultfrontend,
port = 45678,
grabmouse = true,
showcursor = defaultshowcursor,
debug = false,
showfps = not isMobile(),
gamecontroller = defaultgamecontroller,
gamecontrollertriggeraxis = false,
sound = true,
soundengine = defaultsoundengine,
persister = defaultpersister,
network = defaultnetwork,
fpslimit = defaultfpslimit,
texturesize = defaulttexturesize,
particles = defaultparticles,
red = defaultred,
green = defaultgreen,
blue = defaultblue,
}

controllerbindings = {
["ui"] = {
A = "ui_execute",
B = "ui_pop",
--X = "ui_pop",
--Y = "ui_pop",
BACK = "ui_pop",
--GUIDE = "",
--START = "",
--LEFTSTICK = "",
--RIGHTSTICK = "",
--LEFTSHOULDER = "",
--RIGHTSHOULDER = "",
DPUP = "ui_focus_prev",
DPDOWN = "ui_focus_next",
DPLEFT = "ui_focus_prev",
DPRIGHT = "ui_focus_next",
},
["map"] = {
--A = "",
--B = "",
--X = "ui_pop",
--Y = "ui_pop",
BACK = "ui_pop",
--GUIDE = "",
START = "ui_pop",
LEFTSTICK = "+move_left",
RIGHTSTICK = "+move_right",
LEFTSHOULDER = "+zoom 0.1",
RIGHTSHOULDER = "+zoom -0.1",
DPUP = "+move_up",
DPDOWN = "+move_down",
DPLEFT = "+move_left",
DPRIGHT = "+move_right",
},
}

if isMobile() or isOUYA() then
keybindings = {
["ui"] = {
AC_BACK = "ui_pop",
},
["map"] = {
MENU = "ui_push settings",
AC_BACK = "ui_pop",
},
}

if isOUYA() then
keybindings["ui"]["PAUSE"] = "ui_pop"
keybindings["map"]["PAUSE"] = "ui_pop"
end
else
keybindings = {
["ui"] = {
LEFT = "ui_focus_prev",
RIGHT = "ui_focus_next",
UP = "ui_focus_prev +",
DOWN = "ui_focus_next -",
A = "ui_focus_prev",
D = "ui_focus_next",
W = "ui_focus_prev +",
S = "ui_focus_next -",
SPACE = "ui_execute",
RETURN = "ui_execute",
ESCAPE = "ui_pop",
TAB = "ui_focus_next",
},
["map"] = {
LEFT = "+move_left",
RIGHT = "+move_right",
UP = "+move_up",
DOWN = "+move_down",
A = "+move_left",
D = "+move_right",
W = "+move_up",
S = "+move_down",
SPACE = "ui_pop",
RETURN = "ui_pop",
ESCAPE = "ui_pop",
TAB = "ui_focus_next",
PAGEDOWN = "zoom -0.1",
PAGEUP = "zoom 0.1",
},
}

keybindings["map"]["U"] = "undo"
keybindings["map"]["BACKSPACE"] = "undo"
keybindings["ui"]["."] = "screenshot"
keybindings["map"]["."] = "screenshot"
keybindings["map"]["S"] = "solve"

if isDebug() then
keybindings["map"]["F"] = "finish"
end
end
Loading

0 comments on commit 458bc17

Please sign in to comment.