debian/0000755000000000000000000000000012116134624007166 5ustar debian/vodovod.60000644000000000000000000000515412115223443010737 0ustar .\" (c) 2007 Miriam Ruiz .\" .\" This document 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 2 of the License, or .\" (at your option) any later version. .\" .\" This package 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 .TH "vodovod" "6" "May 2007" "" "Games" .SH "NAME" vodovod \- lead the water from the house to the storage tank .SH "SYNOPSIS" .B vodovod .SH "DESCRIPTION" Vodovod is a free game, released under GNU GPL license. Graphics and programming are done by Milan Babuskov. This is an over\-weekend project for now, so don't expect miracles. However, game is completely playable. The goal of the game is to reach the highest possible score. You get a limited number of pipes on each level and need to combine them to lead the water from the house at the top of the screen to the storage tank at the bottom. For each pipe water goes through, you get 20 points and if you fill the cross\-pipe both ways, you get 60 points. At end of each level, you are awarded depending on the skill level: * Beginner: 100 points * Toolman: 100 points + number of pipes remaining * Master plumber: 100 points + 2 x number of pipes remaining Some of the levels have obstacles where you cannot place pipes, checkpoints through which the water must go and holes in the ground that slow the flow. Select HELP from the main menu to get more info. The game is playable with joystick/joypad: just move it and press buttons when you go to Options \-> Configure controls .SH "USAGE" The goal of the game is to use pipes to connect the house at the top of the screen with the tank at the bottom. You have time to construct the initial pipeline before the man enters the house. .PP For each level you get a limited number of pipes, so use them wisely. If you make a mistake, you can place another pipe over it. .PP There are certain special blocks in the map: * Blocked Area \- You cannot place pipes on these fields. * Checkpoint \- Your pipeline must go through this field. * Hole in the ground \- Slows down the flow. .SH "SEE ALSO" You can find more information at http://home.gna.org/vodovod/ debian/vodovod.desktop0000644000000000000000000000066112116127573012251 0ustar [Desktop Entry] Type=Application Version=1.0 Name=Vodovod GenericName=Puzzle Game GenericName[de]=Puzzlespiel Comment=Vodovod is a puzzle game in which you must lead the water to the storage tank. Comment[de]=Vodovod ist ein Puzzlespiel, in welchem Sie das Wasser zum Auffangbehälter leiten müssen. Icon=vodovod.xpm Exec=vodovod Terminal=false StartupNotify=false Categories=Game;LogicGame; Keywords=game;pipes;puzzle;water;logic; debian/changelog0000644000000000000000000000533012116127623011042 0ustar vodovod (1.10-3) unstable; urgency=low * Team upload. [ Markus Koschany ] * Switch to package format 3.0 (quilt). * Bump compat level to 9 and require debhelper >= 9. * Update debian/copyright to copyright format 1.0. * Add longtitle to Debian menu. Change section to Games/Puzzles. * Simplify debian/rules by using dh sequencer. * Build with --parallel. * Enable all hardening build flags. * debian/control: - Update Standards-Version to 3.9.4, no changes needed. - Remove quilt build dependency, format 3.0 uses quilt by default. - Use canonical Vcs-fields. * vodovod.desktop: Add keywords and comments in English and German. Change Categories key to Game;LogicGame. * debian/patches: - Add dep3 headers to all patches. - Add fix-format-not-a-string-literal-error.patch which prevents a FTBFS. - Add hardening-support.patch which enables Debian's hardening features via dpkg-buildflags. - Improve user_files.patch. Remove all PATH_MAX declarations. Instead use a fixed buffer of 1024 bytes which allows the game to build on GNU/Hurd. Do not overwrite hiscore.dat with default values at every startup thus users can permanently save their achievements. (LP: #381908) [ Paul Wise ] * Fix minor typo in description (Closes: #587498) -- Markus Koschany Wed, 06 Mar 2013 19:22:05 +0100 vodovod (1.10-2) unstable; urgency=low [ Marco Rodrigues ] * Changed debian/control priority from extra to optional. * Add Homepage field in the control file. [ Eddy Petrișor ] * Removed invalid category "Application". [ Jon Dowland ] * Update menu section to "Games/Action" for menu policy transition. Thanks Linas Žvirblis. [ Cyril Brulebois ] * Add Vcs-Svn and Vcs-Browser fields in the control file. * Remove Marco Rodrigues from the Uploaders field. * Fix FTBFS with gcc-4.3 (Closes: #455114) by adding the following patch: + fix-FTBFS-with-gcc-4.3.patch. * Call dh_desktop since a .desktop file is shipped. * Remove debian/docs (containing only the CHANGES file), and use a dh_installchangelogs call instead, so that the file gets an appropriate filename (changelog.gz). [ Barry deFreese ] * Re-fix the watch file. * Make clean not ignore errors. * Remove deprecated encoding from desktop file and path from exec. * Bump Standards-Version to 3.7.3. -- Miriam Ruiz Fri, 29 Feb 2008 00:23:54 +0100 vodovod (1.10-1) unstable; urgency=low * New Upstream Release. -- Miriam Ruiz Wed, 13 Jun 2007 08:41:03 +0000 vodovod (1.05-1) unstable; urgency=low * Initial release (Closes: #427976) -- Miriam Ruiz Thu, 07 Jun 2007 13:35:46 +0000 debian/manpages0000644000000000000000000000002112115224516010674 0ustar debian/vodovod.6 debian/rules0000755000000000000000000000035712115404476010257 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ --parallel override_dh_auto_build: $(MAKE) DATADIR=/usr/share/games/vodovod override_dh_installchangelogs: dh_installchangelogs CHANGES debian/watch0000644000000000000000000000031212115231146010207 0ustar # Watch control file for uscan # See uscan(1) for format # Compulsory line, this is a version 3 file version=3 http://download.gna.org/vodovod/vodovod-(.*)-src\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) debian/menu0000644000000000000000000000032612115255351010056 0ustar ?package(vodovod):needs="X11" \ section="Games/Puzzles" \ title="Vodovod" \ longtitle="Vodovod - lead the water to the storage tank" \ command="/usr/games/vodovod" \ icon="/usr/share/pixmaps/vodovod.xpm" debian/install0000644000000000000000000000017212115226526010561 0ustar data/* usr/share/games/vodovod debian/*.desktop usr/share/applications/ debian/*.xpm usr/share/pixmaps/ vodovod usr/games debian/compat0000644000000000000000000000000212115226346010366 0ustar 9 debian/control0000644000000000000000000000167212115226616010601 0ustar Source: vodovod Section: games Priority: optional Maintainer: Debian Games Team Uploaders: Miriam Ruiz Build-Depends: debhelper (>= 9), libsdl-image1.2-dev, libsdl-mixer1.2-dev, libsdl1.2-dev Standards-Version: 3.9.4 Homepage: http://home.gna.org/vodovod/ Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/vodovod/ Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-games/packages/trunk/vodovod/ Package: vodovod Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Description: puzzle game, you must lead the water to the storage tank Vodovod is a game similar to Pipe Mania and Pipe Dream, in which you have to lead the water from the house to the storage tank. You get a limited number of pipes on each level and need to combine them to lead the water from the house at the top of the screen to the storage tank at the bottom. It has joystick/joypad support. debian/copyright0000644000000000000000000000253712116130251011120 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Vodovod Source: http://home.gna.org/vodovod Files: * Copyright: 2007, Milan Babuškov License: GPL-2+ Files: debian/* Copyright: 2007-2008, Miriam Ruiz 2008, Cyril Brulebois, Barry deFreese, Jon Dowland Eddy Petrișor, Marco Rodrigues 2010, Paul Wise 2013, Markus Koschany License: GPL-2+ License: GPL-2+ 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 2 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 program; if not, write to the Free Software Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. . On Debian systems, the complete text of the GNU General Public License, version 2, can be found in /usr/share/common-licenses/GPL-2. debian/vodovod.xpm0000644000000000000000000000674012115223443011400 0ustar /* XPM */ static char *dummy[]={ "32 32 83 2", "Qt c #000000", ".j c #b80000", ".i c #b80101", ".1 c #b80303", ".2 c #b90404", ".c c #b90707", "#p c #bb0d0d", ".y c #bb0e0e", ".w c #bc0f0f", ".A c #bd1313", ".R c #be1717", ".P c #be1818", ".T c #bf1a1a", ".V c #bf1b1b", ".n c #c12222", ".8 c #c12323", ".p c #c22424", ".d c #c22525", "#l c #c32b2b", "#f c #c42d2d", "#g c #c42e2e", ".o c #c53030", ".b c #c73636", ".f c #c73939", ".F c #c83c3c", ".s c #c83d3d", "#k c #ca4141", ".K c #ca4444", ".N c #cb4545", ".Y c #cc4b4b", ".X c #cd4c4c", ".3 c #ce5050", ".4 c #ce5151", "#b c #d15b5b", "#c c #d15c5c", ".u c #d46767", ".t c #d46868", "#o c #d66f6f", ".E c #d87373", ".G c #d87474", ".M c #d87575", ".L c #d87676", ".W c #db7f7f", ".Z c #db8080", ".9 c #de8a8a", "#. c #de8b8b", "#i c #e29898", "#h c #e29999", ".C c #e4a0a0", ".B c #e4a1a1", ".v c #e5a2a2", ".e c #e5a3a3", ".h c #e5a4a4", ".m c #e6a7a7", ".O c #e8adad", ".S c #e8aeae", ".U c #e8afaf", ".l c #e9b1b1", ".k c #e9b2b2", ".a c #eab5b5", ".g c #eab7b7", ".5 c #ebb9b9", ".6 c #ebbaba", "#d c #eec4c4", "#e c #eec5c5", ".r c #f0caca", ".q c #f0cbcb", ".J c #f4d8d8", ".I c #f4d9d9", ".H c #f4dbdb", ".0 c #f7e4e4", "#q c #f7e5e5", "## c #f9ebeb", "#a c #f9ecec", ".x c #fcf5f5", "#n c #fcf6f6", ".z c #fcf7f7", ".D c #fdf8f8", "#m c #fdfafa", ".Q c #fdfbfb", "#j c #fefdfd", ".7 c #fefefe", ".# c #ffffff", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", "Qt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.a.b.c.d.e.#.#.#.#.#.#.#.#.#.#.e.d.c.f.g.#.#.#.#.#Qt", "Qt.#.#.#.#.h.i.j.j.j.j.k.#.#.#.#.#.#.#.#.l.j.j.j.j.i.m.#.#.#.#Qt", "Qt.#.#.#.#.n.j.j.j.j.j.o.#.#.#.#.#.#.#.#.o.j.j.j.j.j.p.#.#.#.#Qt", "Qt.#.#.#.#.c.j.j.j.j.j.j.q.#.#.#.#.#.#.r.j.j.j.j.j.j.c.#.#.#.#Qt", "Qt.#.#.#.#.s.j.j.j.j.j.j.t.#.#.#.#.#.#.u.j.j.j.j.j.j.s.#.#.#.#Qt", "Qt.#.#.#.#.v.j.j.j.j.j.j.w.x.#.#.#.#.x.y.j.j.j.j.j.j.e.#.#.#.#Qt", "Qt.#.#.#.#.z.A.j.j.j.j.j.j.B.#.#.#.#.C.j.j.j.j.j.j.A.D.#.#.#.#Qt", "Qt.#.#.#.#.#.E.j.j.j.j.j.j.s.#.#.#.#.F.j.j.j.j.j.j.G.#.#.#.#.#Qt", "Qt.#.#.#.#.#.H.i.j.j.j.j.j.j.I.#.#.J.j.j.j.j.j.j.i.H.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.K.j.j.j.j.j.j.L.#.#.M.j.j.j.j.j.j.N.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.O.j.j.j.j.j.j.P.Q.Q.R.j.j.j.j.j.j.S.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.Q.T.j.j.j.j.j.j.U.S.j.j.j.j.j.j.V.Q.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.W.j.j.j.j.j.j.X.Y.j.j.j.j.j.j.Z.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.0.1.j.j.j.j.j.1.1.j.j.j.j.j.2.0.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.3.j.j.j.j.j.j.j.j.j.j.j.j.4.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.5.j.j.j.j.j.j.j.j.j.j.j.j.6.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.7.8.j.j.j.j.j.j.j.j.j.j.p.7.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.9.j.j.j.j.j.j.j.j.j.j#..#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.###.c.j.j.j.j.j.j.j.j.c#a.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.##b.j.j.j.j.j.j.j.j#c.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.##d.j.j.j.j.j.j.j.j#e.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.##f.j.j.j.j.j.j#g.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.##h.j.j.j.j.j.j#i.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.##j#k.j.j.j.j#l#m.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.#.##n#o.R#p.3#q.#.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", "Qt.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#Qt", "QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"}; debian/source/0000755000000000000000000000000012115230522010457 5ustar debian/source/format0000644000000000000000000000001412115230522011665 0ustar 3.0 (quilt) debian/patches/0000755000000000000000000000000012116134526010616 5ustar debian/patches/user_files.patch0000644000000000000000000000711312115246027014000 0ustar From: Debian Games Team Date: Tue, 5 Mar 2013 00:30:39 +0100 Subject: user_files --- config.cpp | 27 +++++++++++++++++++++++++-- hiscore.cpp | 29 ++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/config.cpp b/config.cpp index 89a748f..3b156ee 100644 --- a/config.cpp +++ b/config.cpp @@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include +#include +#include +#include #include "config.h" //------------------------------------------------------------------------------ using namespace std; @@ -155,7 +158,19 @@ Config::~Config() //----------------------------------------------------------------------------- bool Config::save() { - std::ofstream file("vodovod.conf"); + char vodovod_conf[1024]; + +#ifndef _WIN32 + char *home = getenv("HOME"); + if (home != NULL) + { + snprintf(vodovod_conf, sizeof(vodovod_conf), "%s/.vodovod", home); + mkdir(vodovod_conf, 0755); + } + strncat(vodovod_conf, "/vodovod.conf", sizeof(vodovod_conf)); +#endif + + std::ofstream file(vodovod_conf); if (!file) return false; @@ -171,7 +186,15 @@ bool Config::save() // this gets called from main() so we're sure config.ini is in the right place bool Config::load() { - std::ifstream file("vodovod.conf"); + char vodovod_conf[1024]; + +#ifndef _WIN32 + char *home = getenv("HOME"); + if (home != NULL) + snprintf(vodovod_conf, sizeof(vodovod_conf), "%s/.vodovod/vodovod.conf", home); +#endif + + std::ifstream file(vodovod_conf); if (!file) return false; diff --git a/hiscore.cpp b/hiscore.cpp index a4ac6ec..904f304 100644 --- a/hiscore.cpp +++ b/hiscore.cpp @@ -17,7 +17,9 @@ You should have received a copy of the GNU General Public License along with Vodovod in file COPYING; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -----------------------------------------------------------------------------*/ -#include "stdio.h" +#include +#include +#include #include "hiscore.h" //----------------------------------------------------------------------------- HiScores &hiScores() @@ -46,8 +48,17 @@ bool HiScores::canEnter(int score) //----------------------------------------------------------------------------- HiScores::HiScores() { + char hiscore_dat[1024]; + +#ifndef _WIN32 + char *home = getenv("HOME"); + if (home != NULL) + { + snprintf(hiscore_dat, sizeof(hiscore_dat), "%s/.vodovod/hiscore.dat", home); + } +#endif // on Linux use /usr/share/abandoned/hiscore.dat ? - FILE *fp = fopen("hiscore.dat", "r"); + FILE *fp = fopen(hiscore_dat, "r"); if (!fp) { std::string defaultNames[] = { // create default hiscore @@ -102,9 +113,21 @@ HiScores::HiScores() //----------------------------------------------------------------------------- HiScores::~HiScores() { + char hiscore_dat[1024]; + +#ifndef _WIN32 + char *home = getenv("HOME"); + if (home != NULL) + { + snprintf(hiscore_dat, sizeof(hiscore_dat), "%s/.vodovod", home); + mkdir(hiscore_dat, 0755); + } + strncat(hiscore_dat, "/hiscore.dat", sizeof(hiscore_dat)); +#endif + // save to file // format: NAME#POINTS#SWAPS# - FILE *fp = fopen("hiscore.dat", "w+"); + FILE *fp = fopen(hiscore_dat, "w+"); if (fp) { for (iterator it = begin(); it != end(); ++it) debian/patches/hardening-support.patch0000644000000000000000000000220012115246027015301 0ustar From: Markus Koschany Date: Tue, 5 Mar 2013 01:21:20 +0100 Subject: hardening support --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7ef376d..8c43e83 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,13 @@ DATADIR?=. PROGRAM = vodovod OBJECTS = game.o map.o resource.o main.o allmenus.o njamfont.o sutils.o menu.o hiscore.o effects.o config.o keys.o CC = g++ +LDFLAGS=`dpkg-buildflags --get LDFLAGS` # If you hate warnings under Cygwin use these flags instead # MY_CFLAGS = -I/usr/local/include/SDL -Dmain=SDL_main -DWIN32 -Uunix -mno-cygwin MY_CFLAGS = `sdl-config --cflags` -DDATADIR=\"$(DATADIR)\" +MY_CFLAGS += `dpkg-buildflags --get CFLAGS` +MY_CFLAGS += `dpkg-buildflags --get CPPFLAGS` %.o: %.cpp $(CC) -c $(MY_CFLAGS) $< -o $@ @@ -39,7 +42,7 @@ MY_CFLAGS = `sdl-config --cflags` -DDATADIR=\"$(DATADIR)\" all: $(PROGRAM) $(PROGRAM): $(OBJECTS) - $(CC) `sdl-config --libs` -o$(PROGRAM) $(OBJECTS) -lSDL -lSDL_image -lSDL_mixer + $(CC) $(LDFLAGS) `sdl-config --libs` -o$(PROGRAM) $(OBJECTS) -lSDL -lSDL_image -lSDL_mixer clean: $(RM) *.o debian/patches/series0000644000000000000000000000022712115246027012033 0ustar datadir.patch user_files.patch datadir_makefile.patch fix-FTBFS-with-gcc-4.3.patch hardening-support.patch fix-format-not-a-string-literal-error.patch debian/patches/fix-FTBFS-with-gcc-4.3.patch0000644000000000000000000000210312115246027015267 0ustar From: Debian Games Team Date: Tue, 5 Mar 2013 00:30:39 +0100 Subject: fix-FTBFS-with-gcc-4.3 --- config.cpp | 1 + hiscore.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config.cpp b/config.cpp index 3b156ee..d04a604 100644 --- a/config.cpp +++ b/config.cpp @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include "config.h" +#include //------------------------------------------------------------------------------ using namespace std; //----------------------------------------------------------------------------- diff --git a/hiscore.cpp b/hiscore.cpp index 904f304..7e00999 100644 --- a/hiscore.cpp +++ b/hiscore.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include "hiscore.h" +#include +#include //----------------------------------------------------------------------------- HiScores &hiScores() { debian/patches/datadir.patch0000644000000000000000000001334412115246027013253 0ustar From: Debian Games Team Date: Tue, 5 Mar 2013 00:30:39 +0100 Subject: datadir --- allmenus.cpp | 4 ++-- game.cpp | 4 ++-- main.cpp | 30 +++++++++++++++--------------- map.cpp | 2 +- resource.h | 4 ++++ sutils.cpp | 2 +- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/allmenus.cpp b/allmenus.cpp index d83c437..12ba19e 100644 --- a/allmenus.cpp +++ b/allmenus.cpp @@ -36,7 +36,7 @@ extern ResourceManager *Data; //----------------------------------------------------------------------------- MainMenu::MainMenu(NjamFont *font_ptr, int x, int y): Menu(font_ptr, x, y), - whiteFontM("data/font-white.bmp", 8, 14) + whiteFontM(DATADIR "/font-white.bmp", 8, 14) { options.push_back("START NEW GAME"); options.push_back("OPTIONS"); @@ -68,7 +68,7 @@ void DrawHelp() { RenderBackground(300); - NjamFont font("data/font-white.bmp", 8, 14); + NjamFont font(DATADIR "/font-white.bmp", 8, 14); int row = 10; const int col = 16; font.WriteTextColRow(Screen, col, row++, "GOAL OF THE GAME IS TO USE PIPES TO CONNECT THE HOUSE AT THE TOP"); diff --git a/game.cpp b/game.cpp index 49c6037..2fa0160 100644 --- a/game.cpp +++ b/game.cpp @@ -29,7 +29,7 @@ extern SDL_Surface *Screen; // global objects extern ResourceManager *Data; //----------------------------------------------------------------------------- Game::Game(int difficulty): - fontM("data/font-white.bmp", 8, 14), mapM(13, 7, 10, 110) + fontM(DATADIR "/font-white.bmp", 8, 14), mapM(13, 7, 10, 110) { difficultyM = difficulty; SetupGame(); @@ -176,7 +176,7 @@ void Game::RenderScene(bool flip) mapM.RenderNextShape(*(queueM.begin())); SDL_Rect r; - SDL_Surface *next = Data->getGfx("next", "data/next.png"); + SDL_Surface *next = Data->getGfx("next", DATADIR "/next.png"); NjamSetRect(r, 363, 533); SDL_BlitSurface(next, 0, Screen, &r); diff --git a/main.cpp b/main.cpp index 42b45b7..46a9766 100644 --- a/main.cpp +++ b/main.cpp @@ -101,38 +101,38 @@ int main(int /* argc */, char ** /* argv */) InitVideo(Fullscreen); audio = InitAudio(); - SDL_Surface *vodovod = Data->getGfx("vodovod", "data/vodovod.png"); - Data->getGfx("dirt", "data/slate.png"); - Data->getGfx("queue", "data/queue.png"); - Data->getGfx("blocks", "data/block.png"); + SDL_Surface *vodovod = Data->getGfx("vodovod", DATADIR "/vodovod.png"); + Data->getGfx("dirt", DATADIR "/slate.png"); + Data->getGfx("queue", DATADIR "/queue.png"); + Data->getGfx("blocks", DATADIR "/block.png"); // house - SDL_Surface *house = Data->getGfx("house", "data/house.png"); + SDL_Surface *house = Data->getGfx("house", DATADIR "/house.png"); Uint32 green = SDL_MapRGB(house->format, 0, 255, 0); SDL_SetColorKey(house, SDL_SRCCOLORKEY, green); // tree - SDL_Surface *tree = Data->getGfx("tree1", "data/tree1.png"); + SDL_Surface *tree = Data->getGfx("tree1", DATADIR "/tree1.png"); Uint32 red = SDL_MapRGB(tree->format, 255, 0, 0); SDL_SetColorKey(tree, SDL_SRCCOLORKEY, red); // human walking - SDL_Surface *human = Data->getGfx("human", "data/walk.png"); + SDL_Surface *human = Data->getGfx("human", DATADIR "/walk.png"); Uint32 back = SDL_MapRGB(human->format, 223, 232, 255); SDL_SetColorKey(human, SDL_SRCCOLORKEY, back); // preload music if (audio) { - Data->getMusic("walk", "data/walk.xm"); - Data->getMusic("flow", "data/flow.xm"); - Data->getMusic("tune", "data/vodovod.xm"); + Data->getMusic("walk", DATADIR "/walk.xm"); + Data->getMusic("flow", DATADIR "/flow.xm"); + Data->getMusic("tune", DATADIR "/vodovod.xm"); // preload sounds - Data->getSfx("drop", "data/drop.wav"); - Data->getSfx("levelend", "data/mapend.wav"); - Data->getSfx("bubbles", "data/bubbles.wav"); - Data->getSfx("metal", "data/metal.wav"); + Data->getSfx("drop", DATADIR "/drop.wav"); + Data->getSfx("levelend", DATADIR "/mapend.wav"); + Data->getSfx("bubbles", DATADIR "/bubbles.wav"); + Data->getSfx("metal", DATADIR "/metal.wav"); } // render some background picture for menu @@ -143,7 +143,7 @@ int main(int /* argc */, char ** /* argv */) SDL_BlitSurface(vodovod, 0, Screen, &r); SDL_Flip(Screen); - NjamFont font("data/font-yellow.bmp", 11, 22); + NjamFont font(DATADIR "/font-yellow.bmp", 11, 22); MainMenu m(&font, 95, 280); m.start(); } diff --git a/map.cpp b/map.cpp index 2ae37e3..bc47900 100644 --- a/map.cpp +++ b/map.cpp @@ -433,7 +433,7 @@ void Map::Render() { SDL_Rect r; RenderBackground(xStartM*60 - 27); // 633 = 11 - SDL_Surface *tank = Data->getGfx("tank", "data/tank.png"); + SDL_Surface *tank = Data->getGfx("tank", DATADIR "/tank.png"); NjamSetRect(r, 12, 529); SDL_BlitSurface(tank, 0, Screen, &r); diff --git a/resource.h b/resource.h index 1903a60..306a616 100644 --- a/resource.h +++ b/resource.h @@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef MB_RESOURCE_H #define MB_RESOURCE_H +#ifndef DATADIR +#define DATADIR "." +#endif + #include #include #include "SDL.h" diff --git a/sutils.cpp b/sutils.cpp index d8e53ad..73d3130 100644 --- a/sutils.cpp +++ b/sutils.cpp @@ -374,7 +374,7 @@ void InitVideo(bool fullscreen) throw Exiter(SDL_GetError()); printf("Ok.\n"); - SDL_Surface *icon = Data->getGfx("icon", "data/abicon.bmp"); + SDL_Surface *icon = Data->getGfx("icon", DATADIR "/abicon.bmp"); if (!icon) throw Exiter(SDL_GetError()); SDL_WM_SetIcon(icon, NULL); debian/patches/fix-format-not-a-string-literal-error.patch0000644000000000000000000000206112115246027021012 0ustar From: Markus Koschany Date: Tue, 5 Mar 2013 01:24:33 +0100 Subject: fix format not a string literal error --- njamfont.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/njamfont.cpp b/njamfont.cpp index 0948a1a..d72d828 100644 --- a/njamfont.cpp +++ b/njamfont.cpp @@ -37,7 +37,7 @@ NjamFont::NjamFont(const char *Filename, int CharWidth, int CharHeight) if (!temp) { printf("FAILED.\n"); - printf((const char *)SDL_GetError()); + printf((const char *)SDL_GetError(),"%s"); return; } printf("OK.\n"); @@ -133,7 +133,7 @@ bool NjamFont::WriteTextXY(SDL_Surface *Destination, int x, int y, const char *T if (0 != SDL_BlitSurface(m_Surface, &src, Destination, &dest)) { printf("Failed to blit font character image.\n"); - printf((const char *)SDL_GetError()); + printf((const char *)SDL_GetError(),"%s"); return false; } break; debian/patches/datadir_makefile.patch0000644000000000000000000000144112115246027015103 0ustar From: Debian Games Team Date: Tue, 5 Mar 2013 00:30:39 +0100 Subject: datadir_makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index daf8cdc..7ef376d 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,15 @@ ifndef PREFIX PREFIX=/usr endif +DATADIR?=. + PROGRAM = vodovod OBJECTS = game.o map.o resource.o main.o allmenus.o njamfont.o sutils.o menu.o hiscore.o effects.o config.o keys.o CC = g++ # If you hate warnings under Cygwin use these flags instead # MY_CFLAGS = -I/usr/local/include/SDL -Dmain=SDL_main -DWIN32 -Uunix -mno-cygwin -MY_CFLAGS = `sdl-config --cflags` +MY_CFLAGS = `sdl-config --cflags` -DDATADIR=\"$(DATADIR)\" %.o: %.cpp $(CC) -c $(MY_CFLAGS) $< -o $@