--- jigzo-0.6.1.orig/debian/jigzo.manpages
+++ jigzo-0.6.1/debian/jigzo.manpages
@@ -0,0 +1 @@
+debian/jigzo.6
--- jigzo-0.6.1.orig/debian/jigzo.install
+++ jigzo-0.6.1/debian/jigzo.install
@@ -0,0 +1,3 @@
+jigzo usr/games
+debian/jigzo.xpm usr/share/pixmaps
+debian/jigzo.desktop usr/share/applications
--- jigzo-0.6.1.orig/debian/jigzo-data.dirs
+++ jigzo-0.6.1/debian/jigzo-data.dirs
@@ -0,0 +1 @@
+usr/share/games/jigzo
--- jigzo-0.6.1.orig/debian/copyright
+++ jigzo-0.6.1/debian/copyright
@@ -0,0 +1,62 @@
+This package was debianized by Elías Alejandro Año Mendoza <ealmdz@gmail.com> on
+Tue, 23 Jun 2009 17:56:02 -0500.
+
+It was downloaded from:
+
+ http://www.resorama.com/glpuzzle/
+ http://www.iua.upf.es/~mdeboer/resorama/glpuzzle/
+ http://www.resorama.com/jigzo/
+
+Upstream Author:
+
+ Maarten de Boer <maarten@resorama.com>
+
+Copyright:
+
+ Copyright © 2005-2008 Maarten de Boer <maarten@resorama.com>
+
+License:
+
+ 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
+
+
+ The copyright and license information of the images:
+
+ - train, blackberry, bike, goat, gorilla, horse, bird, clouds, castle,
+ tobogan:
+
+ Photographs by Maarten de Boer
+ Licensed under GPL v2, see GPL.txt, where the photographs are being
+ considered part of the programs source code.
+
+ - heli:
+
+ Photograph by Joana Clotet
+ Licensed under GPL v2, see GPL.txt, where the photographs are being
+ considered part of the programs source code.
+
+ - penguin:
+
+ Obtained from:
+ http://commons.wikimedia.org/wiki/Image:Penguins_111602.jpg
+ This image from http://pdphoto.org/ has been released into the public domain
+ by its author and copyright holder, Jon Sullivan. He stated:
+ "You may use this image for any purpose, including commercial. As the owner
+ I have explicitly placed it in the public domain. If you do use it, please
+ consider linking back to pdphoto.org. Use it for whatever you want. Use it
+ all. Sell it. Mangle it. Whatever you want. Please. But it would be polite
+ to let me know so I can at least enjoy whatever creative use you're putting
+ it to. This doesn't mean that you can take the material and then copyright
+ it yourself. It's in the public domain and that's where I want it to stay."
+
+
+The Debian packaging is © 2009, Elías Alejandro Año Mendoza <ealmdz@gmail.com> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL-3'.
--- jigzo-0.6.1.orig/debian/README.source
+++ jigzo-0.6.1/debian/README.source
@@ -0,0 +1,2 @@
+This package uses quilt management system patch. Please see:
+/usr/share/doc/quilt/README.source
--- jigzo-0.6.1.orig/debian/jigzo.desktop
+++ jigzo-0.6.1/debian/jigzo.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=jigzo
+Comment=Photo puzzle game for children
+TryExec=/usr/games/jigzo
+Exec=/usr/games/jigzo
+Categories=Application;Game;LogicGame;
+Icon=jigzo.xpm
--- jigzo-0.6.1.orig/debian/changelog
+++ jigzo-0.6.1/debian/changelog
@@ -0,0 +1,65 @@
+jigzo (0.6.1-4) unstable; urgency=low
+
+ * Fixed Fails to start with cannot open
+ /usr/share/games/jigzo/font/charmap.png
+ +Thanks to Dmitry Semyonov (Closes: #549515).
+ * Updated Standards-Version to 3.8.3.
+ * Corrected some lintian warnings:
+ +Added README.source pointing to quilt's README.source.gz.
+ +Added a description to the 01_paths, 03_gcc_4_3
+ and 04_any_resolution patchs.
+ +Removed deprecated "Encoding" field from jigzo.desktop.
+ +Added a extended-description (debian/control).
+
+ -- Elías Alejandro Año Mendoza <ealmdz@gmail.com> Wed, 07 Oct 2009 17:36:40 -0500
+
+jigzo (0.6.1-3.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fix previous incomplete upload.
+
+ -- Maximiliano Curia <maxy@debian.org> Sun, 26 Jul 2009 15:09:06 -0300
+
+jigzo (0.6.1-3) unstable; urgency=low
+
+ * debian/watch: Updated.
+ * Rewrote the build system with debhelper and quilt.
+ * Menu icon updated.
+ * Use the quilt system patch.
+ * Made two packages: jigzo and jigzo-data.
+ * debian/control: Updated Standards-Version to 3.8.2.
+ * debian/jigzo.6: Updated.
+
+ -- Elías Alejandro Año Mendoza <ealmdz@gmail.com> Wed, 24 Jun 2009 19:48:13 -0500
+
+jigzo (0.6.1-2) unstable; urgency=low
+
+ * New maintainer. Closes: #497241.
+ * debian/install, debian/patches/01_paths.diff: Updated.
+ Moving from usr/share/jigzo/ to usr/share/games/jigzo/.
+ * debian/jigzo.6, debian/jigzo.manpages: Added.
+ * debian/patches/03_gcc_4_3.diff: Updated.
+ * debian/patches/04_any_resolution.diff: Added.
+ Patch by Miriam Ruiz <little_miry@yahoo.es>, thanks.
+ * debian/watch: Updated.
+
+ -- Elías Alejandro Año Mendoza <ealmdz@gmail.com> Mon, 09 Feb 2009 22:27:31 -0500
+
+jigzo (0.6.1-1) unstable; urgency=low
+
+ * New upstream release, renamed.
+ * debian/copyright: Updated.
+
+ -- Bart Martens <bartm@debian.org> Sun, 28 Dec 2008 16:42:03 +0100
+
+glpuzzle (0.2-2) unstable; urgency=low
+
+ * debian/patches/03_gcc_4_3.diff: Added. Closes: #420882.
+
+ -- Bart Martens <bartm@knars.be> Fri, 27 Apr 2007 00:27:13 +0200
+
+glpuzzle (0.2-1) unstable; urgency=low
+
+ * Initial release. Closes: #409499.
+
+ -- Bart Martens <bartm@knars.be> Sun, 11 Mar 2007 14:41:35 +0100
--- jigzo-0.6.1.orig/debian/compat
+++ jigzo-0.6.1/debian/compat
@@ -0,0 +1 @@
+7
--- jigzo-0.6.1.orig/debian/jigzo-data.install
+++ jigzo-0.6.1/debian/jigzo-data.install
@@ -0,0 +1 @@
+font image sound puzzles usr/share/games/jigzo
--- jigzo-0.6.1.orig/debian/watch
+++ jigzo-0.6.1/debian/watch
@@ -0,0 +1,3 @@
+version=3
+
+http://www.resorama.net/jigzo/jigzo-(.*)\.tgz
--- jigzo-0.6.1.orig/debian/jigzo.6
+++ jigzo-0.6.1/debian/jigzo.6
@@ -0,0 +1,61 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH JIGZO 6 "June 23, 2009"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+jigzo \- an OpenGL jigsaw game
+.SH SYNOPSIS
+.B jigzo
+.RI [ options ]
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B jigzo
+comand, for the jigzo game.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBjigzo\fP is a jigsaw puzzle game. Choose from 12 puzzle of increasing
+difficult, or create your own puzzle, jigzo uses OpenGL for smooth
+movement and display.
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h
+Show this usage info.
+.TP
+.B \-w
+Window mode (default).
+.TP
+.B \-f
+Full screen mode.
+.TP
+.B \-s
+<width>x<height> screen size (default: 800 x 600).
+.PP
+The downloads include 12 puzzles of increasing difficulties. You can create your own additional puzzles by
+.br
+uploading images at http://www.resorama.com/jigzomaker/
+.br
+.SH AUTHOR
+jigzo was written by Maarten de Boer<maarten@resorama.com> Copyright © 2005-2008.
+.PP
+This manual page was written by Elías Alejandro Año Mendoza <ealmdz@gmail.com>,
+for the Debian project (but may be used by others).
--- jigzo-0.6.1.orig/debian/rules
+++ jigzo-0.6.1/debian/rules
@@ -0,0 +1,60 @@
+#!/usr/bin/make -f
+build: build-stamp
+build-stamp:
+ dh_testdir
+ $(MAKE) -f /usr/share/quilt/quilt.make patch
+ $(MAKE)
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+ [! -f Makefile] || $(MAKE) clean
+ # Add here commands to clean up after the build process.
+ $(MAKE) -f /usr/share/quilt/quilt.make unpatch
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ dh_install
+
+# Build architecture independant packages using the common target.
+binary-indep: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs -i
+ dh_installdocs -i
+ dh_link -i
+ dh_strip -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_shlibdeps -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+
+# Build architecture dependant packages using the common target.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs -a
+ dh_installdocs -a
+ dh_installmenu -a
+ dh_installman -a
+ dh_link -a
+ dh_strip -a
+ dh_compress -a
+ dh_fixperms -a
+ dh_installdeb -a
+ dh_shlibdeps -a
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- jigzo-0.6.1.orig/debian/control
+++ jigzo-0.6.1/debian/control
@@ -0,0 +1,28 @@
+Source: jigzo
+Section: games
+Priority: optional
+Maintainer: Elías Alejandro Año Mendoza <ealmdz@gmail.com>
+Build-Depends: debhelper (>= 7), libjpeg62-dev, libpng12-dev, libsdl1.2-dev, libsdl-mixer1.2-dev, quilt
+Standards-Version: 3.8.3
+Homepage: http://www.resorama.com/jigzo/
+
+Package: jigzo
+Architecture: any
+Depends: jigzo-data (=${source:Version}), ${shlibs:Depends}, ${misc:Depends}
+Provides: glpuzzle
+Replaces: glpuzzle
+Conflicts: glpuzzle
+Description: Photo puzzle game for children
+ jigzo (formerly glpuzzle) is a jigsaw puzzle game. Choose from 12 puzzles of
+ increasing difficult. The difficulty ranges from 4 to 25 puzzle pieces. This
+ game requires a OpenGl hardware acceleration.
+
+Package: jigzo-data
+Architecture: all
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: data of Photo puzzle game for children
+ jigzo (formerly glpuzzle) is a jigsaw puzzle game. Choose from 12 puzzles of
+ increasing difficult. The difficulty ranges from 4 to 25 puzzle pieces. This
+ game requires a OpenGl hardware acceleration.
+ .
+ This package includes the data of the game: images, sound, icon, font.
--- jigzo-0.6.1.orig/debian/jigzo.dirs
+++ jigzo-0.6.1/debian/jigzo.dirs
@@ -0,0 +1,3 @@
+usr/games
+usr/share/pixmaps
+usr/share/applications
--- jigzo-0.6.1.orig/debian/jigzo.xpm
+++ jigzo-0.6.1/debian/jigzo.xpm
@@ -0,0 +1,152 @@
+/* XPM */
+static char *icon____y_pirui__w_nad_cdyok_spulq_______out[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 114 2",
+" c #070707",
+". c #080707",
+"X c #0C0C0C",
+"o c #110707",
+"O c #120D0D",
+"+ c #1B0D0D",
+"@ c #0F100F",
+"# c #12110E",
+"$ c #18130B",
+"% c #1E1A0F",
+"& c #0F1010",
+"* c #131413",
+"= c #1A1313",
+"- c #161817",
+"; c #1B1A15",
+": c #161919",
+"> c #1B1C1B",
+", c #221313",
+"< c #231D10",
+"1 c #1E201F",
+"2 c #2A230D",
+"3 c #37270E",
+"4 c #342D0D",
+"5 c #2D2513",
+"6 c #20231F",
+"7 c #1F2121",
+"8 c #202322",
+"9 c #30312D",
+"0 c #3D382E",
+"q c #313330",
+"w c #393B36",
+"e c #393C3A",
+"r c #4C3D0B",
+"t c #5C480A",
+"y c #694C04",
+"u c #694F08",
+"i c #735A06",
+"p c #7B5F0A",
+"a c #605310",
+"s c #484134",
+"d c #46473C",
+"f c #49473B",
+"g c #4A493C",
+"h c #4C4C43",
+"j c #524F40",
+"k c #535243",
+"l c #595547",
+"z c #5E5847",
+"x c #54574C",
+"c c #595D4F",
+"v c #615C4B",
+"b c #5F614F",
+"n c #66644F",
+"m c #636553",
+"M c #6A6552",
+"N c #666954",
+"B c #6A6A56",
+"V c #676758",
+"C c #68665C",
+"Z c #6F6C5F",
+"A c #706E57",
+"S c #726E59",
+"D c #767255",
+"F c #76715B",
+"G c #7A755E",
+"H c #787565",
+"J c #7E7A61",
+"K c #8B6C05",
+"L c #876908",
+"P c #906F03",
+"I c #8D7509",
+"U c #937307",
+"Y c #9C7506",
+"T c #9D7D06",
+"R c #907108",
+"E c #877019",
+"W c #A17A05",
+"Q c #A87E05",
+"! c #827D63",
+"~ c #9F830A",
+"^ c #A98306",
+"/ c #B38E05",
+"( c #BA9304",
+") c #B7990D",
+"_ c #BB9C0A",
+"` c #848067",
+"' c #8B8964",
+"] c #868268",
+"[ c #8A856B",
+"{ c #8E896F",
+"} c #9D986F",
+"| c #8F8C77",
+" . c #928C73",
+".. c #969175",
+"X. c #9D9376",
+"o. c #9A9579",
+"O. c #9F997D",
+"+. c #A39C7E",
+"@. c #A89B7F",
+"#. c #A6A077",
+"$. c #AAA27D",
+"%. c #B7A17D",
+"&. c #B3AC7E",
+"*. c #A7A082",
+"=. c #ABA484",
+"-. c #B1A584",
+";. c #B4AA8A",
+":. c #C2BB85",
+">. c #CBBD93",
+",. c #D0C39E",
+"<. c #E0D59F",
+"1. c #D9D0A6",
+"2. c #E1D7A5",
+"3. c None",
+/* pixels */
+"3.3.3.0 f f f f f g g g g g j k z v n M M B S F G G G G F 3.3.3.",
+"3.3.3.l B B N B B B B B B B F G ! [ ...X.O.+.=.;.;.;.;.@.3.3.3.",
+"3.3.3.m B N N N N B B B N B S F J ! [ ...o.+.*.=.;.;.;.3.3.3.3.",
+"3.3.s N N N m N N B B N N N B F G ! ] { ..o.O.+.=.;.;.;.3.3.3.3.",
+"3.3.k m m m m m m N N m N N M A F J ` [ .o.O.+.=.=.;.-.3.3.3.3.",
+"3.3.b m m m m m m m m m m m n B V m V V H | O.*.=.=.=.+.3.3.3.3.",
+"3.s m m m m m m m m c h d w 9 8 > > 1 > 1 8 e C .*.$.X.3.3.3.3.",
+"3.k m m m m m x w 6 : : : : > > 1 1 8 8 8 8 8 8 8 w Z 3.3.3.3.3.",
+"3.m V m m c q - - - - - : > > > > > 7 7 7 8 8 8 8 8 7 3.3.3.3.3.",
+"3.3.3.3.h > - * - - - - : > > > > > > > > 1 7 8 8 7 > 3.3.3.3.3.",
+"3.3.3.3.3.* * * - - : : > > > > > > 7 > > > > > > - * X * O 3.3.",
+"3.3.3.3.3.3.* - - - - - : > > > > > 1 > > > > : * * * X * * * 3.",
+"3.3.3.3.3.3.O * - - : - > > > > > > > > - - * * * X X X * * * = ",
+"3.3.3.3.3.3.+ * * - - - : > > > > > > - * * * X X X . X * * - = ",
+"3.3.3.3.3.3.O - * - - - : ; ; ; - - * * * X X . . . . X X * - ; ",
+"3.3.3.3.3.3.* * - - : ; ; - * * - * X X X X . . X * * - , ",
+"3.3.3.3.3.O * - : > > ; - - * # O X X X X . . X * * + 3.",
+"3.3.3.3.3 * * - : > > - * * # # X . . . . X . . X 3.3.3.3.3.",
+"E ) / ^ R % * - ; ; ; * * # X X O - * * * * # # X X X 3.3.3.3.3.",
+"3._ ( Q Y 2 * - - - - - * # X X X X X * * * * * - * X 3.3.3.3.3.",
+"3.~ / W U 2 * - * * * * * # O O X X X # * - - - * * * 3.3.3.3.3.",
+"3.L ^ Y R < * * * * # # X X X * * * * * * * X X X X & O 3.3.3.3.",
+"3.u T P i $ * X O X X X X X * * * * * X X X X X X X X O 3.3.3.3.",
+"3.3.I K t * * X X X X * * * * * * * X X X X X X X X X X 3.3.3.3.",
+"3.3.p K r * * * * * - * * * * * * * * X X X X X X X X X 3.3.3.3.",
+"3.3.y U 4 * * * * - * * * * * = 3.3.3.O & & & * @ X X X 3.3.3.3.",
+"3.3.3.I ; * * * * * * - * O 3.3.3.3.3.3.$ * * * * * * X o 3.3.3.",
+"3.3.3.a - * * * * * - - - 3.3.3.3.3.3.3.3.O * * * * X X o 3.3.3.",
+"3.3.3.5 - - - ; ; ; ; ; ; 3.3.3.3.3.3.3.3.3.X X X X X X X 3.3.3.",
+"3.3.3.3.; s D ' } #.&.:.3.3.3.3.3.3.3.3.3.3.X X . . . o 3.3.3.3.",
+"3.3.3.3.3.3.3.3.,.1.2.<.3.3.3.3.3.3.3.3.3.3.$ X o 3.3.3.3.3.3.3.",
+"3.3.3.3.3.3.3.3.3.3.3.>.%.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3.3."
+};
--- jigzo-0.6.1.orig/debian/jigzo.menu
+++ jigzo-0.6.1/debian/jigzo.menu
@@ -0,0 +1,4 @@
+?package(jigzo):needs="X11" section="Games/Puzzles"\
+ longtitle="Photo puzzle game for children"\
+ icon="jigzo.xpm"\
+ title="jigzo" command="/usr/games/jigzo"
--- jigzo-0.6.1.orig/debian/patches/series
+++ jigzo-0.6.1/debian/patches/series
@@ -0,0 +1,3 @@
+01_paths.patch
+03_gcc_4_3.patch
+04_any_resolution.patch
--- jigzo-0.6.1.orig/debian/patches/02_layout.diffDISABLED
+++ jigzo-0.6.1/debian/patches/02_layout.diffDISABLED
@@ -0,0 +1,11 @@
+--- ../orig/glpuzzle-0.2/main.cxx 2006-02-05 02:41:46.000000000 +0100
++++ main.cxx 2007-02-03 17:14:00.000000000 +0100
+@@ -874,7 +874,7 @@
+
+ glColor3f(1, 0.8, 0.2);
+ //DrawString(1024 / 2, 150, str, 256);
+- DrawString(1024 / 2, 150, "glpuzzle", 256);
++ DrawString(1024 / 2, 170, "glpuzzle", 256);
+ DrawString(1024 / 2, 200, "v" VERSIONSTR, 96);
+ glColor3f(0.9, 1, 1);
+ DrawString(1024 / 2, 270, "programming & design:", 96);
--- jigzo-0.6.1.orig/debian/patches/03_gcc_4_3.patch
+++ jigzo-0.6.1/debian/patches/03_gcc_4_3.patch
@@ -0,0 +1,37 @@
+Patch to make jigzo work with gcc 4.3
+Index: jigzo-0.6.1/src/Loader.cxx
+===================================================================
+--- jigzo-0.6.1.orig/src/Loader.cxx 2009-06-24 20:16:37.000000000 -0500
++++ jigzo-0.6.1/src/Loader.cxx 2009-06-24 20:17:45.000000000 -0500
+@@ -24,6 +24,7 @@
+ {
+ #include <png.h>
+ #include <jpeglib.h>
++#include <stdlib.h>
+ }
+
+ void JpgLoader::Load(const std::string& filename,RGB& target,int x,int y)
+Index: jigzo-0.6.1/src/main.cxx
+===================================================================
+--- jigzo-0.6.1.orig/src/main.cxx 2009-06-24 20:18:18.000000000 -0500
++++ jigzo-0.6.1/src/main.cxx 2009-06-24 20:19:50.000000000 -0500
+@@ -47,6 +47,7 @@
+ #include <fstream>
+ #include <string>
+ #include <sstream>
++#include <algorithm>
+
+ #ifdef WIN32
+ #include <io.h>
+@@ -928,9 +929,9 @@
+ Assign(*texture,rgba,INTERPOLATION);
+ }
+
+-Rect DrawString(float x, float y, char *str, float scale)
++Rect DrawString(float x, float y, const char *str, float scale)
+ {
+- char *ptr = str;
++ const char *ptr = str;
+ float tw = 0;
+ while (*ptr) {
+ Sprite *s = chars[int (*ptr++)];
--- jigzo-0.6.1.orig/debian/patches/04_any_resolution.patch
+++ jigzo-0.6.1/debian/patches/04_any_resolution.patch
@@ -0,0 +1,249 @@
+Patch to make jigzo work with any resolution and any screen ratio
+Index: jigzo-0.6.1/src/main.cxx
+===================================================================
+--- jigzo-0.6.1.orig/src/main.cxx 2009-07-04 01:27:54.000000000 -0500
++++ jigzo-0.6.1/src/main.cxx 2009-07-04 01:46:06.000000000 -0500
+@@ -33,6 +33,19 @@
+ float BG_G = float(0x00)/255.;
+ float BG_B = float(0x00)/255.;
+
++#ifndef SCREEN_WIDTH
++#define SCREEN_WIDTH 800
++#endif
++
++#ifndef SCREEN_HEIGHT
++#define SCREEN_HEIGHT 600
++#endif
++
++int screen_width = SCREEN_WIDTH;
++int screen_height = SCREEN_HEIGHT;
++int glw = 0;
++int glh = 0;
++
+ bool rotateEnabled = false;
+ bool soundEnabled = false;
+ bool soundFailed = false;
+@@ -162,7 +175,7 @@
+
+ Sprite *chars[128];
+
+-int mouseX = 0,mouseY = 0;
++int mouseX = 0, mouseY = 0;
+
+ class PuzzlePieceSprite **grid = 0;
+ int ncolumns = 0;
+@@ -573,7 +586,7 @@
+ rgba.Height()-offsetY-leaveRGBA.Height(),
+ leaveRGBA.Width(),
+ leaveRGBA.Height()));
+- leave->Move(Point(1024-4-leave->GetRect().w,768-leave->GetRect().h));
++ leave->Move(Point(glw-4-leave->GetRect().w,glh-leave->GetRect().h));
+ offsetX += leaveRGBA.Width();
+ }
+ if (nFolders)
+@@ -719,10 +732,10 @@
+ jpgLoader.Load(puzzlefile.ThumbJpg(),rgba,x,y);
+ preview->CreateTextureMap(texture, Rect(x,y,jpgLoader.width,jpgLoader.height));
+ preview->pos = Point(
+- x+(256-preview->GetRect().w)/2,
+- y+(240-preview->GetRect().h)/2);
++ x + (256-preview->GetRect().w)/2 + glw/2 - 512,
++ y + (240-preview->GetRect().h)/2 + glh/2 - 384);
+ x += 256;
+- if (x==1024)
++ if (x>=1024)
+ {
+ x = 0;
+ y += 240;
+@@ -970,14 +983,24 @@
+ nextGroup = 0;
+ for (int i = 0; i < n; i++)
+ v[i] = i;
++ float cx = 0.f;
++ float cy = 0.f;
++ int cn = 0;
+ for (it = puzzlePieces.begin(); it != puzzlePieces.end(); it++) {
+ int r = rand() % n;
+ int i = v[r];
+ v[r] = v[--n];
+- (*it)->pos = Point(4 + grid[i]->tx + grid[i]->tx / 5,
++ (*it)->pos = Point(4 + grid[i]->tx + grid[i]->tx / 5 ,
+ 4 + grid[i]->ty + grid[i]->ty / 5);
+ (*it)->group = NextGroup();
+- }
++ Rect cr = (*it)->GetRect();
++ cx += cr.x + cr.w / 2;
++ cy += cr.y + cr.h / 2;
++ cn ++;
++ }
++ for (it = puzzlePieces.begin(); it != puzzlePieces.end(); it++) {
++ (*it)->pos += Point( glw/2 - cx/cn, glh/2 - cy/cn );
++ }
+
+ drawFoto = 0;
+ }
+@@ -1005,7 +1028,7 @@
+ }
+ glDisable(GL_TEXTURE_2D);
+ glColor4f(BG_R,BG_G,BG_B,fade);
+- glRectf(0,0,1024,768);
++ glRectf(0,0,glw,glh);
+ }
+
+ void Display2(void)
+@@ -1094,7 +1117,7 @@
+ ff = ff*ff;
+ glColor4f(1,1,1,ff);
+ PuzzlePieceSprite *pp = *it;
+- pp->Move(Point(1024 / 2 + pp->tx - INTROIMGW/3,
++ pp->Move(Point(glw / 2 + pp->tx - INTROIMGW/3,
+ 80 + pp->ty
+ ));
+ (*it)->Draw();
+@@ -1119,17 +1142,17 @@
+ }
+
+ glColor3f(0.9, 1, 1);
+- DrawString(1024 / 2, 360, "Version 0.6.1", 80.f/256.f);
++ DrawString(glw / 2, 360, "Version 0.6.1", 80.f/256.f);
+ glColor3f(1, 0.8, 0.2);
+- DrawString(1024 / 2, 398, "http://www.resorama.com/jigzo/", 80.f/256.f);
++ DrawString(glw / 2, 398, "http://www.resorama.com/jigzo/", 80.f/256.f);
+ glColor3f(0.9, 1, 1);
+- DrawString(1024 / 2, 450, "Options:", 92.f/256.f);
++ DrawString(glw / 2, 450, "Options:", 92.f/256.f);
+ char tmp[256];
+ glColor3f(0.5, 0.5, 1);
+ sprintf(tmp,"Rotating pieces: %s",rotateEnabled ? " ON" : "OFF");
+- rotateOptionRect = DrawString(1024 / 2, 489, tmp, 80.f/256.f);
++ rotateOptionRect = DrawString(glw / 2, 489, tmp, 80.f/256.f);
+ glColor3f(0.7, 0.7, 0.8);
+- DrawString(1024 / 2, 528, "(Hold Ctrl to rotate)", 80.f/256.f);
++ DrawString(glw / 2, 528, "(Hold Ctrl to rotate)", 80.f/256.f);
+ glColor3f(0.5, 0.5, 1);
+ #ifdef ENABLE_SOUND
+ if (soundFailed)
+@@ -1141,16 +1164,16 @@
+ #else
+ sprintf(tmp,"Sound support not available");
+ #endif
+- soundOptionRect = DrawString(1024 / 2, 570, tmp, 80.f/256.f);
++ soundOptionRect = DrawString(glw / 2, 570, tmp, 80.f/256.f);
+ sprintf(tmp,"Connection tolerance: %s",
+ toleranceString[tolerance]);
+- toleranceOptionRect = DrawString(1024 / 2, 613, tmp, 80.f/256.f);
++ toleranceOptionRect = DrawString(glw / 2, 613, tmp, 80.f/256.f);
+ glColor3f(1, 0.8, 0.2);
+- DrawString(1024 / 2, 680, "Press 'Esc' to quit", 92.f/256.f);
++ DrawString(glw / 2, 680, "Press 'Esc' to quit", 92.f/256.f);
+ glColor3f(0.9, 1, 1);
+- DrawString(1024 / 2, 720, "SPACE brings bottom-piece to front",80.f/256.f);
++ DrawString(glw / 2, 720, "SPACE brings bottom-piece to front",80.f/256.f);
+ glColor3f(1, 0.8, 0.2);
+- DrawString(1024 / 2, 770, "Click or press key to continue", 92.f/256.f);
++ DrawString(glw / 2, 770, "Click or press key to continue", 92.f/256.f);
+ glColor3f(1, 1, 1);
+ leave->Draw();
+ arrow->Draw();
+@@ -1232,8 +1255,8 @@
+
+ void MouseMove(int x, int y, bool modifier)
+ {
+- mouseX = x;
+- mouseY = y;
++ mouseX = x * glw / screen_width;
++ mouseY = y * glh / screen_height;
+ if (arrow)
+ arrow->Move(Point(mouseX, mouseY));
+ if (mode == intro) {
+@@ -1464,12 +1487,15 @@
+ printf("http://www.resorama.com/jigzo/\n\n");
+ printf
+ ("Copyright (C) 2005-2008 Maarten de Boer <maarten@resorama.com>\n\n");
+- printf("Usage: jigzo [-h | -w]\n\n");
+- printf(" -h show this usage info\n");
+- printf(" -w window mode (default is fullscreen)\n");
++ printf("Usage: jigzo [options]\n\n");
++ printf("Usage: jigzo [options]\n\n");
++ printf(" -h show this usage info\n");
++ printf(" -f fullscreen mode\n");
++ printf(" -w window mode (default)\n");
++ printf(" -s <width>x<height> screen size (default: %i x %i)\n",SCREEN_WIDTH,SCREEN_HEIGHT);
+ printf("\n");
+ printf
+- ("jigzo requires a OpenGL hardware accelaration and runs at 1024x768 only\n\n");
++ ("jigzo requires a OpenGL hardware accelaration\n\n");
+ #ifndef ENABLE_SOUND
+ printf("Sound support disabled at compilation\n\n");
+ #endif
+@@ -1483,7 +1509,7 @@
+ time(&t);
+ srand(t);
+ try {
+- bool fullscreen = true;
++ bool fullscreen = false;
+ mode = start_intro;
+
+ string argv0(argv[0]);
+@@ -1502,23 +1528,49 @@
+
+
+ if (argc > 1) {
+- if (argc > 2)
+- usage();
+- if (string(argv[1]) == "-h")
+- usage();
+- if (string(argv[1]) == "-w")
+- fullscreen = false;
++ for (int i = 1; i < argc ; i++) {
++ if (string(argv[i]) == "-h") {
++ usage();
++ }
++ if (string(argv[i]) == "-f") {
++ fullscreen = true;
++ continue;
++ }
++ if (string(argv[i]) == "-w") {
++ fullscreen = false;
++ continue;
++ }
++ if (string(argv[i]) == "-s") {
++ i++;
++ if (i >= argc)
++ usage();
++ if (sscanf(argv[i], "%dx%d", &screen_width, &screen_height) != 2)
++ usage();
++ if (screen_width < 100 || screen_height < 80)
++ usage();
++ continue;
++ }
++ }
+ }
+-
++ int gl_width = 1024;
++ int gl_height = 768;
+ // todo: for non 4/3 resolution, the contents should be
+ // repositioned
+- int w = 1024;
+- int h = 768;
++ int w = screen_width;
++ int h = screen_height;
+ float ar = float(w)/float(h);
+- float glhf = sqrt(1024.f*768.f/ar);
++ float glhf = sqrt(float(gl_width)*float(gl_height)/ar);
+ float glwf = glhf*ar;
+- int glw = int(glwf+0.5f);
+- int glh = int(glhf+0.5f);
++ if (float(gl_width) > float(gl_height)/ar)
++ {
++ glhf = float(gl_height);
++ glwf = glhf*ar;
++ } else {
++ glwf = float(gl_width);
++ glhf = glhf/ar;
++ }
++ glw = int(glwf+0.5f);
++ glh = int(glhf+0.5f);
+ INTERPOLATION = GL_LINEAR;
+ //if (w==glw && h==glh) INTERPOLATION = GL_NEAREST;
+ //else INTERPOLATION = GL_LINEAR;
--- jigzo-0.6.1.orig/debian/patches/01_paths.patch
+++ jigzo-0.6.1/debian/patches/01_paths.patch
@@ -0,0 +1,73 @@
+Patch to find jigzo's data on /usr/share/games/jigzo/
+Index: jigzo-0.6.1/src/main.cxx
+===================================================================
+--- jigzo-0.6.1.orig/src/main.cxx 2009-06-24 20:05:40.000000000 -0500
++++ jigzo-0.6.1/src/main.cxx 2009-06-24 20:10:43.000000000 -0500
+@@ -116,8 +116,8 @@
+ printf("Unable to open audio... continuing without.\n");
+ soundFailed = true;
+ }else{
+- mixChunkConnect= Mix_LoadWAV("sound/connect.wav");
+- mixChunkFinish= Mix_LoadWAV("sound/finish.wav");
++ mixChunkConnect= Mix_LoadWAV("/usr/share/games/jigzo/sound/connect.wav");
++ mixChunkFinish= Mix_LoadWAV("/usr/share/games/jigzo/sound/finish.wav");
+ }
+ }
+ else
+@@ -546,7 +546,7 @@
+ {
+ PngLoader pngLoader;
+ RGBA arrowRGBA;
+- pngLoader.Load("image/arrow.png",arrowRGBA);
++ pngLoader.Load("/usr/share/games/jigzo/image/arrow.png",arrowRGBA);
+ rgba.Paste(arrowRGBA,rgba.Width()-arrowRGBA.Width(),
+ rgba.Height()-arrowRGBA.Height());
+ arrow = new Sprite;
+@@ -562,7 +562,7 @@
+ {
+ PngLoader pngLoader;
+ RGBA leaveRGBA;
+- pngLoader.Load("image/leave.png",leaveRGBA);
++ pngLoader.Load("/usr/share/games/jigzo/image/leave.png",leaveRGBA);
+ rgba.Paste(leaveRGBA,rgba.Width()-offsetX-leaveRGBA.Width(),
+ rgba.Height()-offsetY-leaveRGBA.Height());
+ leave = new Sprite;
+@@ -579,7 +579,7 @@
+ {
+ PngLoader pngLoader;
+ RGBA folderRGBA;
+- pngLoader.Load("image/folder.png",folderRGBA);
++ pngLoader.Load("/usr/share/games/jigzo/image/folder.png",folderRGBA);
+ rgba.Paste(folderRGBA,rgba.Width()-offsetX-folderRGBA.Width(),
+ rgba.Height()-offsetY-folderRGBA.Height());
+ for (int i = 0;i<nFolders; i++)
+@@ -661,7 +661,7 @@
+
+ void ReadPreviewFolders(void)
+ {
+- RecursePreviewFolder("puzzles/");
++ RecursePreviewFolder("/usr/share/games/jigzo/puzzles/");
+ };
+
+ void ReadPreviews(void)
+@@ -754,17 +754,17 @@
+ chars[i] = 0;
+ }
+
+- string mapDataFilename = "font/charmap.map";
++ string mapDataFilename = "/usr/share/games/jigzo/font/charmap.map";
+
+ texture = new Texture(global_gl_texture);
+
+ RGBA rgba(1024,1024);
+
+ PngLoader pngLoader;
+- pngLoader.Load("font/charmap.png",rgba);
++ pngLoader.Load("/usr/share/games/jigzo/font/charmap.png",rgba);
+
+ JpgLoader jpgLoader;
+- jpgLoader.Merge("font/charmap.jpg",rgba);
++ jpgLoader.Merge("/usr/share/games/jigzo/font/charmap.jpg",rgba);
+
+ Assign(*texture,rgba,GL_LINEAR);
+