diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-02-11 19:07:36 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-02-11 19:07:36 +0000 |
commit | 7f2a504d7bcbc255616af97e050e59b0a2d99c12 (patch) | |
tree | 358df0d3f4606aa5386a1937f4d8127633e99a99 | |
parent | 230c65a923aeaf456d61e5fbf4faec4c93313308 (diff) | |
download | mana-7f2a504d7bcbc255616af97e050e59b0a2d99c12.tar.gz mana-7f2a504d7bcbc255616af97e050e59b0a2d99c12.tar.bz2 mana-7f2a504d7bcbc255616af97e050e59b0a2d99c12.tar.xz mana-7f2a504d7bcbc255616af97e050e59b0a2d99c12.zip |
Merged revisions 3750-3751,3755-3759,3761,3766-3767,3773-3776,3779,3781,3783-3789,3791-3800,3807,3814-3815,3817,3819-3820,3822,3824-3825,3827,3829-3838,3840-3841,3843-3858,3860-3875 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0
........
r3750 | crush_tmw | 2007-11-20 00:36:02 +0100 (Tue, 20 Nov 2007) | 1 line
Updated desert maps with new tiles by Len.
........
r3755 | crush_tmw | 2007-11-20 17:47:44 +0100 (Tue, 20 Nov 2007) | 1 line
fixed a collision layer error
........
r3773 | crush_tmw | 2007-12-12 16:45:25 +0100 (Wed, 12 Dec 2007) | 2 lines
Added my tmxcopy tool for copying parts of maps to other maps.
........
r3774 | b_lindeijer | 2007-12-12 20:06:49 +0100 (Wed, 12 Dec 2007) | 2 lines
Added two new cave tiles by yosuhara.
........
r3775 | crush_tmw | 2007-12-12 20:25:40 +0100 (Wed, 12 Dec 2007) | 1 line
Fixed the blurred outlines of the new tiles.
........
r3791 | b_lindeijer | 2007-12-18 17:19:53 +0100 (Tue, 18 Dec 2007) | 2 lines
Added initial version of the update analysis tool upalyzer.
........
r3792 | b_lindeijer | 2007-12-18 17:22:27 +0100 (Tue, 18 Dec 2007) | 2 lines
Small fix to the displayed obsolete data percentage.
........
r3793 | b_lindeijer | 2007-12-18 17:31:52 +0100 (Tue, 18 Dec 2007) | 2 lines
Calculate usage percentage correctly and display zip file overhead.
........
r3794 | b_lindeijer | 2007-12-18 19:44:12 +0100 (Tue, 18 Dec 2007) | 4 lines
Optimized with single loop approach and nicer printing calls, inspired by
doener's version. Also added list of update entries and their respective
update.
........
r3795 | b_lindeijer | 2007-12-19 10:26:21 +0100 (Wed, 19 Dec 2007) | 4 lines
Fixed association of entries to update, added no-cache headers, added a bit of
error reporting in case of invalid zip files, kept original ordering of the
update list and sorted the list of entries on their filename.
........
r3796 | b_lindeijer | 2007-12-19 11:32:28 +0100 (Wed, 19 Dec 2007) | 3 lines
Added list of files in each update with indication on whether they are still
used.
........
r3797 | b_lindeijer | 2007-12-19 12:16:24 +0100 (Wed, 19 Dec 2007) | 2 lines
Fixed weird problem with zip_open failing with relative path.
........
r3798 | b_lindeijer | 2007-12-19 12:22:50 +0100 (Wed, 19 Dec 2007) | 2 lines
Incorporated some more of doener's leet PHP skills. ;)
........
r3800 | crush_tmw | 2007-12-19 19:11:22 +0100 (Wed, 19 Dec 2007) | 1 line
Fixed a map bug (monster trap) on map 18 (woodland village surrounding)
........
r3814 | b_lindeijer | 2007-12-24 17:23:56 +0100 (Mon, 24 Dec 2007) | 2 lines
Updated debian subfolder.
........
r3817 | b_lindeijer | 2007-12-25 15:26:22 +0100 (Tue, 25 Dec 2007) | 2 lines
Fixed missing backslash.
........
r3822 | crush_tmw | 2007-12-28 01:26:57 +0100 (Fri, 28 Dec 2007) | 1 line
Some mapping errors fixed by Zipon.
........
r3824 | crush_tmw | 2007-12-29 03:25:16 +0100 (Sat, 29 Dec 2007) | 1 line
Added new map by 5t3v3 (east desert cave) and enhanced version of eastern desert by Len.
........
r3827 | crush_tmw | 2007-12-30 01:28:00 +0100 (Sun, 30 Dec 2007) | 1 line
switched layer compression on.
........
r3830 | crush_tmw | 2008-01-03 18:17:00 +0100 (Thu, 03 Jan 2008) | 1 line
Some map bugs reported by Strump, fixed by Zipon.
........
r3840 | crush_tmw | 2008-01-14 11:22:14 +0100 (Mon, 14 Jan 2008) | 1 line
Added new versions of snow maps by 5t3v3 (with minor fixes)
........
r3845 | crush_tmw | 2008-01-19 12:43:32 +0100 (Sat, 19 Jan 2008) | 1 line
Fixes for the new snowland maps by 5t3v3.
........
r3846 | crush_tmw | 2008-01-19 14:00:37 +0100 (Sat, 19 Jan 2008) | 1 line
Added hot spring particle effect to pond south of snow village.
........
r3873 | crush_tmw | 2008-02-08 23:07:21 +0100 (Fri, 08 Feb 2008) | 1 line
Added Dimonds Cove Restaurant maps.
........
r3875 | crush_tmw | 2008-02-10 15:40:00 +0100 (Sun, 10 Feb 2008) | 1 line
Added Dimonds Cove outdoor map.
........
32 files changed, 2388 insertions, 309 deletions
@@ -1,3 +1,13 @@ +2008-02-10 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_23-1.tmx: Added Dimonds Cove outdoor map by MerlinX420. + +2008-02-08 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_14-1.tmx, data/maps/new_22-1.tmx: Added Dimonds Cove + outdoor map by MerlinX420. Fixed some map bugs in snake dungeon. + * data/items.xml: Added chicken leg meta information. + 2008-02-07 Philipp Sehmisch <tmw@crushnet.org> * src/gui/skill.cpp: Fixed unix compilation problem. @@ -13,7 +23,7 @@ scorpion (incomplete) for testing server-sided monster attribute parsing. -2007-01-28 Philipp Sehmisch <tmw@crushnet.org> +2008-01-28 Philipp Sehmisch <tmw@crushnet.org> * src/game.cpp, src/game.h, src/net/skillhandler.cpp, src/net/skillhandler.h, src/Makefile.am, src/CMakeLists.txt: @@ -54,9 +64,22 @@ 2008-01-19 Philipp Sehmisch <tmw@crushnet.org> + * data/maps/new_10-1.tmx, data/maps/new_11-1.tmx: Map fixes by 5t3v3 at + the new snow maps. Added hot spring particle effect to pond south of + snow village. + * data/graphics/particles/bubbles_32px, + data/graphics/particles/bubbles_12px, + data/graphics/particles/bubbles_8px, + data/graphics/particles/whirlpool.particle.xml: Added bubble particle + effect. * src/resources/itemdb.cpp: Fixed interpretation of weapon types in items.xml. +2008-01-14 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_10-1.tmx, data/maps/new_11-1.tmx: Added new versions of + snow maps by 5t3v3. + 2008-01-10 Philipp Sehmisch <tmw@crushnet.org> * src/resources/itemdb.cpp, src/resources/iteminfo.cpp, @@ -89,6 +112,46 @@ basic attribute modifiers. * tmw.cbp: Updated Code::Blocks project file to include libintl. +2008-01-03 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_1-1.tmx, data/maps/new_3-1.tmx: Some map bugs reported + by Strump, fixed by Zipon. + +2007-12-30 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_22-1.tmx: Some mapping fixes at snake dungeon map. + +2007-12-28 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_7-1.tmx, data/maps/new_22-1.tmx: Added new map by + 5t3v3 (east desert cave) and enhanced version of eastern desert by + Len. + * data/maps/new_3-1.tmx: Some mapping errors fixed by Zipon. + +2007-12-19 Philipp Sehmisch <tmw@crushnet.org> + + * data/maps/new_18-1.tmx: Fixed a map bug (monster trap) on + map 18 (woodland village surrounding) + +2007-12-19 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * tools/upalyzer/analyse.php: Fixed association of entries to update, + added no-cache headers, added a bit of error reporting in case of + invalid zip files, kept original ordering of the update list and + sorted the list of entries on their filename. + * tools/upalyzer/analyse.php: Added list of files in each update with + indication on whether they are still used. + +2007-12-18 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/main.cpp: Remember to delete the progressbar and label also when + the game was not started. + * tools/upalyzer/analyse.php: Added initial version of the update + analysis tool upalyzer. + * tools/upalyzer/analyse.php: Optimized with single loop approach and + nicer printing calls, inspired by doener's version. Also added list of + update entries and their respective update. + 2007-12-18 Philipp Sehmisch <tmw@crushnet.org> * src/gui/char_select.cpp, src/gui/char_select.h, @@ -98,6 +161,27 @@ Updated attribute system to the latest design decisions (removed charisma, kept agility in) +2007-12-12 Philipp Sehmisch <tmw@crushnet.org> + + * data/graphics/tiles/cave.png, data/graphics/tiles/cave_x2.png: + Fixed the blurred outlines of the new tiles. + +2007-12-12 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * data/graphics/tiles/cave.png, data/graphics/tiles/cave_x2.png, + data/maps/new_4-1.tmx: Added two new cave tiles by yosuhara. + +2007-12-12 Philipp Sehmisch <tmw@crushnet.org> + + * tools/tmxcopy/base64.cpp, + tools/tmxcopy/base64.h, tools/tmxcopy/main.cpp, + tools/tmxcopy/map.cpp, tools/tmxcopy/map.hpp, + tools/tmxcopy/readme.txt, tools/tmxcopy/tmxcopy.cbp, + tools/tmxcopy/tostring.h, tools/tmxcopy/xmlutils.cpp, + tools/tmxcopy/xmlutils.h, tools/tmxcopy/zlibutils.cpp, + tools/tmxcopy/zlibutils.h: Added my tmxcopy tool for copying + parts of maps to other maps. + 2007-12-09 Björn Steinbrink <B.Steinbrink@gmx.de> * src/CMakeLists.txt: Add missing source files. @@ -127,6 +211,13 @@ * src/being.cpp: Added interpolation of tile offset for intermediate steps in long moves. +2007-11-20 Philipp Sehmisch <tmw@crushnet.org> + + * data/graphics/maps/new_1-1.tmx, + data/graphics/maps/new_3-1.tmx, + data/graphics/maps/new_15-1.tmx: Updated desert maps with new + tiles by Len. + 2007-11-16 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/resources/resourcemanager.h, src/resources/resource.h, diff --git a/debian/changelog b/debian/changelog index 0cd1763d..bc5b7579 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,132 +1,77 @@ -tmw (0.0.21.1-1) unstable; urgency=low - - * Bugfixes release. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 30 Oct 2006 22:32:00 +0200 - -tmw (0.0.21-2) unstable; urgency=low - - * Readded Music Files in ogg format. - * Added the forgotten data/graphics/items folder to avoid a crash. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 16 Oct 2006 15:52:00 +0200 - -tmw (0.0.21-1) unstable; urgency=low - - * New upstream release: - * Now linked against libguichan-0.5.0. - * Readded the correct music package. - - -- FERREIRA Yohann <bertram@cegetel.net> Wed, 27 Sep 2006 21:40:33 +0200 - -tmw (0.0.20-1) unstable; urgency=low - - * Make use of a own desktop file for the Debian Package. Close the missing icon bug. - * Changed dependency from xlibmesa-dev to libgl1-mesa-dev to cope with new X server. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 29 May 2006 03:55:33 +0200 - -tmw (0.0.19-1) unstable; urgency=low - - * New Playerset Build. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 07 Mar 2006 21:02:33 +0200 - -tmw (0.0.18.1-1) unstable; urgency=low - - * Santa's Build. Merry Christmas. - * Now removes old build dirs. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 25 Dec 2005 11:30:33 +0200 - -tmw (0.0.17-2) unstable; urgency=low - - * Corrected libcurl3 dependencies problem. - * Corrected debhelper's compatibility, simplified rules, - made dependencies calculated more dynamically. - (Thanks to Mickael Koch for advice.) - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 17 Oct 2005 23:40:33 +0200 - -tmw (0.0.17-1) unstable; urgency=low - - * Ninth Release, fully working with OpenGL now. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 10 Oct 2005 20:16:33 +0200 - -tmw (0.0.16-2) unstable; urgency=low - - * Close the missing icon bug. - * Made it compilable in amd64. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 26 Sep 2005 00:22:33 +0200 - -tmw (0.0.16-1) unstable; urgency=low - - * Eighth Release - - -- FERREIRA Yohann <bertram@cegetel.net> Tue, 6 Sep 2005 00:14:33 +0200 - -tmw (0.0.15-1) unstable; urgency=low - - * Seventh Release - - -- FERREIRA Yohann <bertram@cegetel.net> Tue, 2 Aug 2005 00:04:20 +0200 - -tmw (0.0.14.1-1) unstable; urgency=low - - * Bug Fix Release - * Adding the two missing maps - * Fixed a potential crash - * Now compiled against gcc-4.0.0-1 - - -- FERREIRA Yohann <bertram@cegetel.net> Thu, 7 Jul 2005 20:08:20 +0200 - -tmw (0.0.14-1) unstable; urgency=low - - * Sixth Release. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 4 Jul 2005 23:07:19 +0200 - -tmw (0.0.13-3) unstable; urgency=low - - * Adding Three monsters and a map that were forgotten. - - -- FERREIRA Yohann <bertram@cegetel.net> Mon, 6 Jun 2005 20:07:19 +0200 - -tmw (0.0.13-2) unstable; urgency=low - - * Fifth Release, plus bug fixes. - - -- FERREIRA Yohann <bertram@cegetel.net> Sun, 5 Jun 2005 23:41:14 +0200 - -tmw (0.0.13-1) unstable; urgency=low - - * Fifth Release. - - -- FERREIRA Yohann <bertram@cegetel.net> Thu, 3 Jun 2005 18:38:14 +0200 - -tmw (0.0.12-1) unstable; urgency=low - - * Fourth Release. - - -- FERREIRA Yohann <bertram@cegetel.net> Thu, 5 May 2005 13:37:17 +0200 - -tmw (0.0.11.3-1) unstable; urgency=low - - * Third Release. - - -- FERREIRA Yohann <bertram@cegetel.net> Sun, 10 Apr 2005 02:42:17 +0200 - -tmw (0.0.11.2-1) unstable; urgency=low - - * Second Release. - * Bug fixes to first. - - -- FERREIRA Yohann <bertram@cegetel.net> Fri, 9 Apr 2005 02:42:17 +0200 - -tmw (0.0.11.1-1) unstable; urgency=low - - * Initial Release. - - -- FERREIRA Yohann <bertram@cegetel.net> Wed, 7 Apr 2005 02:42:17 +0200 +tmw (0.0.24-1) unstable; urgency=low + + * New upstream release. + * Wrapped configure script options line to a more human readable + format. + * Bumped Standards-Version to 3.7.3. + * Changed description in debian/tmw.menu, it is now called as an + adventure instead of an arcade game. + * Removed the ugly hyphen in the description of debian/tmw.desktop. + * Removed debian/tmw.6 manpage, because it is in upstream now. + * Removed 01-set-gl-texture-zero and 02-guichan_0.7 patches, + because they are fixed in the current upstream release. + * Removed now useless calls of dh_link and dh_installman in + debian/rules. + * Removed debian/tmw-data.docs, because the NEWS and AUTHORS file + is already in the tmw package. + * Removed deprecated encoding flag from debian/tmw.desktop. + * Added debian/watch file. + * Added homepage field to debian/control and removed the one from + the long descriptions. + * Added a break to the long description of tmw-data. It looks now + realy better. + * Added the tmw-dbg package, which provides the debugging symbols. + + -- Patrick Matthäi <patrick.matthaei@web.de> Mon, 24 Dec 2007 17:10:00 +0100 + +tmw (0.0.23-3) unstable; urgency=low + + * Added missing files data/graphics/images/ambient/*.png to + release. + Closes: #439861 + * Added guichan_0.7 patch to build tmw against guichan 0.7.1. + * debian/control: Changed guichan version to libguichan2 and + changed build dependencie from libcurl3-dev to libcurl4-gnutls-dev. + * debian/tmw.menu: Corrected menu entry categorie to Games/Adventure. + Thanks lintian. + * Fixed clean rule. Thanks lintian. + + -- Patrick Matthäi <patrick.matthaei@web.de> Thu, 6 Sep 2007 18:36:00 +0100 + +tmw (0.0.23-2) unstable; urgency=low + + * Added set-gl-texture-zero patch to set GL texture index + to zero when an image uses the SDL backend. + Closes: #427915 + * debian/control: Removed dependencie of tmw-data to tmw. + Closes: #427920 + * debian/control: Set tmw as recommends to tmw-data. + * debian/control: Added dpatch to the build dependencies. + * debian/control: Changed guichan version to libguichan1. + Closes: #435065 + * debian/tmw.docs: Added upstream ChangeLog to package. + * debian/rules: Removed now unneeded '--with-opengl' + configure flag. + + -- Patrick Matthäi <patrick.matthaei@web.de> Wed, 20 Jun 2007 08:55:12 +0100 + +tmw (0.0.23-1) unstable; urgency=low + + * Uploaded tmw to unstable. + Closes: #418725, #423275 + * New upstream release. + * debian/rules: No longer needed the tmw-icon rename + hack. Upstream renamed the icon files. + * debian/tmw.xpm: Added xpm icon file, because upstream + has forgotten it in the newest release. + + -- Patrick Matthäi <patrick.matthaei@web.de> Mon, 5 Jun 2007 21:05:36 +0100 + +tmw (0.0.22.2-1) experimental; urgency=low + + * Initial release. + * Uploading to experimental because we need libguichan0-dev (>= 0.6.1). + * src/main.cpp: + Moved tmw-icon.png to /usr/share/icons/tmw.png. + + -- Patrick Matthäi <patrick.matthaei@web.de> Tue, 6 Mar 2007 09:08:21 +0100 diff --git a/debian/compat b/debian/compat index 8adb55be..7ed6ff82 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -4 +5 diff --git a/debian/control b/debian/control index 45a906b6..4372aaea 100644 --- a/debian/control +++ b/debian/control @@ -1,57 +1,37 @@ Source: tmw +Section: games Priority: optional -Maintainer: FERREIRA Yohann <bertram@cegetel.net> -Build-Depends: debhelper (>= 4.0.0), autotools-dev, docbook-to-man, libsdl1.2-dev (>= 1.2.7), libsdl-image1.2-dev (>= 1.2.3), libsdl-mixer1.2-dev (>= 1.2.5), libguichan0-dev (>= 0.5.0-1), libcurl3-gnutls-dev (>= 7.15.0-1), libxml2-dev (>= 2.4.19), libphysfs-dev (>= 1.0.0-1), libgl1-mesa-dev (>= 6.4.1), libpng12-dev (>= 1.2.5), libsdl-net1.2-dev (>= 1.2.5) -Standards-Version: 3.6.2 +Homepage: http://www.themanaworld.org/ +Maintainer: Patrick Matthäi <patrick.matthaei@web.de> +Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.13.19), dpatch, autotools-dev, libcurl4-gnutls-dev, libgl1-mesa-dev, libguichan2-dev (>= 0.7.1), libsdl1.2-dev, libsdl-image1.2-dev, libsdl-net1.2-dev, libsdl-mixer1.2-dev, libphysfs-dev, libpng12-dev, libxml2-dev, zlib1g-dev +Standards-Version: 3.7.3 Package: tmw -Section: games Architecture: any -Depends: ${shlibs:Depends}, tmw-data (= ${Source-Version}) -Suggests: tmw-music -Description: The Mana World is a Great Online Game - based upon the Seiken Densetsu Serie. - It has its own universe, and - its own character management system, which will - give you the opportunity - to play in a 2D heroic-fantasy world forever. - . - Look at the website for further informations... - . - Web Site: http://themanaworld.org/ +Depends: ${shlibs:Depends}, ${misc:Depends}, tmw-data (= ${source:Version}) +Recommends: tmw-music +Description: The Mana World is a great Online Rolegame + based upon the Seiken Densetsu serie. It has its own universe, and its own + character management system, which will give you the opportunity to play in a + 2D heroic-fantasy world forever. -Package: tmw-data -Section: games -Architecture: all -Depends: tmw (= ${Source-Version}) -Description: The Mana World is a Great Online Game - based upon the Seiken Densetsu Serie. - It has its own universe, and - its own character management system, which will - give you the opportunity - to play in a 2D heroic-fantasy world forever. - . - This package contains the basic datafiles needed - by The Mana World. - . - Look at the website for further informations... - . - Web Site: http://themanaworld.org/ +Package: tmw-dbg +Architecture: any +Priority: extra +Depends: tmw (= ${binary:Version}) +Description: The Mana World is a great Online Rolegame (debugging symbols) + based upon the Seiken Densetsu serie. It has its own universe, and its own + character management system, which will give you the opportunity to play in a + 2D heroic-fantasy world forever. + . + This package provides debugging symbols for the tmw package. -Package: tmw-music -Section: games +Package: tmw-data Architecture: all -Depends: tmw -Description: The Mana World is a Great Online Game - based upon the Seiken Densetsu Serie. - It has its own universe, and - its own character management system, which will - give you the opportunity - to play in a 2D heroic-fantasy world forever. - . - This package contains the optional music files - for The Mana World. - . - Look at the website for further informations... +Recommends: tmw, tmw-music +Description: The Mana World is a great Online Rolegame (data files) + based upon the Seiken Densetsu serie. It has its own universe, and its own + character management system, which will give you the opportunity to play in a + 2D heroic-fantasy world forever. . - Web Site: http://themanaworld.org/ + This package contains the data files. diff --git a/debian/copyright b/debian/copyright index c0df02b9..a6a2b687 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,17 +1,49 @@ -This package was debianized by Yohann FERREIRA <bertram@cegetel.net>. +This package was debianized by Patrick Matthäi <patrick.matthaei@web.de> on +Wed, 6 Feb 2007 09:16:23 +0100. -It was downloaded from http://themanaworld.org/ +It was downloaded from <http://www.themanaworld.org/>. + +Upstream Author: Eugenio Favalli <elvenprogrammer@gmail.com> + +License (src/utils/base64.h, src/utils/base64.cpp): + + Copyright (C) 1997-1998 PHP Development Team + + This program is free software; you can redistribute it and/or modify + it under the terms of one of the following licenses: + + A) 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. + + B) the PHP License as published by the PHP Development Team and + included in the distribution in the file: LICENSE + + 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. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL file. + +License (everything else): + + Copyright (C) 2004-2007 The The Mana World Development Team -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 <http://www.opensource.org/gpl-license.html> - for more details. + 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 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - On Debian systems, the complete text of the GNU General Public - License can be found in /usr/share/common-licenses/GPL file. +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL file. diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 806b7478..00000000 --- a/debian/dirs +++ /dev/null @@ -1,9 +0,0 @@ -usr/lib -usr/lib/menu -usr/share -usr/games -usr/share/applications -usr/share/pixmaps -usr/share/doc -usr/share/doc/tmw -usr/share/man/man6 diff --git a/debian/docs b/debian/docs deleted file mode 100644 index 9a58ad6c..00000000 --- a/debian/docs +++ /dev/null @@ -1,3 +0,0 @@ -README -AUTHORS -NEWS diff --git a/debian/patches/00list b/debian/patches/00list new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/debian/patches/00list diff --git a/debian/rules b/debian/rules index b44be0bc..614ee701 100755 --- a/debian/rules +++ b/debian/rules @@ -1,93 +1,69 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/dpatch/dpatch.make # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -config.status: +config.status: patch dh_testdir - - echo "Generating build information using aclocal, autoheader, automake and autoconf." -# Regerate configuration files - aclocal - autoheader - automake --gnu --add-missing --copy - autoconf - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=/usr/share/man6/man --infodir=/usr/share/doc/tmw --datadir=/usr/share/games --bindir=/usr/games --with-opengl - + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \ + --datadir=/usr/share/games --bindir=/usr/games --mandir=/usr/share/man build: build-stamp - -build-stamp: config.status +build-stamp: config.status dh_testdir - $(MAKE) - docbook-to-man debian/tmw.sgml > debian/tmw.6 - touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp -# Removing dirs from old Debian builds - rm -rf debian/tmw - rm -rf debian/tmw-music - rm -rf debian/tmw-data - - -$(MAKE) distclean -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - - - dh_clean + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean install: build dh_testdir dh_testroot - dh_clean -k + dh_clean -k dh_installdirs -# Build architecture-independent files here. binary-indep: build install + dh_testdir -i + dh_testroot -i + dh_installchangelogs -i ChangeLog + dh_installdocs -i + dh_install -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i - -# Build architecture-dependent files here. binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples - dh_install - dh_installmenu - dh_desktop - dh_installman debian/tmw.6 - dh_link - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_makeshlibs - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh_testdir -a + dh_testroot -a + dh_installchangelogs -a ChangeLog + dh_installdocs -a + dh_install -a + dh_desktop -a + dh_installmenu -a + dh_strip -a --dbg-package=tmw-dbg + 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 +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/debian/tmw-data.dirs b/debian/tmw-data.dirs deleted file mode 100644 index 654af36d..00000000 --- a/debian/tmw-data.dirs +++ /dev/null @@ -1,13 +0,0 @@ -usr/share -usr/share/games -usr/share/games/tmw -usr/share/games/tmw/data -usr/share/games/tmw/data/help -usr/share/games/tmw/data/graphics -usr/share/games/tmw/data/graphics/gui -usr/share/games/tmw/data/graphics/sprites -usr/share/games/tmw/data/graphics/images -usr/share/games/tmw/data/graphics/items -usr/share/games/tmw/data/graphics/tiles -usr/share/games/tmw/data/maps -usr/share/games/tmw/data/sfx diff --git a/debian/tmw-data.install b/debian/tmw-data.install index 74499687..c9f6cb7b 100644 --- a/debian/tmw-data.install +++ b/debian/tmw-data.install @@ -1,10 +1,5 @@ -data/items.xml usr/share/games/tmw/data -data/help/*.txt usr/share/games/tmw/data/help -data/graphics/gui/*.png usr/share/games/tmw/data/graphics/gui -data/graphics/sprites/*.png usr/share/games/tmw/data/graphics/sprites -data/graphics/sprites/*.xml usr/share/games/tmw/data/graphics/sprites -data/graphics/images/*.png usr/share/games/tmw/data/graphics/images -data/graphics/items/*.png usr/share/games/tmw/data/graphics/items -data/graphics/tiles/*.png usr/share/games/tmw/data/graphics/tiles -data/maps/*.tmx.gz usr/share/games/tmw/data/maps -data/sfx/*.ogg usr/share/games/tmw/data/sfx +data/graphics/gui/*.png usr/share/games/tmw/data/graphics/gui +data/graphics/images/*.png usr/share/games/tmw/data/graphics/images +data/graphics/images/ambient/*.png usr/share/games/tmw/data/graphics/images/ambient +data/graphics/tiles/*.png usr/share/games/tmw/data/graphics/tiles +data/help/*.txt usr/share/games/tmw/data/help diff --git a/debian/tmw-music.dirs b/debian/tmw-music.dirs deleted file mode 100644 index 7832b563..00000000 --- a/debian/tmw-music.dirs +++ /dev/null @@ -1,5 +0,0 @@ -usr/share -usr/share/games -usr/share/games/tmw -usr/share/games/tmw/data -usr/share/games/tmw/data/music diff --git a/debian/tmw-music.install b/debian/tmw-music.install deleted file mode 100644 index b3494726..00000000 --- a/debian/tmw-music.install +++ /dev/null @@ -1 +0,0 @@ -data/music/*.ogg usr/share/games/tmw/data/music diff --git a/debian/tmw.desktop b/debian/tmw.desktop index 58277046..f094f668 100644 --- a/debian/tmw.desktop +++ b/debian/tmw.desktop @@ -1,9 +1,8 @@ [Desktop Entry] Version=1.0 -Encoding=UTF-8 Name=The Mana World Name[fr]=Le Monde de Mana -Comment=An on-line fantasy role playing game +Comment=An online fantasy role playing game Comment[fr]=Un jeu en ligne dans un univers fantastique Comment[de]=ein Online Fantasy Spiel Comment[it]=Un gioco fantasy online @@ -11,6 +10,6 @@ Comment[nl]=Een online role playing game Exec=tmw StartupNotify=false Terminal=false -Type=Application -Icon=tmw-icon.png -Categories=Application;Game +Type=Game +Icon=tmw.png +Categories=Game diff --git a/debian/tmw.docs b/debian/tmw.docs new file mode 100644 index 00000000..d622a527 --- /dev/null +++ b/debian/tmw.docs @@ -0,0 +1,6 @@ +AUTHORS +NEWS +README +ChangeLog +docs/progression.txt +docs/FAQ.txt diff --git a/debian/tmw.install b/debian/tmw.install index d8239949..037ccf54 100644 --- a/debian/tmw.install +++ b/debian/tmw.install @@ -1,5 +1,5 @@ -src/tmw usr/games -debian/tmw.desktop usr/share/applications -data/icons/tmw-icon.png usr/share/games/tmw/data/icons -data/icons/tmw-icon.png usr/share/pixmaps -data/icons/tmw-icon.xpm usr/share/pixmaps +debian/tmw.desktop usr/share/applications +debian/tmw.xpm usr/share/pixmaps +data/icons/tmw.png usr/share/icons +docs/tmw.6 usr/share/man/man6 +src/tmw usr/games diff --git a/debian/tmw.menu b/debian/tmw.menu index 5f839a8b..4af5ad0a 100644 --- a/debian/tmw.menu +++ b/debian/tmw.menu @@ -1,7 +1,4 @@ -?package(tmw): \ - needs="X11" \ - section="Games/Arcade" \ - title="The Mana World" \ - longtitle="The Mana World is an Online Fantasy arcade game." \ - command="/usr/games/tmw" \ - icon="tmw-icon.xpm" +?package(tmw):needs="X11" section="Games/Adventure"\ + title="The Mana World"\ + description="The Mana World is an Online Fantasy adventure game."\ + command="/usr/games/tmw" icon="/usr/share/pixmaps/tmw.xpm" diff --git a/debian/tmw.xpm b/debian/tmw.xpm new file mode 100644 index 00000000..46ce5c87 --- /dev/null +++ b/debian/tmw.xpm @@ -0,0 +1,776 @@ +/* XPM */ +static char * tmw_xpm[] = { +"32 32 741 2", +" c None", +". c #E8ED72", +"+ c #E7ED6A", +"@ c #E1EB62", +"# c #D4E758", +"$ c #D2E750", +"% c #CDE748", +"& c #F5F4A1", +"* c #F3F294", +"= c #EBEE81", +"- c #EAEE77", +"; c #E6ED6F", +"> c #E1EB68", +", c #D9E859", +"' c #D3E851", +") c #CCE549", +"! c #C7E643", +"~ c #BEE239", +"{ c #B3DF32", +"] c #F8F8C4", +"^ c #F9F7B3", +"/ c #F4F3A2", +"( c #F4F397", +"_ c #F5F39A", +": c #F2F399", +"< c #E2EA6D", +"[ c #DFEA66", +"} c #DAE95C", +"| c #D3E753", +"1 c #CAE54B", +"2 c #C7E545", +"3 c #BFE23C", +"4 c #B7E034", +"5 c #B1E130", +"6 c #A5DC28", +"7 c #F9F9DA", +"8 c #F9F8CA", +"9 c #F8F7C9", +"0 c #F8F7CD", +"a c #F9F7C7", +"b c #F9F7B8", +"c c #F7F5A8", +"d c #E6EC73", +"e c #E0EA68", +"f c #DBE95D", +"g c #D8E956", +"h c #D2E850", +"i c #C4E343", +"j c #BEE23D", +"k c #B2E036", +"l c #A9DE2E", +"m c #A0DC29", +"n c #91D823", +"o c #F9F9F5", +"p c #F9F9EA", +"q c #F9F9E2", +"r c #F9F8E9", +"s c #F9F8E1", +"t c #F9F7D3", +"u c #F9F7BC", +"v c #F9F7AF", +"w c #E8EE80", +"x c #E2EC6F", +"y c #DBEA61", +"z c #D3E755", +"A c #CAE44C", +"B c #C6E446", +"C c #BDE441", +"D c #B8E337", +"E c #AADE30", +"F c #9DDA2A", +"G c #91D722", +"H c #87D61F", +"I c #7FD61B", +"J c #F9F9F8", +"K c #F9F9F7", +"L c #F9F9F0", +"M c #F9F8EC", +"N c #F9F7E1", +"O c #F9F7D7", +"P c #F9F7C9", +"Q c #F9F7B4", +"R c #EBF092", +"S c #E1EB69", +"T c #DBE95F", +"U c #D3E654", +"V c #CCE44A", +"W c #C9E647", +"X c #BDE13D", +"Y c #B1DE35", +"Z c #A8DD30", +"` c #9BDA29", +" . c #94D823", +".. c #8CD921", +"+. c #82D71C", +"@. c #7CD716", +"#. c #F9F9F9", +"$. c #F9F8F5", +"%. c #F9F7EE", +"&. c #F9F7E4", +"*. c #F9F7D5", +"=. c #F9F7CB", +"-. c #F9F7BF", +";. c #F4F39E", +">. c #E1EA76", +",. c #E0EA69", +"'. c #D9E85D", +"). c #D7E859", +"!. c #CCE64E", +"~. c #C1E343", +"{. c #BBE23C", +"]. c #B0DF34", +"^. c #A9DD2F", +"/. c #9AD928", +"(. c #90D822", +"_. c #8AD81F", +":. c #81D81B", +"<. c #76D517", +"[. c #F9F7F6", +"}. c #F9F7F4", +"|. c #F9F5D3", +"1. c #F9F6C7", +"2. c #F9F6B9", +"3. c #E6EC86", +"4. c #E6ED72", +"5. c #E3ED6C", +"6. c #D6E75E", +"7. c #D1E655", +"8. c #C7E34A", +"9. c #C1E141", +"0. c #B2DD39", +"a. c #B3E135", +"b. c #A6DE30", +"c. c #9BDB29", +"d. c #97DA24", +"e. c #87D71E", +"f. c #82D71B", +"g. c #87DA1F", +"h. c #63CF12", +"i. c #F8F8F8", +"j. c #F9F7F5", +"k. c #F9F5E3", +"l. c #F9F5D4", +"m. c #F9F6B8", +"n. c #EDF198", +"o. c #E1EB6F", +"p. c #E1EC68", +"q. c #D8E95C", +"r. c #D3E752", +"s. c #C9E44A", +"t. c #C7E746", +"u. c #BEE43D", +"v. c #B0E138", +"w. c #A8E02D", +"x. c #A3DF29", +"y. c #B4E226", +"z. c #CDEB2C", +"A. c #B9E925", +"B. c #6DD213", +"C. c #56C90F", +"D. c #F9F8F4", +"E. c #F9F7EB", +"F. c #F9F7F2", +"G. c #F9F5EA", +"H. c #F9F3DE", +"I. c #F9F4CF", +"J. c #F9F5C5", +"K. c #F9F5B8", +"L. c #F8F7B2", +"M. c #F1F495", +"N. c #E3EC6B", +"O. c #D8E859", +"P. c #CEE650", +"Q. c #C8E449", +"R. c #C2E441", +"S. c #BAE139", +"T. c #E7F24F", +"U. c #E3F347", +"V. c #DCF13E", +"W. c #D9F137", +"X. c #CDEE30", +"Y. c #C3EB27", +"Z. c #85D919", +"`. c #4FC90E", +" + c #F7F7F2", +".+ c #F9F9F2", +"++ c #F9F8ED", +"@+ c #F9F5EE", +"#+ c #F9F4E4", +"$+ c #F9F5DC", +"%+ c #F9F6D1", +"&+ c #F9F6C2", +"*+ c #F9F6B7", +"=+ c #F9F6A6", +"-+ c #F8F599", +";+ c #F7F591", +">+ c #F4F584", +",+ c #D7EB61", +"'+ c #C5E447", +")+ c #BAE13E", +"!+ c #B8E23A", +"~+ c #B8E132", +"{+ c #E6F349", +"]+ c #E1F343", +"^+ c #DAF13B", +"/+ c #D2EF33", +"(+ c #CBEE2E", +"_+ c #C1EA25", +":+ c #A9E61F", +"<+ c #55CE10", +"[+ c #4FC60D", +"}+ c #F8F8E9", +"|+ c #F9F9E8", +"1+ c #F9F9E7", +"2+ c #F9F8E4", +"3+ c #F9F7F0", +"4+ c #F9F6EF", +"5+ c #F9F5E7", +"6+ c #F9F3DB", +"7+ c #F9F5D6", +"8+ c #F9F7CE", +"9+ c #F9F7BE", +"0+ c #F9F7B7", +"a+ c #F9F7A5", +"b+ c #F7F691", +"c+ c #F6F588", +"d+ c #F5F580", +"e+ c #DBEE6B", +"f+ c #BAE13D", +"g+ c #B5E137", +"h+ c #A5DB2E", +"i+ c #E0F041", +"j+ c #DBF140", +"k+ c #DAF138", +"l+ c #D1EE32", +"m+ c #C6EB2B", +"n+ c #C0EC27", +"o+ c #BAEB22", +"p+ c #65D517", +"q+ c #4FCC0B", +"r+ c #F9F9D7", +"s+ c #F9F9D6", +"t+ c #F9F8EA", +"u+ c #F9F7E8", +"v+ c #F9F5E5", +"w+ c #F9F5DD", +"x+ c #F9F2D2", +"y+ c #F9F3CA", +"z+ c #F9F6C3", +"A+ c #F9F7BA", +"B+ c #F9F8B2", +"C+ c #F8F89E", +"D+ c #F8F58E", +"E+ c #F5F583", +"F+ c #EFF479", +"G+ c #C5E557", +"H+ c #C5E543", +"I+ c #B9E13B", +"J+ c #9FDA2A", +"K+ c #CEEC3B", +"L+ c #D9EF38", +"M+ c #D4EE32", +"N+ c #D1EF30", +"O+ c #C8ED2A", +"P+ c #C2EB26", +"Q+ c #B5E81E", +"R+ c #80DC1C", +"S+ c #46C80B", +"T+ c #F0F1C0", +"U+ c #F9F8C7", +"V+ c #F9F9C6", +"W+ c #F9F8D5", +"X+ c #F9F7DF", +"Y+ c #F9F6D6", +"Z+ c #F9F5D0", +"`+ c #F9F3C4", +" @ c #F9F3BC", +".@ c #F9F5B5", +"+@ c #F9F7B0", +"@@ c #F9F8A4", +"#@ c #F7F796", +"$@ c #EFF386", +"%@ c #D3E865", +"&@ c #C7E450", +"*@ c #C0E242", +"=@ c #BEE33F", +"-@ c #B5E036", +";@ c #A7DB2F", +">@ c #A0DC2B", +",@ c #C4E32F", +"'@ c #DCF139", +")@ c #D2ED2E", +"!@ c #CAEC2A", +"~@ c #CBEF2B", +"{@ c #BEEA22", +"]@ c #B2E81E", +"^@ c #8FDD17", +"/@ c #3DC209", +"(@ c #33BC07", +"_@ c #F5F5B4", +":@ c #F6F6AE", +"<@ c #F6F6B1", +"[@ c #F7F7B3", +"}@ c #F2F3AB", +"|@ c #F3F198", +"1@ c #F8F5BA", +"2@ c #F9F4B6", +"3@ c #F9F3AF", +"4@ c #F9F4A4", +"5@ c #F8F7A2", +"6@ c #F7F799", +"7@ c #F6F68A", +"8@ c #DDEC69", +"9@ c #CEE74F", +"0@ c #C0E03C", +"a@ c #D5EA4C", +"b@ c #BEE23A", +"c@ c #A9DF2F", +"d@ c #9EDD2A", +"e@ c #BEE22A", +"f@ c #DCF23A", +"g@ c #D4F033", +"h@ c #CBED2A", +"i@ c #C5ED29", +"j@ c #BDEB22", +"k@ c #B4E81E", +"l@ c #A5E618", +"m@ c #41C209", +"n@ c #3ABF07", +"o@ c #DCDC8A", +"p@ c #F3F49B", +"q@ c #F3F49D", +"r@ c #F2F49D", +"s@ c #F4F59F", +"t@ c #F4F59D", +"u@ c #F1F498", +"v@ c #F8F7BF", +"w@ c #F9F6AF", +"x@ c #F8F39A", +"y@ c #F8F594", +"z@ c #F5F57D", +"A@ c #DDEC66", +"B@ c #C2E144", +"C@ c #BDE13F", +"D@ c #BFD82E", +"E@ c #E6EF4E", +"F@ c #E1F04A", +"G@ c #C2E433", +"H@ c #CDEA34", +"I@ c #DDF03F", +"J@ c #D4EF36", +"K@ c #CFEF30", +"L@ c #CBEE2A", +"M@ c #C2EC26", +"N@ c #B7E91F", +"O@ c #ADE71C", +"P@ c #A0E517", +"Q@ c #3FC008", +"R@ c #33BD06", +"S@ c #DDD97B", +"T@ c #F2F392", +"U@ c #F0F28F", +"V@ c #F1F38C", +"W@ c #F6F7BE", +"X@ c #F5F6B7", +"Y@ c #F5F5B2", +"Z@ c #F9F6A7", +"`@ c #F9F6A3", +" # c #F8F59C", +".# c #F8F38D", +"+# c #F7F58C", +"@# c #F5F687", +"## c #F3F576", +"$# c #F0F575", +"%# c #DDEC57", +"&# c #D8EA49", +"*# c #DDE946", +"=# c #E8F14F", +"-# c #E3F148", +";# c #E2F346", +"># c #E1F345", +",# c #D8F039", +"'# c #D1EF31", +")# c #CAED2C", +"!# c #C4EC27", +"~# c #C1ED24", +"{# c #B6EA1F", +"]# c #AFEA1C", +"^# c #A4E717", +"/# c #3EBF08", +"(# c #37C206", +"_# c #E8EB6C", +":# c #E6ED76", +"<# c #E4EC73", +"[# c #ECEF86", +"}# c #F8F7A7", +"|# c #F9F7A7", +"1# c #F8F7A3", +"2# c #F8F69D", +"3# c #F8F69A", +"4# c #F7F48A", +"5# c #F6F27B", +"6# c #F6F482", +"7# c #F3F57B", +"8# c #F1F574", +"9# c #F0F46C", +"0# c #EBF25E", +"a# c #EBF259", +"b# c #E7F152", +"c# c #E1EF44", +"d# c #DFEF40", +"e# c #D7EE3B", +"f# c #DAF039", +"g# c #D7F137", +"h# c #D1F032", +"i# c #CCEF2C", +"j# c #C6EE26", +"k# c #B7EA1F", +"l# c #AAE81A", +"m# c #97E415", +"n# c #37BE07", +"o# c #2CAF05", +"p# c #D5DC5B", +"q# c #E4ED6F", +"r# c #E9F082", +"s# c #F8F7A1", +"t# c #F8F79D", +"u# c #F7F696", +"v# c #F6F68B", +"w# c #F5F37B", +"x# c #F5F378", +"y# c #F3F372", +"z# c #F1F36C", +"A# c #EEF468", +"B# c #ECF35D", +"C# c #EAF256", +"D# c #E7F151", +"E# c #E4F148", +"F# c #E0F043", +"G# c #E1F143", +"H# c #D9EF39", +"I# c #D2ED31", +"J# c #CEF030", +"K# c #C9EF2A", +"L# c #C0ED25", +"M# c #ADE61C", +"N# c #A7E619", +"O# c #A5E818", +"P# c #80D913", +"Q# c #34BE06", +"R# c #35BF05", +"S# c #E0EC61", +"T# c #E4ED72", +"U# c #F7F792", +"V# c #F7F791", +"W# c #F8F78F", +"X# c #F6F687", +"Y# c #F6F688", +"Z# c #F3F377", +"`# c #F4F474", +" $ c #F1F472", +".$ c #EEF46D", +"+$ c #DEEB59", +"@$ c #E7F059", +"#$ c #E9F356", +"$$ c #E9F255", +"%$ c #E7F24D", +"&$ c #E6F245", +"*$ c #E4F243", +"=$ c #DFF240", +"-$ c #D7EF36", +";$ c #CCEB2B", +">$ c #CDEE2C", +",$ c #C5ED2A", +"'$ c #BDEB25", +")$ c #ADE71E", +"!$ c #A6E51A", +"~$ c #9AE316", +"{$ c #93E214", +"]$ c #5CC30B", +"^$ c #34BD05", +"/$ c #DDEC59", +"($ c #D6E858", +"_$ c #F5F57C", +":$ c #F5F680", +"<$ c #F5F67E", +"[$ c #F5F67C", +"}$ c #F4F574", +"|$ c #F1F26A", +"1$ c #F2F46F", +"2$ c #EFF468", +"3$ c #BCE24A", +"4$ c #BBDF38", +"5$ c #B9DB30", +"6$ c #C3DF33", +"7$ c #DDED42", +"8$ c #E5F249", +"9$ c #DEF03D", +"0$ c #D5EF35", +"a$ c #CEEE2E", +"b$ c #C1E925", +"c$ c #B9E923", +"d$ c #B1E71E", +"e$ c #ABE619", +"f$ c #A8E517", +"g$ c #94E113", +"h$ c #83DE11", +"i$ c #35AD06", +"j$ c #2FBB04", +"k$ c #CEE249", +"l$ c #CFE54B", +"m$ c #E8F16F", +"n$ c #F5F578", +"o$ c #F4F674", +"p$ c #F1F46D", +"q$ c #F2F268", +"r$ c #F1F366", +"s$ c #EFF462", +"t$ c #DEEF5B", +"u$ c #B3E039", +"v$ c #B4E037", +"w$ c #AEDE31", +"x$ c #A6DB2B", +"y$ c #BBE331", +"z$ c #E3F243", +"A$ c #DFF141", +"B$ c #D9F038", +"C$ c #D9F136", +"D$ c #CDEF2E", +"E$ c #C7EE2A", +"F$ c #BDEB24", +"G$ c #B7EA1D", +"H$ c #A0E316", +"I$ c #96E214", +"J$ c #93E212", +"K$ c #6DD10D", +"L$ c #2CAD04", +"M$ c #2AB303", +"N$ c #CDE746", +"O$ c #CDE74B", +"P$ c #F0F56D", +"Q$ c #F2F46A", +"R$ c #F0F264", +"S$ c #ECF15A", +"T$ c #EFF361", +"U$ c #EDF45A", +"V$ c #EBF45C", +"W$ c #B9E239", +"X$ c #B6E335", +"Y$ c #ADE02E", +"Z$ c #A9E02B", +"`$ c #A4DE28", +" % c #DFF243", +".% c #D7EF35", +"+% c #D5EF31", +"@% c #D4F031", +"#% c #CDEF2C", +"$% c #C7ED28", +"%% c #C6EE27", +"&% c #C1EE23", +"*% c #B6EC1F", +"=% c #A7E818", +"-% c #67CC0E", +";% c #47C208", +">% c #34B906", +",% c #2DBD04", +"'% c #C1E23C", +")% c #C3E53E", +"!% c #D7EB4F", +"~% c #EEF257", +"{% c #ECF057", +"]% c #EAF051", +"^% c #EBF255", +"/% c #EBF452", +"(% c #E9F450", +"_% c #B8E137", +":% c #A3DB2A", +"<% c #A5DF2B", +"[% c #98DA26", +"}% c #8CD621", +"|% c #90D41D", +"1% c #BFE326", +"2% c #D0EE2D", +"3% c #CEEF2E", +"4% c #C8EE28", +"5% c #C1ED26", +"6% c #BCEC22", +"7% c #B9ED20", +"8% c #9FE419", +"9% c #70CD0F", +"0% c #35B906", +"a% c #34C005", +"b% c #30C005", +"c% c #26B503", +"d% c #B7E036", +"e% c #B7E239", +"f% c #E2EF4B", +"g% c #EBF451", +"h% c #E5F14B", +"i% c #E4F04B", +"j% c #E7F451", +"k% c #E6F44B", +"l% c #B6DD2C", +"m% c #ABDC25", +"n% c #B4DF23", +"o% c #A3D61D", +"p% c #96D91D", +"q% c #86D218", +"r% c #B3DE21", +"s% c #CAED2B", +"t% c #C6EC25", +"u% c #BEEB22", +"v% c #BDEC20", +"w% c #B3EA1D", +"x% c #9AE017", +"y% c #46BC07", +"z% c #40C107", +"A% c #35C206", +"B% c #2EBE05", +"C% c #2BBD04", +"D% c #B2E130", +"E% c #B5E334", +"F% c #DFF042", +"G% c #E4F147", +"H% c #E5F348", +"I% c #E2F246", +"J% c #E4F445", +"K% c #DFF33F", +"L% c #E0F33D", +"M% c #DCF238", +"N% c #D8F034", +"O% c #D2EF2E", +"P% c #CBEB29", +"Q% c #D1EF2D", +"R% c #C7ED26", +"S% c #C5EE26", +"T% c #B7EA20", +"U% c #B5EA1D", +"V% c #AEEA1B", +"W% c #85D813", +"X% c #3FC208", +"Y% c #3AC507", +"Z% c #33C005", +"`% c #2BBB04", +" & c #26A903", +".& c #A9E029", +"+& c #A5DF29", +"@& c #A5DE29", +"#& c #D8EE3D", +"$& c #E4F341", +"%& c #E2F340", +"&& c #E0F33C", +"*& c #DDF239", +"=& c #D9F236", +"-& c #D6F133", +";& c #D3F131", +">& c #CEEE2A", +",& c #CEEF28", +"'& c #CBEF29", +")& c #BFEB22", +"!& c #B2EB23", +"~& c #81DD1D", +"{& c #6DCF11", +"]& c #68D10F", +"^& c #4CCB0E", +"/& c #39C407", +"(& c #33C106", +"_& c #2ABB04", +":& c #27B803", +"<& c #97DA23", +"[& c #98DC24", +"}& c #95DC23", +"|& c #93DB25", +"1& c #99DF2A", +"2& c #C6EC31", +"3& c #C6EB2E", +"4& c #ADE026", +"5& c #C1E928", +"6& c #CCEE29", +"7& c #C9ED26", +"8& c #B9EA21", +"9& c #8FD718", +"0& c #4FC30C", +"a& c #4DCB0B", +"b& c #49CB0A", +"c& c #3DC508", +"d& c #3DC808", +"e& c #34C306", +"f& c #2DBC04", +"g& c #2CBF04", +"h& c #88D81D", +"i& c #87D81A", +"j& c #86D81A", +"k& c #7ED518", +"l& c #75D015", +"m& c #71D113", +"n& c #84DB1A", +"o& c #9DE524", +"p& c #7CD316", +"q& c #62CA0E", +"r& c #5AC80B", +"s& c #55C90B", +"t& c #46CA0A", +"u& c #41C708", +"v& c #3DC907", +"w& c #36C406", +"x& c #30C205", +"y& c #27AA04", +"z& c #75D016", +"A& c #79D516", +"B& c #73D515", +"C& c #6AD113", +"D& c #6CD413", +"E& c #65D211", +"F& c #5BCD0F", +"G& c #56CD0E", +"H& c #58D10E", +"I& c #50CC0C", +"J& c #48C809", +"K& c #40C708", +"L& c #3FC607", +"M& c #40C907", +"N& c #38C706", +"O& c #32C105", +"P& c #57BE0F", +"Q& c #61D111", +"R& c #66D411", +"S& c #62D20F", +"T& c #57CD0D", +"U& c #57D00C", +"V& c #4DCC0C", +"W& c #4BCD0A", +"X& c #40C608", +"Y& c #3DC807", +"Z& c #30B505", +"`& c #4BBC0B", +" * c #4CC20A", +".* c #48BF0A", +"+* c #45C109", +"@* c #38B507", +"#* c #31B506", +" . + @ # $ % ", +" & * = - ; > , ' ) ! ~ { ", +" ] ^ / ( _ : < [ } | 1 2 3 4 5 6 ", +" 7 8 9 0 a b c d e f g h i j k l m n ", +" o p q r s t a u v w x y z A B C D E F G H I ", +" J K L o M N O P u Q R S T U V W X Y Z ` ...+.@. ", +" #.K J $.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<. ", +" #.#.J [.}.%.&.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h. ", +" i.#.K [.j.}.%.k.l.1.m.n.o.p.q.r.s.t.u.v.E w.x.y.z.A.B.C. ", +" #.K D.E.}.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.D T.U.V.W.X.Y.Z.`. ", +" +.+.+++&.F.@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+[+ ", +" }+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+9.f+g+h+i+j+k+l+m+n+o+p+q+ ", +" r+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+].J+K+L+M+N+O+P+Q+R+S+ ", +"T+U+V+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@", +"_@:@<@[@[@}@|@1@2@3@4@5@6@7@8@9@W 0@a@b@c@d@e@f@g@h@i@j@k@l@m@n@", +"o@p@q@r@s@t@u@v@w@4@x@y@b+z@A@B@C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@", +"S@T@U@V@W@X@Y@Z@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#^#/#(#", +"_#:#<#[#}#|#1#2#3#4#5#6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#O@l#m#n#o#", +"p#q#r#5@s#t#u#b+v#w#x#y#z#A#B#C#D#E#F#G#H#I#'#J#K#L#M#N#O#P#Q#R#", +" S#T#U#V#W#X#Y#Z#`# $.$+$@$#$$$%$&$*$=$-$;$>$,$'$)$!$~${$]$^$ ", +" /$($_$:$<$[$}$|$1$2$3$4$5$6$7$8$G#9$k+0$a$b$c$d$e$f$g$h$i$j$ ", +" k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z$A$B$C$'#D$E$F$G$H$I$J$K$L$M$ ", +" N$O$P$Q$R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%$%%%&%*%=%-%;%>%,% ", +" '%)%!%~%{%]%^%/%(%_%:%<%[%}%|%1%2%3%4%5%6%7%8%9%0%a%b%c% ", +" d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%A%B%C% ", +" D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%`% & ", +" .&+&@&#&$&%&&&*&=&-&;&>&,&'&)&!&~&{&]&^&/&(&_&:& ", +" <&[&}&|&1&2&3&4&5&6&7&{@8&9&0&a&b&c&d&e&f&g& ", +" h&i&j&k&l&m&n&o&p&q&r&s&a&t&u&v&w&x&y& ", +" z&A&B&C&D&E&F&G&H&I&J&K&L&M&N&O& ", +" P&Q&R&S&T&U&V&W&X&Y&v&Z& ", +" `& *.*+*@*#* "}; diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..01aa13f7 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/themanaworld/tmw-(.*)\.tar\.gz diff --git a/tools/tmxcopy/base64.cpp b/tools/tmxcopy/base64.cpp new file mode 100644 index 00000000..9a8f6356 --- /dev/null +++ b/tools/tmxcopy/base64.cpp @@ -0,0 +1,149 @@ +/* + +----------------------------------------------------------------------+ + | PHP HTML Embedded Scripting Language Version 3.0 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2000 PHP Development Team (See Credits file) | + +----------------------------------------------------------------------+ + | This program is free software; you can redistribute it and/or modify | + | it under the terms of one of the following licenses: | + | | + | A) 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. | + | | + | B) the PHP License as published by the PHP Development Team and | + | included in the distribution in the file: LICENSE | + | | + | 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 both licenses referred to here. | + | If you did not, or have any questions about PHP licensing, please | + | contact core@php.net. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead (jimw@php.net) | + +----------------------------------------------------------------------+ + */ +/* $Id$ */ + +#include <string.h> +#include <stdlib.h> + +#include "base64.h" + +static char base64_table[] = +{ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' +}; +static char base64_pad = '='; + +unsigned char *php3_base64_encode(const unsigned char *string, int length, int *ret_length) { + const unsigned char *current = string; + int i = 0; + unsigned char *result = (unsigned char *)malloc(((length + 3 - length % 3) * 4 / 3 + 1) * sizeof(char)); + + while (length > 2) { /* keep going until we have less than 24 bits */ + result[i++] = base64_table[current[0] >> 2]; + result[i++] = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + result[i++] = base64_table[((current[1] & 0x0f) << 2) + (current[2] >> 6)]; + result[i++] = base64_table[current[2] & 0x3f]; + + current += 3; + length -= 3; /* we just handle 3 octets of data */ + } + + /* now deal with the tail end of things */ + if (length != 0) { + result[i++] = base64_table[current[0] >> 2]; + if (length > 1) { + result[i++] = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)]; + result[i++] = base64_table[(current[1] & 0x0f) << 2]; + result[i++] = base64_pad; + } + else { + result[i++] = base64_table[(current[0] & 0x03) << 4]; + result[i++] = base64_pad; + result[i++] = base64_pad; + } + } + if(ret_length) { + *ret_length = i; + } + result[i] = '\0'; + return result; +} + +/* as above, but backwards. :) */ +unsigned char *php3_base64_decode(const unsigned char *string, int length, int *ret_length) { + const unsigned char *current = string; + int ch, i = 0, j = 0, k; + char *chp; + + unsigned char *result = (unsigned char *)malloc(length + 1); + + if (result == NULL) { + return NULL; + } + + /* run through the whole string, converting as we go */ + while ((ch = *current++) != '\0') { + if (ch == base64_pad) break; + + /* When Base64 gets POSTed, all pluses are interpreted as spaces. + This line changes them back. It's not exactly the Base64 spec, + but it is completely compatible with it (the spec says that + spaces are invalid). This will also save many people considerable + headache. - Turadg Aleahmad <turadg@wise.berkeley.edu> + */ + + if (ch == ' ') ch = '+'; + + chp = strchr(base64_table, ch); + if (chp == NULL) continue; + ch = chp - base64_table; + + switch(i % 4) { + case 0: + result[j] = ch << 2; + break; + case 1: + result[j++] |= ch >> 4; + result[j] = (ch & 0x0f) << 4; + break; + case 2: + result[j++] |= ch >>2; + result[j] = (ch & 0x03) << 6; + break; + case 3: + result[j++] |= ch; + break; + } + i++; + } + + k = j; + /* mop things up if we ended on a boundary */ + if (ch == base64_pad) { + switch(i % 4) { + case 0: + case 1: + free(result); + return NULL; + case 2: + k++; + case 3: + result[k++] = 0; + } + } + if(ret_length) { + *ret_length = j; + } + result[k] = '\0'; + return result; +} diff --git a/tools/tmxcopy/base64.h b/tools/tmxcopy/base64.h new file mode 100644 index 00000000..ff20ac53 --- /dev/null +++ b/tools/tmxcopy/base64.h @@ -0,0 +1,37 @@ +/* + +----------------------------------------------------------------------+ + | PHP HTML Embedded Scripting Language Version 3.0 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997,1998 PHP Development Team (See Credits file) | + +----------------------------------------------------------------------+ + | This program is free software; you can redistribute it and/or modify | + | it under the terms of one of the following licenses: | + | | + | A) 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. | + | | + | B) the PHP License as published by the PHP Development Team and | + | included in the distribution in the file: LICENSE | + | | + | 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 both licenses referred to here. | + | If you did not, or have any questions about PHP licensing, please | + | contact core@php.net. | + +----------------------------------------------------------------------+ + | Author: Jim Winstead (jimw@php.net) | + +----------------------------------------------------------------------+ + */ +/* $Id$ */ + +#ifndef _TMW_BASE64_H +#define _TMW_BASE64_H + +extern unsigned char *php3_base64_encode(const unsigned char *, int, int *); +extern unsigned char *php3_base64_decode(const unsigned char *, int, int *); + +#endif /* _TMW_BASE64_H */ diff --git a/tools/tmxcopy/main.cpp b/tools/tmxcopy/main.cpp new file mode 100644 index 00000000..3d460961 --- /dev/null +++ b/tools/tmxcopy/main.cpp @@ -0,0 +1,66 @@ +/* + * TMXCopy + * Copyright 2007 Philipp Sehmisch + * + * + * TMXCopy 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 + * any later version. + * + * TMXCopy 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 TMXCopy; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <iostream> +#include <string> + +#include "map.hpp" + +int main(int argc, char * argv[] ) +{ + // parsing command line options + if (argc < 9 || argc > 10) + { + std::cerr<<"Usage: srcFile x y height width tgtFile x y [outfile]"; + return -1; + } + + std::string srcFile = argv[1]; + int srcX= atoi(argv[2]); + int srcY= atoi(argv[3]); + int height= atoi(argv[4]); + int width=atoi(argv[5]); + std::string tgtFile = argv[6]; + int destX=atoi(argv[7]); + int destY=atoi(argv[8]); + std::string outFile = tgtFile; + if (argc == 10) outFile = argv[9]; + + // plausibility check of command line options + if (height < 1 || width < 1 || srcX < 1 || srcY < 1 || destX < 1 || destY < 1) + { + std::cerr<<"Illegal coordinates!"<<std::endl; + std::cerr<<"Usage: sourceFile x y height width targetFile x y [outputFile]"<<std::endl; + return -1; + } + + try + { + Map* srcMap = new Map(srcFile); + Map* tgtMap = new Map(tgtFile); + tgtMap->overwrite(srcMap, srcX, srcY, height, width, destX, destY); + tgtMap->save(outFile); + } + catch (int) + { + return -1; + } + +} diff --git a/tools/tmxcopy/map.cpp b/tools/tmxcopy/map.cpp new file mode 100644 index 00000000..0674ae1a --- /dev/null +++ b/tools/tmxcopy/map.cpp @@ -0,0 +1,371 @@ +/* + * TMXCopy + * Copyright 2007 Philipp Sehmisch + * + * + * TMXCopy 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 + * any later version. + * + * TMXCopy 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 TMXCopy; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <iostream> +#include <map> +#include <list> + +#include <zlib.h> + +#include "xmlutils.h" +#include "zlibutils.h" +#include "base64.h" +#include "tostring.h" + +#include "map.hpp" + +Map::Map(std::string filename): + mMaxGid(0) +{ + std::cout<<"Loading map "<<filename<<std::endl; + //load XML tree + mXmlDoc = xmlReadFile(filename.c_str(), NULL, 0); + + if (!mXmlDoc) + { + std::cerr<<"Could not load "<<filename; + throw 1; + } + + xmlNodePtr rootNode = xmlDocGetRootElement(mXmlDoc); + + if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "map")) { + std::cerr<<filename<<"is not a Tiled map file!"; + throw 1; + } + + mWidth = XML::getProperty(rootNode, "width", 0); + mHeight = XML::getProperty(rootNode, "height", 0); + int layerNum = 0; + for_each_xml_child_node(node, rootNode) + { + if (xmlStrEqual(node->name, BAD_CAST "tileset")) + { + //add tilesets to vector of used tilesets + Tileset* tileset = new Tileset; + tileset->name = XML::getProperty(node, "name", "Unnamed"); + tileset->tilewidth = XML::getProperty(node, "tilewidth", 0); + tileset->tileheight = XML::getProperty(node, "tileheight", 0); + tileset->firstgid = XML::getProperty(node, "firstgid", 0); + for_each_xml_child_node(imageNode, node) + { + if (xmlStrEqual(imageNode->name, BAD_CAST "image")) + tileset->imagefile = XML::getProperty(imageNode, "source", ""); + } + + //add tileset to tileset list + Map::mTilesets.push_back(tileset); + } + } + + for_each_xml_child_node(node, rootNode) + { + if (xmlStrEqual(node->name, BAD_CAST "layer")) + { + Layer* layer = new Layer; + layer->resize(mWidth * mHeight); + //build layer information + for_each_xml_child_node(dataNode, node) + { + if (!xmlStrEqual(dataNode->name, BAD_CAST "data")) continue; + + std::string encoding = XML::getProperty(dataNode, "encoding", ""); + std::string compression = XML::getProperty(dataNode, "compression", ""); + + if (encoding != "base64") + { + std::cerr<<"Layers in "<<filename<<" are not base64 encoded!"; + return; + } + + // Read base64 encoded map file + xmlNodePtr dataChild = dataNode->xmlChildrenNode; + if (!dataChild) + continue; + + int len = strlen((const char*)dataChild->content) + 1; + unsigned char *charData = new unsigned char[len + 1]; + const char *charStart = (const char*)dataChild->content; + unsigned char *charIndex = charData; + + while (*charStart) { + if (*charStart != ' ' && *charStart != '\t' && + *charStart != '\n') + { + *charIndex = *charStart; + charIndex++; + } + charStart++; + } + *charIndex = '\0'; + + int binLen; + unsigned char *binData = + php3_base64_decode(charData, strlen((char*)charData), &binLen); + + delete[] charData; + + if (binData) { + if (compression == "gzip") + { + unsigned char *inflated; + unsigned int inflatedSize = + inflateMemory(binData, binLen, inflated); + free(binData); + binData = inflated; + binLen = inflatedSize; + if (inflated == NULL) + { + std::cerr<<"Error: while decompressing layer "<<layerNum<<" in "<<filename; + throw 1; + } + } + + int c = 0; + for (int i = 0; i < binLen - 3; i += 4) { + int gid = binData[i] | + binData[i + 1] << 8 | + binData[i + 2] << 16 | + binData[i + 3] << 24; + + if (gid == 0) + { + layer->at(c).tileset = -1; + layer->at(c).index = 0; + } + else + { + for (int s = mTilesets.size()-1; s >= 0; s--) + { + if (mTilesets.at(s)->firstgid < gid) + { + layer->at(c).tileset = s; + layer->at(c).index = gid - mTilesets.at(s)->firstgid; + if (mMaxGid < gid) mMaxGid = gid; + break; + } + } + } + + c++; + } + free(binData); + } else { + std::cerr<<"error processing layer data in "<<filename<<std::endl; + } + } + mLayers.push_back(layer); + layerNum++; + } + } + + std::cout<<"tilesets: "<<mTilesets.size()<<std::endl; + std::cout<<"layers:"<<mLayers.size()<<std::endl; + std::cout<<"largest GID:"<<mMaxGid<<std::endl<<std::endl; +} + +bool Map::overwrite( Map* srcMap, + int srcX, int srcY, int srcWidth, int srcHeight, + int destX, int destY) +{ + //plausibility check of coordinates + bool checkPassed = true; + if (srcX + srcWidth > srcMap->getWidth()) { + std::cerr<<"Error: Area exceeds right map border of source map!"; + checkPassed = false; + } + if (srcY + srcHeight > srcMap->getHeight()) { + std::cerr<<"Error: Area exceeds lower map border of source map!"; + checkPassed = false; + } + if (destX + srcWidth > mWidth) { + std::cerr<<"Error: Area exceeds right map border of target map!"; + checkPassed = false; + } + if (destY + srcHeight > mHeight) { + std::cerr<<"Error: Area exceeds lower map border of target map!"; + checkPassed = false; + } + if (!checkPassed) return false; + + std::map<int, int> translation; + translation[-1] = -1; + std::vector<Tileset*>* srcTilesets = srcMap->getTilesets(); + + //add new tilesets and add redundant tilesets to list of redundand tilesets + for (int a = 0; a < srcTilesets->size(); a++) + { + int b; + for (b = 0; b < mTilesets.size(); b++) + { + if (*srcTilesets->at(a) == *mTilesets.at(b)) + { + break; + } + } + if (b == mTilesets.size()) + { + mMaxGid += srcTilesets->at(a)->firstgid; + srcTilesets->at(a)->firstgid = mMaxGid;//it is possible to get some holes in the gid index this way but who cares, we got 32bit. + mTilesets.push_back(srcTilesets->at(a)); + } + translation[a] = b; + } + + //combining layer information + for (int i = 0; i < srcMap->getNumberOfLayers(); i++) + { + Layer* srcLayer = srcMap->getLayer(i); + Layer* destLayer = mLayers.at(i); + + for (int y=0; y<srcWidth; y++) + { + + for (int x=0; x<srcHeight; x++) + { + int srcIndex = srcMap->getWidth() * (y + srcY) + (x + srcX); + int tgtIndex = mWidth * (y + destY) + (x + destX); + Tile tmpTile = srcLayer->at(srcIndex); + tmpTile.tileset = translation[tmpTile.tileset]; + destLayer->at(tgtIndex) = tmpTile; + } + } + } + + std::clog<<"copying successful!"<<std::endl; +} + +int Map::save(std::string filename) +{ + //remove old tileset and layer information in XML tree + xmlNodePtr rootNode = xmlDocGetRootElement(mXmlDoc); + std::list<xmlNodePtr> toRemove; + for_each_xml_child_node(node, rootNode) + { + if ( xmlStrEqual(node->name, BAD_CAST "tileset") + || xmlStrEqual(node->name, BAD_CAST "layer")) + { + toRemove.push_back(node); + } + } + + while (!toRemove.empty()) + { + xmlUnlinkNode(toRemove.back()); + xmlFreeNode(toRemove.back()); + toRemove.pop_back(); + } + + //TODO: reorganize GIDs + + //add new tileset information to XML tree + for (int i = 0; i< mTilesets.size(); i++) + { + xmlNodePtr newNode; + + xmlAddChild(rootNode, xmlNewDocText(mXmlDoc, BAD_CAST " ")); + newNode = xmlNewNode(NULL, BAD_CAST "tileset"); + xmlNewProp(newNode, BAD_CAST "name", BAD_CAST mTilesets.at(i)->name.c_str()); + xmlNewProp(newNode, BAD_CAST "firstgid", BAD_CAST toString(mTilesets.at(i)->firstgid).c_str()); + xmlNewProp(newNode, BAD_CAST "tilewidth", BAD_CAST toString(mTilesets.at(i)->tilewidth).c_str()); + xmlNewProp(newNode, BAD_CAST "tileheight", BAD_CAST toString(mTilesets.at(i)->tileheight).c_str()); + xmlAddChild(newNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlNodePtr imageNode = xmlNewNode(NULL, BAD_CAST "image"); + xmlNewProp(imageNode, BAD_CAST "source", BAD_CAST mTilesets.at(i)->imagefile.c_str()); + xmlAddChild(newNode, imageNode); + xmlAddChild(newNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlAddChild(rootNode, newNode); + xmlAddChild(rootNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n")); + } + + //add new layer information to XML tree + for (int i = 0; i < mLayers.size(); i++) + { + //lay out layer information in binary + unsigned char* binData = (unsigned char*)malloc(mWidth * mHeight * 4); + + for (int a=0; a < mWidth * mHeight; a++) + { + Tile tile = mLayers.at(i)->at(a); + int ldata; + if (tile.tileset != -1) + { + ldata = tile.index + mTilesets.at(tile.tileset)->firstgid; + } else { + ldata = 0; + } + + binData[a * 4 + 0] = (ldata & 0x000000ff); + binData[a * 4 + 1] = (ldata & 0x0000ff00) >> 8; + binData[a * 4 + 2] = (ldata & 0x00ff0000) >> 16; + binData[a * 4 + 3] = (ldata & 0xff000000) >> 24; + } + + + // GZIP layer information + // Doesn't work yet. + /* + unsigned char* gzipData = (unsigned char*)malloc((mWidth * mHeight * 4) + 128); + unsigned int gzipLen; + compressMemory (binData, (mWidth * mHeight * 4) + 128, gzipData, gzipLen); + free (binData); + std::cout<<"GZIP length: "<<gzipLen<<std::endl; + */ + + //encode layer information in base64 + unsigned char* base64Data; + int base64len; + //base64Data = php3_base64_encode(gzipData, gzipLen, &base64len); + base64Data = php3_base64_encode(binData, (mWidth * mHeight * 4), &base64len); + //free(gzipData); + + xmlNodePtr newNode; + xmlAddChild(rootNode, xmlNewDocText(mXmlDoc, BAD_CAST " ")); + newNode = xmlNewNode(NULL, BAD_CAST "layer"); + xmlNewProp(newNode, BAD_CAST "name", BAD_CAST ("Layer" + toString(i)).c_str()); + xmlNewProp(newNode, BAD_CAST "width", BAD_CAST toString(mWidth).c_str()); + xmlNewProp(newNode, BAD_CAST "height", BAD_CAST toString(mHeight).c_str()); + xmlAddChild(newNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlNodePtr dataNode = xmlNewNode(NULL, BAD_CAST "data"); + xmlNewProp(dataNode, BAD_CAST "encoding", BAD_CAST "base64"); + //xmlNewProp(dataNode, BAD_CAST "compression", BAD_CAST "gzip"); + xmlAddChild(dataNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlAddChild(dataNode, xmlNewDocText(mXmlDoc, BAD_CAST base64Data)); + xmlAddChild(dataNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlAddChild(newNode, dataNode); + xmlAddChild(newNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n ")); + xmlAddChild(rootNode, newNode); + xmlAddChild(rootNode, xmlNewDocText(mXmlDoc, BAD_CAST "\n")); + } + + //save XML tree + int retval = xmlSaveFile(filename.c_str(), mXmlDoc); + + if (retval == -1) + { + std::cerr<<"Could not write outfile "<<filename<<std::endl; + return false; + } + else + { + std::cout<<"File saved successfully to"<<filename<<std::endl; + return true; + } +} diff --git a/tools/tmxcopy/map.hpp b/tools/tmxcopy/map.hpp new file mode 100644 index 00000000..89ae1405 --- /dev/null +++ b/tools/tmxcopy/map.hpp @@ -0,0 +1,81 @@ +/* + * TMXCopy + * Copyright 2007 Philipp Sehmisch + * + * + * TMXCopy 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 + * any later version. + * + * TMXCopy 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 TMXCopy; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <string> +#include <vector> +#include <set> +#include <libxml/parser.h> + +struct Tileset +{ + std::string imagefile; + int firstgid; + std::string name; + int tilewidth; + int tileheight; + + bool operator== (Tileset const& a) + { + return (imagefile == a.imagefile && + tilewidth == a.tilewidth && + tileheight == a.tileheight + ); + } +}; + +struct Tile +{ + int tileset; // number of tileset + size_t index; // index in said tileset +}; + +typedef std::vector<Tile> Layer; + +class Map +{ + public: + Map(std::string filename); + + bool overwrite( Map* srcMap, + int srcX, int srcY, int srcWidth, int srcHeight, + int destX, int destY); + + int save(std::string filename); + + int getNumberOfLayers() { return mLayers.size(); } + + Layer* getLayer(size_t num) { return mLayers.at(num); } + + std::vector<Tileset*>* getTilesets() { return &mTilesets; } + + int getWidth() { return mWidth; } + int getHeight() { return mHeight; } + + private: + std::vector<Layer*> mLayers; + + int mWidth; + int mHeight; + int mMaxGid; + + std::vector<Tileset*> mTilesets; + + xmlDocPtr mXmlDoc; +}; diff --git a/tools/tmxcopy/readme.txt b/tools/tmxcopy/readme.txt new file mode 100644 index 00000000..e4235b94 --- /dev/null +++ b/tools/tmxcopy/readme.txt @@ -0,0 +1,34 @@ +Tmxcopy is a little tool that allows to copy parts of one TMX map to another map. This will make it much easier to match the border areas of maps. The program is command line based. The usage is: + +tmxcopy sourceFile x y height width targetFile x y [outputFile] + + +Here an example: +When you want to copy the lower right corner (20x20 tiles) of mapA.tmx to the upper left corner of mapB.txt you would open map A with tiled and check at which coordinates the area you want to copy begins. Let's say mapA is 120x130 tiles. Then the area you want to copy would begin at 100:110 and would be 20x20 tiles large. So the first part of the command is: + + tmxcopy mapA.tmx 100 110 20 20 + +Then you open the target map to check the coordinates where you want to put the copied map part. We want the upper left corner, so the coordinates are 0:0. That means the next part of the command would be: + + mapB.tmx 0 0 + +The command is now complete: + + tmxcopy mapA.tmx 100 110 20 20 mapB.tmx 0 0 + +But when you enter this command the mapB will be overwritten. This could be a problem when you made an error in the command. So it is saver to write the output to a new map file so we can look at the result in Tiled before we replace the original map: + + tmxcopy mapA.tmx 100 110 20 20 mapB.tmx 0 0 temp.tmx + +Now we can check temp.tmx to see if the copying worked correctly. + + +The program works so far but there are still some minor problems: + +-Only tested for TMW-compilant maps. I don't guarantee that it works with Tiled maps that are made for other games and thus use different features. It is assumed that the target map and the source maps have the same number of layers, for example. +-Compressed maps (tmx.gz) can not be handled yet (but compressed or uncompressed layers work properly) +-When the target map has an object layer it is moved to the bottom of the layer list of the map (no problem for the game but inconvenient for editing). Objects on the source map are ignored. +-Layer data of output file isn't gzip-compressed yet +-Created TMX file is a bit malformated (but working properly) + +The last 2 problems can be solved easily by opening and saving the map in Tiled.
\ No newline at end of file diff --git a/tools/tmxcopy/tmxcopy.cbp b/tools/tmxcopy/tmxcopy.cbp new file mode 100644 index 00000000..90105493 --- /dev/null +++ b/tools/tmxcopy/tmxcopy.cbp @@ -0,0 +1,87 @@ +<?xml version="1.0"?> +<!DOCTYPE CodeBlocks_project_file> +<CodeBlocks_project_file> + <FileVersion major="1" minor="1"/> + <Project> + <Option title="tmxcopy"/> + <Option makefile="Makefile"/> + <Option makefile_is_custom="0"/> + <Option active_target="0"/> + <Option compiler="0"/> + <Build> + <Target title="default"> + <Option output="tmxcopy.exe"/> + <Option working_dir="."/> + <Option object_output=".objs"/> + <Option deps_output=".deps"/> + <Option type="1"/> + <Option compiler="0"/> + <Option projectResourceIncludeDirsRelation="1"/> + </Target> + </Build> + <Linker> + <Add library="libxml2"/> + <Add library="libz"/> + </Linker> + <Unit filename="base64.cpp"> + <Option compilerVar="CPP"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="base64.h"> + <Option compilerVar=""/> + <Option compile="0"/> + <Option link="0"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="main.cpp"> + <Option compilerVar="CPP"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="map.cpp"> + <Option compilerVar="CPP"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="map.hpp"> + <Option compilerVar=""/> + <Option compile="0"/> + <Option link="0"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="tostring.h"> + <Option compilerVar=""/> + <Option compile="0"/> + <Option link="0"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="xmlutils.cpp"> + <Option compilerVar="CPP"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="xmlutils.h"> + <Option compilerVar=""/> + <Option compile="0"/> + <Option link="0"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="zlibutils.cpp"> + <Option compilerVar="CPP"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + <Unit filename="zlibutils.h"> + <Option compilerVar=""/> + <Option compile="0"/> + <Option link="0"/> + <Option target="default"/> + <Option target="release"/> + </Unit> + </Project> +</CodeBlocks_project_file> diff --git a/tools/tmxcopy/tostring.h b/tools/tmxcopy/tostring.h new file mode 100644 index 00000000..95b8985f --- /dev/null +++ b/tools/tmxcopy/tostring.h @@ -0,0 +1,37 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World 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 + * any later version. + * + * The Mana World 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 The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + */ + +#ifndef _TMW_UTILS_TOSTRING_H +#define _TMW_UTILS_TOSTRING_H + +#include <sstream> + +template<typename T> +std::string toString(const T &arg) +{ + std::stringstream ss; + ss << arg; + return ss.str(); +} + +#endif diff --git a/tools/tmxcopy/xmlutils.cpp b/tools/tmxcopy/xmlutils.cpp new file mode 100644 index 00000000..47bff51a --- /dev/null +++ b/tools/tmxcopy/xmlutils.cpp @@ -0,0 +1,76 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World 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 + * any later version. + * + * The Mana World 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 The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "xmlutils.h" + +namespace XML +{ + int + getProperty(xmlNodePtr node, const char* name, int def) + { + int &ret = def; + + xmlChar *prop = xmlGetProp(node, BAD_CAST name); + if (prop) { + ret = atoi((char*)prop); + xmlFree(prop); + } + + return ret; + } + + double + getFloatProperty(xmlNodePtr node, const char* name, double def) + { + double &ret = def; + + xmlChar *prop = xmlGetProp(node, BAD_CAST name); + if (prop) { + ret = atof((char*)prop); + xmlFree(prop); + } + + return ret; + } + + std::string + getProperty(xmlNodePtr node, const char *name, const std::string &def) + { + xmlChar *prop = xmlGetProp(node, BAD_CAST name); + if (prop) { + std::string val = (char*)prop; + xmlFree(prop); + return val; + } + + return def; + } + + xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name) + { + for_each_xml_child_node(child, parent) + if (xmlStrEqual(child->name, BAD_CAST name)) + return child; + + return NULL; + } +} diff --git a/tools/tmxcopy/xmlutils.h b/tools/tmxcopy/xmlutils.h new file mode 100644 index 00000000..32d1a960 --- /dev/null +++ b/tools/tmxcopy/xmlutils.h @@ -0,0 +1,62 @@ +/* + * The Mana World + * Copyright 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World 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 + * any later version. + * + * The Mana World 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 The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _XMLUTILS_H +#define _XMLUTILS_H + +#include <libxml/tree.h> + +#include <string> + +/** + * XML helper functions. + */ +namespace XML +{ + /** + * Gets an integer property from an xmlNodePtr. + */ + int + getProperty(xmlNodePtr node, const char *name, int def); + + /** + * Gets an floating point property from an xmlNodePtr. + */ + double + getFloatProperty(xmlNodePtr node, const char *name, double def); + + /** + * Gets a string property from an xmlNodePtr. + */ + std::string + getProperty(xmlNodePtr node, const char *name, const std::string &def); + + /** + * Finds the first child node with the given name + */ + xmlNodePtr findFirstChildByName(xmlNodePtr parent, const char *name); +} + +#define for_each_xml_child_node(var, parent) \ + for (xmlNodePtr var = parent->xmlChildrenNode; var; var = var->next) + +#endif diff --git a/tools/tmxcopy/zlibutils.cpp b/tools/tmxcopy/zlibutils.cpp new file mode 100644 index 00000000..30c762b2 --- /dev/null +++ b/tools/tmxcopy/zlibutils.cpp @@ -0,0 +1,123 @@ + +#include <stdlib.h> +#include <iostream> +#include <cassert> +#include <zlib.h> + +/** + * Inflates either zlib or gzip deflated memory. The inflated memory is + * expected to be freed by the caller. + */ +int +inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out, unsigned int &outLength) +{ + int bufferSize = 256 * 1024; + int ret; + z_stream strm; + + out = (unsigned char*) malloc(bufferSize); + + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.next_in = in; + strm.avail_in = inLength; + strm.next_out = out; + strm.avail_out = bufferSize; + + ret = inflateInit2(&strm, 15 + 32); + + if (ret != Z_OK) + return ret; + + do + { + if (strm.next_out == NULL) + { + inflateEnd(&strm); + return Z_MEM_ERROR; + } + + ret = inflate(&strm, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR); + + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; + case Z_DATA_ERROR: + case Z_MEM_ERROR: + (void) inflateEnd(&strm); + return ret; + } + + if (ret != Z_STREAM_END) + { + out = (unsigned char*) realloc(out, bufferSize * 2); + + if (out == NULL) + { + inflateEnd(&strm); + return Z_MEM_ERROR; + } + + strm.next_out = out + bufferSize; + strm.avail_out = bufferSize; + bufferSize *= 2; + } + } + while (ret != Z_STREAM_END); + assert(strm.avail_in == 0); + + outLength = bufferSize - strm.avail_out; + (void) inflateEnd(&strm); + return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; +} + +int +inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out) +{ + unsigned int outLength = 0; + int ret = inflateMemory(in, inLength, out, outLength); + + if (ret != Z_OK || out == NULL) + { + if (ret == Z_MEM_ERROR) + { + std::cerr<<"Error: Out of memory while decompressing map data!"; + } + else if (ret == Z_VERSION_ERROR) + { + std::cerr<<"Error: Incompatible zlib version!"; + } + else if (ret == Z_DATA_ERROR) + { + std::cerr<<"Error: Incorrect zlib compressed data!"; + } + else + { + std::cerr<<"Error: Unknown error while decompressing map data!"; + } + + free(out); + out = NULL; + outLength = 0; + } + + return outLength; +} + +/* + * This function doesn't work like it should. The output is not decompressable. + */ +int +compressMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out, unsigned int &outLength) +{ + uLongf fOutLen = outLength; + int ret = compress((Bytef*)out, &fOutLen, (Bytef*)in, inLength); + outLength = fOutLen; + + assert (ret == Z_OK); +} diff --git a/tools/tmxcopy/zlibutils.h b/tools/tmxcopy/zlibutils.h new file mode 100644 index 00000000..300c72ad --- /dev/null +++ b/tools/tmxcopy/zlibutils.h @@ -0,0 +1,11 @@ +int +inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out, unsigned int &outLength); + +int +inflateMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out); + +int +compressMemory(unsigned char *in, unsigned int inLength, + unsigned char *&out, unsigned int &outLength); diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php new file mode 100644 index 00000000..106fcbb5 --- /dev/null +++ b/tools/upalyzer/analyze.php @@ -0,0 +1,177 @@ +<?php +/* analyze.php + * Copyright 2007 Bjørn Lindeijer + * + * This file is part of upalyzer. + * + * upalyzer 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 + * any later version. + * + * upalyzer 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 upalyzer; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +header("Content-type: text/html"); +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +?> +<html> +<head><title>Update analysis</title></head> +<body> +<pre> +List of current updates: + +<?php +$update_file = array_filter(array_reverse(file('resources2.txt'))); +$updates = array(); +$update_file_maxlen = 0; +$data_size = 0; +$data_uncompressed_size = 0; +$data_used_size = 0; +$data_overhead_size = 0; +$update_entries = array(); +$update_entry_maxlen = 0; + +foreach ($update_file as $update_line) +{ + list($file, $hash) = explode(' ', trim($update_line), 2); + $update = array( + 'file' => $file, + 'adler32' => $hash, + 'filesize' => filesize($file), + 'size' => 0, + 'used_entry_count' => 0, + 'used_size' => 0, + 'uncompressed_size' => 0); + $update_file_maxlen = max($update_file_maxlen, strlen($file)); + + $entries = array(); + $zip = zip_open(realpath($file)); + + if ($zip && !is_int($zip)) { + while ($zip_entry = zip_read($zip)) { + $update['uncompressed_size'] += zip_entry_filesize($zip_entry); + $entry_name = zip_entry_name($zip_entry); + $entry_size = zip_entry_compressedsize($zip_entry); + $entry_used = !array_key_exists($entry_name, $update_entries); + $entries[$entry_name] = array( + 'name' => $entry_name, + 'size' => $entry_size, + 'used' => $entry_used); + $update['size'] += $entry_size; + + if ($entry_used) { + $update['used_entry_count']++; + $update['used_size'] += $entry_size; + $update_entries[$entry_name] = $update; + } + + $update_entry_maxlen = max($update_entry_maxlen, strlen($entry_name)); + } + zip_close($zip); + } + else { + $update['zip_error'] = $zip or true; + } + + ksort($entries); + $update['entries'] = $entries; + $update['used_percentage'] = $update['used_size'] / $update['size']; + $updates[] = $update; + + $data_used_size += $update['used_size']; + $data_size += $update['size']; + $data_uncompressed_size += $update['uncompressed_size']; + $data_overhead_size += $update['filesize'] - $update['size']; +} + +function print_update_name($update, $pad = true) +{ + global $update_file_maxlen; + printf("<a href=\"#%s\">%s</a>", $update['file'], $update['file']); + if ($pad) + echo str_repeat(' ', $update_file_maxlen - strlen($update['file'])); +} + +// Print overall statistics + +foreach (array_reverse($updates) as $update) +{ + print_update_name($update); + echo ' '. $update['adler32']; + printf(" %4d kb", $update['filesize'] / 1024); + if (!$update['zip_error']) { + printf(" %4d kb", $update['uncompressed_size'] / 1024); + printf(" %3d%% used (%d/%d files)", $update['used_percentage'] * 100, + $update['used_entry_count'], + count($update['entries'])); + } else { + printf(" Error! "); + if (is_int($update['zip_error'])) + echo $update['zip_error']; + } + echo "\n"; +} + +printf("\n"); +printf("Amount of data: %4d kb (+%d kb zip file overhead)\n", + $data_size / 1024, + $data_overhead_size / 1024); +printf("Uncompressed: %4d kb\n", $data_uncompressed_size / 1024); +printf("Obsoleted data: %4d kb (%d%%)\n", + ($data_size - $data_used_size) / 1024, + 100 - ($data_used_size / $data_size) * 100); + +printf("\n"); + + +// Print list of update entries and the update they are loaded from + +ksort($update_entries); + +foreach ($update_entries as $entry => $update) +{ + printf("%-{$update_entry_maxlen}s ", $entry); + print_update_name($update, false); + echo "\n"; +} + + +// For each update, print its list of files and indicate whether they are used + +foreach (array_reverse($updates) as $update) +{ + print "\n<a name=\"".$update['file']."\"/><b>".$update['file']."</b>\n"; + + foreach ($update['entries'] as $entry_name => $entry) { + printf("%-{$update_entry_maxlen}s", $entry_name); + if ($entry['used']) { + echo ' *'; + } else { + echo ' '; + print_update_name($update_entries[$entry_name], false); + } + echo "\n"; + } +} + +/* +if ($dh = opendir('.')) { + while (($file = readdir($dh)) !== false) { + } + closedir($dh); +} +*/ +?> +</pre> +</body> +</html> |