r15721 - in packages/tags/nikwi: ! dirs' list truncated !

James Cowgill jcowgill-guest at moszumanska.debian.org
Tue Mar 29 19:24:10 UTC 2016


Author: jcowgill-guest
Date: 2016-03-29 19:24:10 +0000 (Tue, 29 Mar 2016)
New Revision: 15721

Added:
   packages/tags/nikwi/0.0.20120213-3/
   packages/tags/nikwi/0.0.20120213-3/debian/changelog
   packages/tags/nikwi/0.0.20120213-3/debian/control
   packages/tags/nikwi/0.0.20120213-3/debian/patches/big-endian.patch
   packages/tags/nikwi/0.0.20120213-3/debian/patches/series
Removed:
   packages/tags/nikwi/0.0.20120213-3/debian/changelog
   packages/tags/nikwi/0.0.20120213-3/debian/control
   packages/tags/nikwi/0.0.20120213-3/debian/patches/series
Log:
[svn-buildpackage] Tagging nikwi 0.0.20120213-3

Deleted: packages/tags/nikwi/0.0.20120213-3/debian/changelog
===================================================================
--- packages/trunk/nikwi/debian/changelog	2016-03-29 16:46:20 UTC (rev 15719)
+++ packages/tags/nikwi/0.0.20120213-3/debian/changelog	2016-03-29 19:24:10 UTC (rev 15721)
@@ -1,82 +0,0 @@
-nikwi (0.0.20120213-2) unstable; urgency=medium
-
-  * Team upload.
-  * wrap-and-sort -sa.
-  * debian/control: Replace arm with arm64 in architectures list.
-    Thanks to Martin Michlmayr for the report. (Closes: #791966)
-  * Declare compliance with Debian Policy 3.9.7.
-  * Vcs-Browser: Switch to https.
-  * nikwi.desktop: Add keywords and a comment in German.
-  * Remove quilt from Build-Depends because source format 3.0 uses quilt by
-    default.
-  * source/options: Use the default xz compression from now on.
-  * nikwi.6: Fix Lintian warning manpage-has-bad-whatis-entry.
-  * Remove empty directories in install-arch target.
-
- -- Markus Koschany <apo at debian.org>  Fri, 25 Mar 2016 17:07:58 +0100
-
-nikwi (0.0.20120213-1) unstable; urgency=low
-
-  [ Evgeni Golov ]
-  * Correct Vcs-* URLs to point to anonscm.debian.org
-
-  [ Miriam Ruiz ]
-  * New upstream release, obtained from https://github.com/badsector/nikwi
-  * Changed URLs in debian/control and debian/copyright
-  * Changed my email to miriam at debian.org
-  * Added armhf to Architecture list. Closes: #645664
-  * Upgraded Standards-Version from 3.8.1 to
-  * Upgraded compat level to 9
-  * Upgraded package source format to 3.0
-  * Fortified the building of the package
-
- -- Miriam Ruiz <miriam at debian.org>  Fri, 13 Sep 2013 17:41:13 +0200
-
-nikwi (0.0.20060823-2) unstable; urgency=low
-
-  [ Miriam Ruiz ]
-  * Added Recommends: nikwi to nikwi-data in debian/control
-  * Added kfreebsd-i386 and hurd-i386 as supported architectures.
-    Closes: #482901
-
-  [ Jon Dowland ]
-  * add Homepage: control field to source stanza
-
-  [ Ansgar Burchardt ]
-  * Remove deprecated Encoding key from .desktop file
-  * debian/control: Change XS-Vcs-* to Vcs-*
-  * Remove Homepage semi-field from description
-  * Added ia64 as a supported architecture (Closes: #483275)
-
-  [ Sam Hocevar ]
-  * Add amd64 to the list of architectures. Works like a charm.
-
-  [ Barry deFreese ]
-  * Add myself to uploaders.
-  * Add all little endian archs. (Closes: #515561).
-  * Fix some hyphens used as minus in manpage.
-  * Remove dh_make cruft from debian/copyright.
-  * Bump Standards Version to 3.8.1. (No changes needed).
-
- -- Barry deFreese <bdefreese at debian.org>  Tue, 14 Apr 2009 22:24:11 -0400
-
-nikwi (0.0.20060823-1) unstable; urgency=low
-
-  [ Miriam Ruiz ]
-  * Initial release (Closes: #390073)
-  * Created build system based in standard make utility.
-  * Patched code so that data files can be stored in an absolute path.
-  * Removed rdtsc stuff for compatibility with other architectures.
-  * Restricted architecture to i386 for the moment, until I find a way to
-    solve the endianess problems.
-
-  [ Gonéri Le Bouder ]
-  * remove Applications from Categorie in the desktop file since it's not
-    an official categorie
-  * call dh_desktop to run update-desktop-database
-
-  [ Jon Dowland ]
-  * update menu section to "Games/Action" for menu policy transition.
-    Thanks Linas Žvirblis.
-
- -- Miriam Ruiz <little_miry at yahoo.es>  Wed, 22 Aug 2007 15:09:51 +0000

Copied: packages/tags/nikwi/0.0.20120213-3/debian/changelog (from rev 15720, packages/trunk/nikwi/debian/changelog)
===================================================================
--- packages/tags/nikwi/0.0.20120213-3/debian/changelog	                        (rev 0)
+++ packages/tags/nikwi/0.0.20120213-3/debian/changelog	2016-03-29 19:24:10 UTC (rev 15721)
@@ -0,0 +1,90 @@
+nikwi (0.0.20120213-3) unstable; urgency=medium
+
+  * Team upload.
+  * Add support for big-endian architectures. (Closes: #440673)
+  * Re-enable building on any architecture.
+
+ -- James Cowgill <jcowgill at debian.org>  Tue, 29 Mar 2016 18:41:29 +0100
+
+nikwi (0.0.20120213-2) unstable; urgency=medium
+
+  * Team upload.
+  * wrap-and-sort -sa.
+  * debian/control: Replace arm with arm64 in architectures list.
+    Thanks to Martin Michlmayr for the report. (Closes: #791966)
+  * Declare compliance with Debian Policy 3.9.7.
+  * Vcs-Browser: Switch to https.
+  * nikwi.desktop: Add keywords and a comment in German.
+  * Remove quilt from Build-Depends because source format 3.0 uses quilt by
+    default.
+  * source/options: Use the default xz compression from now on.
+  * nikwi.6: Fix Lintian warning manpage-has-bad-whatis-entry.
+  * Remove empty directories in install-arch target.
+
+ -- Markus Koschany <apo at debian.org>  Fri, 25 Mar 2016 17:07:58 +0100
+
+nikwi (0.0.20120213-1) unstable; urgency=low
+
+  [ Evgeni Golov ]
+  * Correct Vcs-* URLs to point to anonscm.debian.org
+
+  [ Miriam Ruiz ]
+  * New upstream release, obtained from https://github.com/badsector/nikwi
+  * Changed URLs in debian/control and debian/copyright
+  * Changed my email to miriam at debian.org
+  * Added armhf to Architecture list. Closes: #645664
+  * Upgraded Standards-Version from 3.8.1 to
+  * Upgraded compat level to 9
+  * Upgraded package source format to 3.0
+  * Fortified the building of the package
+
+ -- Miriam Ruiz <miriam at debian.org>  Fri, 13 Sep 2013 17:41:13 +0200
+
+nikwi (0.0.20060823-2) unstable; urgency=low
+
+  [ Miriam Ruiz ]
+  * Added Recommends: nikwi to nikwi-data in debian/control
+  * Added kfreebsd-i386 and hurd-i386 as supported architectures.
+    Closes: #482901
+
+  [ Jon Dowland ]
+  * add Homepage: control field to source stanza
+
+  [ Ansgar Burchardt ]
+  * Remove deprecated Encoding key from .desktop file
+  * debian/control: Change XS-Vcs-* to Vcs-*
+  * Remove Homepage semi-field from description
+  * Added ia64 as a supported architecture (Closes: #483275)
+
+  [ Sam Hocevar ]
+  * Add amd64 to the list of architectures. Works like a charm.
+
+  [ Barry deFreese ]
+  * Add myself to uploaders.
+  * Add all little endian archs. (Closes: #515561).
+  * Fix some hyphens used as minus in manpage.
+  * Remove dh_make cruft from debian/copyright.
+  * Bump Standards Version to 3.8.1. (No changes needed).
+
+ -- Barry deFreese <bdefreese at debian.org>  Tue, 14 Apr 2009 22:24:11 -0400
+
+nikwi (0.0.20060823-1) unstable; urgency=low
+
+  [ Miriam Ruiz ]
+  * Initial release (Closes: #390073)
+  * Created build system based in standard make utility.
+  * Patched code so that data files can be stored in an absolute path.
+  * Removed rdtsc stuff for compatibility with other architectures.
+  * Restricted architecture to i386 for the moment, until I find a way to
+    solve the endianess problems.
+
+  [ Gonéri Le Bouder ]
+  * remove Applications from Categorie in the desktop file since it's not
+    an official categorie
+  * call dh_desktop to run update-desktop-database
+
+  [ Jon Dowland ]
+  * update menu section to "Games/Action" for menu policy transition.
+    Thanks Linas Žvirblis.
+
+ -- Miriam Ruiz <little_miry at yahoo.es>  Wed, 22 Aug 2007 15:09:51 +0000

Deleted: packages/tags/nikwi/0.0.20120213-3/debian/control
===================================================================
--- packages/trunk/nikwi/debian/control	2016-03-29 16:46:20 UTC (rev 15719)
+++ packages/tags/nikwi/0.0.20120213-3/debian/control	2016-03-29 19:24:10 UTC (rev 15721)
@@ -1,45 +0,0 @@
-Source: nikwi
-Section: games
-Priority: optional
-Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
-Uploaders:
- Miriam Ruiz <miriam at debian.org>,
- Sam Hocevar <sho at debian.org>,
- Barry deFreese <bdefreese at debian.org>
-Build-Depends:
- debhelper (>= 9),
- libsdl1.2-dev
-Standards-Version: 3.9.7
-Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/nikwi/
-Vcs-Browser: https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/nikwi/
-Homepage: http://badsector.github.io/nikwi/Nikwi_Deluxe/
-
-Package: nikwi
-Architecture: alpha amd64 arm64 armel armhf hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mipsel
-Depends:
- nikwi-data (>= ${source:Version}),
- ${misc:Depends},
- ${shlibs:Depends}
-Description: platform game where your goal is to collect candies
- You play the role of a 9 year old boy in his absolute dream: a world made
- of sweets! Guide Nikwi through his dream to eat everything in each of the 30
- levels, while you avoid the monsters who try to turn Nikwi's dream into a
- nightmare.
- .
- Nikwi features hours of gameplay in 30 sweet-themed levels made of five
- candy themes, more than 10 different monsters and obstacles -each one with
- it's own unique behaviour- and new gameplay elements in every theme.
-
-Package: nikwi-data
-Architecture: all
-Depends:
- ${misc:Depends}
-Recommends:
- nikwi
-Description: platform game where your goal is to collect candies - game data
- You play the role of a 9 year old boy in his absolute dream: a world made
- of sweets! Guide Nikwi through his dream to eat everything in each of the 30
- levels, while you avoid the monsters who try to turn Nikwi's dream into a
- nightmare.
- .
- This package includes the data needed to play the game.

Copied: packages/tags/nikwi/0.0.20120213-3/debian/control (from rev 15720, packages/trunk/nikwi/debian/control)
===================================================================
--- packages/tags/nikwi/0.0.20120213-3/debian/control	                        (rev 0)
+++ packages/tags/nikwi/0.0.20120213-3/debian/control	2016-03-29 19:24:10 UTC (rev 15721)
@@ -0,0 +1,45 @@
+Source: nikwi
+Section: games
+Priority: optional
+Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
+Uploaders:
+ Miriam Ruiz <miriam at debian.org>,
+ Sam Hocevar <sho at debian.org>,
+ Barry deFreese <bdefreese at debian.org>
+Build-Depends:
+ debhelper (>= 9),
+ libsdl1.2-dev
+Standards-Version: 3.9.7
+Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/nikwi/
+Vcs-Browser: https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/nikwi/
+Homepage: http://badsector.github.io/nikwi/Nikwi_Deluxe/
+
+Package: nikwi
+Architecture: any
+Depends:
+ nikwi-data (>= ${source:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: platform game where your goal is to collect candies
+ You play the role of a 9 year old boy in his absolute dream: a world made
+ of sweets! Guide Nikwi through his dream to eat everything in each of the 30
+ levels, while you avoid the monsters who try to turn Nikwi's dream into a
+ nightmare.
+ .
+ Nikwi features hours of gameplay in 30 sweet-themed levels made of five
+ candy themes, more than 10 different monsters and obstacles -each one with
+ it's own unique behaviour- and new gameplay elements in every theme.
+
+Package: nikwi-data
+Architecture: all
+Depends:
+ ${misc:Depends}
+Recommends:
+ nikwi
+Description: platform game where your goal is to collect candies - game data
+ You play the role of a 9 year old boy in his absolute dream: a world made
+ of sweets! Guide Nikwi through his dream to eat everything in each of the 30
+ levels, while you avoid the monsters who try to turn Nikwi's dream into a
+ nightmare.
+ .
+ This package includes the data needed to play the game.

Copied: packages/tags/nikwi/0.0.20120213-3/debian/patches/big-endian.patch (from rev 15720, packages/trunk/nikwi/debian/patches/big-endian.patch)
===================================================================
--- packages/tags/nikwi/0.0.20120213-3/debian/patches/big-endian.patch	                        (rev 0)
+++ packages/tags/nikwi/0.0.20120213-3/debian/patches/big-endian.patch	2016-03-29 19:24:10 UTC (rev 15721)
@@ -0,0 +1,437 @@
+Description: Fix endianness issues
+ This changes the various pieces of code which relied on being on a little
+ endian machine to be platform independant.
+Author: James Cowgill <jcowgill at debian.org>
+Bug-Debian: https://bugs.debian.org/440673
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/nikwi/gfx.cpp
++++ b/src/nikwi/gfx.cpp
+@@ -37,21 +37,19 @@ bool		fullscreen = false;
+ 
+ static SDL_Joystick	*joy = NULL;
+ 
++static unsigned short read_ushort_le(unsigned char* data)
++{
++	return data[0] | data[1] << 8;
++}
++
+ SDL_Surface *createSurface(int width, int height, bool colorKey)
+ {
+ 	SDL_Surface	*surf;
+ 	Uint32		rm, gm, bm;
+ 
+-	#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+-	#error makeit
+-	rm = 0xFF000000;
+-	gm = 0x00FF0000;
+-	bm = 0x0000FF00;
+-	#else
+ 	rm = 0x0000001F;
+ 	gm = 0x000007E0;
+ 	bm = 0x0000F800;
+-	#endif
+ 	
+ 	if (screen && screen->format)
+ 	{
+@@ -89,14 +87,8 @@ SDL_Surface *loadImage(String file)
+ 		return NULL;
+ 	}
+ 	pixels = (unsigned short*)&data[8];
+-	#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+-	#error redo
+-	width = (data[0] << 8)|data[1];
+-	height = (data[2] << 8)|data[3];
+-	#else
+-	width = *((unsigned short*)(data + 4));
+-	height = *((unsigned short*)(data + 6));
+-	#endif
++	width = read_ushort_le(data + 4);
++	height = read_ushort_le(data + 6);
+ 	
+ 	surf = createSurface(width, height);
+ 	if (!surf)
+@@ -118,7 +110,7 @@ SDL_Surface *loadImage(String file)
+ 			int	gv = pixels[index++];
+ 			int	bv = pixels[index++];
+ 			*/
+-			unsigned int	pixel = pixels[index++];
++			unsigned int	pixel = read_ushort_le((unsigned char*) &pixels[index++]);
+ 			int		rv, gv, bv;
+ 			
+ 			bv = (pixel&31) << 3;
+--- a/src/tools/bmp2ut/bmp2ut.c
++++ b/src/tools/bmp2ut/bmp2ut.c
+@@ -47,6 +47,12 @@ SDL_Surface	*mask = NULL;
+ int		alpha = 0;
+ int		halfBits = 0;
+ 
++static void fwrite_ushort_le(unsigned short value, FILE *file)
++{
++    fputc(value & 0xFF, file);
++    fputc(value >> 8, file);
++}
++
+ void convert(void)
+ {
+ 	char		id[3] = "UT";
+@@ -68,10 +74,8 @@ void convert(void)
+ 	f = fopen(output, "wb");
+ 	fwrite(id, 3, 1, f);
+ 	fwrite(&flags, 1, 1, f);
+-	wv = surf->w;
+-	hv = surf->h;
+-	fwrite(&wv, 2, 1, f);
+-	fwrite(&hv, 2, 1, f);
++	fwrite_ushort_le(surf->w, f);
++	fwrite_ushort_le(surf->h, f);
+ 	rgb = (unsigned char*)surf->pixels;
+ 	mrgb = mask?((unsigned char*)mask->pixels):0;
+ 	for (i=0;i<surf->w*surf->h;i++)
+@@ -91,7 +95,7 @@ void convert(void)
+ 		{
+ 			unsigned short	rgb;
+ 			rgb = (b >> 3)|((g >> 2) << 5)|((r >> 3) << 11);
+-			fwrite(&rgb, 2, 1, f);
++			fwrite_ushort_le(rgb, f);
+ 		}
+ 		else
+ 		{
+--- a/src/tools/upack/upack.c
++++ b/src/tools/upack/upack.c
+@@ -49,6 +49,20 @@ char		*input = "data";
+ char		*output = "justdata.up";
+ FILE		*f;
+ 
++static void fwrite_ushort_le(unsigned short value, FILE *file)
++{
++	fputc(value & 0xFF, file);
++	fputc(value >> 8, file);
++}
++
++static void fwrite_uint_le(unsigned int value, FILE *file)
++{
++	fputc(value & 0xFF, file);
++	fputc((value >> 8) & 0xFF, file);
++	fputc((value >> 16) & 0xFF, file);
++	fputc(value >> 24, file);
++}
++
+ static void addEntry(char *name, unsigned int pos, unsigned int size)
+ {
+ 	DirEntry	*de = malloc(sizeof(DirEntry));
+@@ -79,7 +93,6 @@ static void startPackage(void)
+ {
+ 	char		id[2] = "UP";
+ 	char		version = 1;
+-	unsigned int	dirPlace = 0;
+ 	f = fopen(output, "wb");
+ 	if (!f)
+ 	{
+@@ -88,9 +101,9 @@ static void startPackage(void)
+ 	}
+ 	fwrite(id, 2, 1, f);
+ 	fwrite(&version, 1, 1, f);
+-	fwrite(&dirPlace, 4, 1, f);
+-	fwrite(&entryCount, 4, 1, f);
+-	fwrite(&priority, 4, 1, f);
++	fwrite_uint_le(0, f);
++	fwrite_uint_le(0, f);
++	fwrite_uint_le(priority, f);
+ }
+ 
+ static void saveDirectoryEntries()
+@@ -101,14 +114,14 @@ static void saveDirectoryEntries()
+ 	for (;de;de = de->next)
+ 	{
+ 		unsigned short	len = strlen(de->name);
+-		fwrite(&len, 2, 1, f);
++		fwrite_ushort_le(len, f);
+ 		fwrite(de->name, len, 1, f);
+-		fwrite(&de->pos, 4, 1, f);
+-		fwrite(&de->size, 4, 1, f);
++		fwrite_uint_le(de->pos, f);
++		fwrite_uint_le(de->size, f);
+ 	}
+ 	fseek(f, 3, SEEK_SET);
+-	fwrite(&dirPlace, 4, 1, f);
+-	fwrite(&entryCount, 4, 1, f);
++	fwrite_uint_le(dirPlace, f);
++	fwrite_uint_le(entryCount, f);
+ 	printf("%i entries written\n", entryCount);
+ }
+ 
+--- a/src/nikwi/nikio.cpp
++++ b/src/nikwi/nikio.cpp
+@@ -43,6 +43,18 @@ static String		packFileName;
+ static uint		dirPlace, entryCount;
+ static PackEntry	*entry;
+ 
++static unsigned short fread_ushort_le(FILE *file)
++{
++	unsigned char lsb = (unsigned char) fgetc(file);
++	return lsb | ((unsigned char) fgetc(file)) << 8;
++}
++
++static unsigned int fread_uint_le(FILE *file)
++{
++	unsigned short lsw = fread_ushort_le(file);
++	return lsw | fread_ushort_le(file) << 16;
++}
++
+ void initNikIO()
+ {
+ 	FILE	*f;
+@@ -56,8 +68,8 @@ void initNikIO()
+ 	if (f)
+ 	{
+ 		fseek(f, 3, SEEK_SET);
+-		fread(&dirPlace, 4, 1, f);
+-		fread(&entryCount, 4, 1, f);
++		dirPlace = fread_uint_le(f);
++		entryCount = fread_uint_le(f);
+ 		fseek(f, dirPlace, SEEK_SET);
+ 		entry = (PackEntry*)malloc(sizeof(PackEntry)*entryCount);
+ 		for (uint i=0;i<entryCount;i++)
+@@ -65,12 +77,12 @@ void initNikIO()
+ 			unsigned short	len;
+ 			uint		start, size;
+ 			String		name;
+-			fread(&len, 2, 1, f);
++			len = fread_ushort_le(f);
+ 			name = (String)malloc(len + 1);
+ 			fread(name, len, 1, f);
+ 			name[len] = 0;
+-			fread(&start, 4, 1, f);
+-			fread(&size, 4, 1, f);
++			start = fread_uint_le(f);
++			size = fread_uint_le(f);
+ 			entry[i].name = name;
+ 			entry[i].start = start;
+ 			entry[i].size = size;
+--- a/src/slashfx/main.c
++++ b/src/slashfx/main.c
+@@ -23,6 +23,7 @@
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdint.h>
+ #include <string.h>
+ #include <math.h>
+ #include <slashfx.h>
+@@ -46,8 +47,8 @@ typedef struct _Effect
+ 	double		squarization;
+ 	double		delay, delayAmp;
+ 	double		purify;
+-	int		waveFuncCode;
+-	int		length;
++	unsigned int	waveFuncCode;
++	unsigned int	length;
+ 	int		upHerz;
+ 	
+ 	Envelope	freqEnv;
+@@ -89,18 +90,37 @@ static void readBuffer(Buffer *buffer, v
+ 	buffer->position += length;
+ }
+ 
++static uint32_t readBuffer32(Buffer *buffer)
++{
++	uint8_t b1 = buffer->data[buffer->position++];
++	uint8_t b2 = buffer->data[buffer->position++];
++	uint8_t b3 = buffer->data[buffer->position++];
++	uint8_t b4 = buffer->data[buffer->position++];
++
++	return b1 | b2 << 8 | b3 << 16 | b4 << 24;
++}
++
++static double readBufferDouble(Buffer *buffer)
++{
++	union { uint64_t i; double d; } conv;
++
++	conv.i = readBuffer32(buffer);
++	conv.i |= (uint64_t) readBuffer32(buffer) << 32;
++	return conv.d;
++}
++
+ static void readEnvelope(Buffer *fb, Envelope *e)
+ {
+ 	int	i;
+ 	
+-	readBuffer(fb, &e->size, sizeof(int));
++	e->size = readBuffer32(fb);
+ 	e->x = malloc(sizeof(double)*e->size);
+ 	e->y = malloc(sizeof(double)*e->size);
+ 	
+ 	for (i=0;i<e->size;i++)
+ 	{
+-		readBuffer(fb, &e->x[i], sizeof(double));
+-		readBuffer(fb, &e->y[i], sizeof(double));
++		e->x[i] = readBufferDouble(fb);
++		e->y[i] = readBufferDouble(fb);
+ 	}
+ }
+ 
+@@ -129,14 +149,14 @@ int ssfxLoadEffectFromMemory(char *ptr,
+ 		return 0;
+ 	}
+ 	
+-	readBuffer(fb, &fx.globalVol, sizeof(double));
+-	readBuffer(fb, &fx.squarization, sizeof(double));
+-	readBuffer(fb, &fx.delay, sizeof(double));
+-	readBuffer(fb, &fx.delayAmp, sizeof(double));
+-	readBuffer(fb, &fx.purify, sizeof(double));
+-	readBuffer(fb, &fx.waveFuncCode, sizeof(int));
+-	readBuffer(fb, &fx.length, sizeof(int));
+-	readBuffer(fb, &fx.upHerz, sizeof(int));
++	fx.globalVol = readBufferDouble(fb);
++	fx.squarization = readBufferDouble(fb);
++	fx.delay = readBufferDouble(fb);
++	fx.delayAmp = readBufferDouble(fb);
++	fx.purify = readBufferDouble(fb);
++	fx.waveFuncCode = readBuffer32(fb);
++	fx.length = readBuffer32(fb);
++	fx.upHerz = readBuffer32(fb);
+ 	
+ 	readEnvelope(fb, &fx.freqEnv);
+ 	readEnvelope(fb, &fx.volEnv);
+--- a/src/nikwi/world.cpp
++++ b/src/nikwi/world.cpp
+@@ -29,6 +29,20 @@
+ 
+ World	*world = NULL;
+ 
++static uint read_uint_le(const void *data)
++{
++	unsigned char *ptr = (unsigned char *) data;
++	return ptr[0] | ptr[1] << 8 | ptr[2] << 16 | ptr[3] << 24;
++}
++
++static void fwrite_uint_le(uint value, FILE *file)
++{
++	fputc(value & 0xFF, file);
++	fputc((value >> 8) & 0xFF, file);
++	fputc((value >> 16) & 0xFF, file);
++	fputc(value >> 24, file);
++}
++
+ //World
+ World::World()
+ {
+@@ -103,15 +117,15 @@ void World::loadWorld(String file)
+ 	uint	*tileCode, *iv;
+ 	if (!data)
+ 		return;
+-	newWorld(*((uint*)&data[0]), *((uint*)&data[4]));
++	newWorld(read_uint_le(data), read_uint_le(data + 4));
+ 	tileCode = (uint*)&data[8];
+ 	for (uint y=0;y<height;y++)
+ 	{
+ 		for (uint x=0;x<width;x++,tileCode++)
+ 		{
+-			if (*tileCode)
++			if (read_uint_le(tileCode))
+ 			{
+-				tile[y*width + x] = new Tile(*tileCode);
++				tile[y*width + x] = new Tile(read_uint_le(tileCode));
+ 				tile[y*width + x]->x = x*32;
+ 				tile[y*width + x]->y = y*32;
+ 			}
+@@ -120,14 +134,14 @@ void World::loadWorld(String file)
+ 
+ 	prepareForPhysics();
+ 
+-	oc = *tileCode;
++	oc = read_uint_le(tileCode);
+ 	iv = ++tileCode;
+ 	for (uint i=0;i<oc;i++)
+ 	{
+-		uint	code = *(iv++);
+-		uint	flags = (*(iv++))&0x1;
+-		int	x = (int)*(iv++);
+-		int	y = (int)*(iv++);
++		uint	code = read_uint_le(iv++);
++		uint	flags = read_uint_le(iv++) & 0x1;
++		int	x = (int) read_uint_le(iv++);
++		int	y = (int) read_uint_le(iv++);
+ 		Object	*obj = createObject(code, x, y);
+ 		obj->state->mirror = flags;
+ 		if (code == makeCode("hero"))
+@@ -139,8 +153,8 @@ void World::loadWorld(String file)
+ 		}
+ 		obj->init();
+ 	}
+-	bgnd = *(iv++);
+-	bgndImage = *iv;
++	bgnd = read_uint_le(iv++);
++	bgndImage = read_uint_le(iv);
+ 	free(data);
+ 	
+ 	refreshStaticPart = true;
+@@ -159,27 +173,27 @@ void World::saveWorld(String file)
+ {
+ 	FILE	*f = fopen(file, "wb");
+ 	uint	oc = 0;
+-	fwrite(&width, 4, 1, f);
+-	fwrite(&height, 4, 1, f);
++	fwrite_uint_le(width, f);
++	fwrite_uint_le(height, f);
+ 	for (uint i=0;i<width*height;i++)
+ 	{
+ 		if (tile[i])
+-			fwrite(&tile[i]->tclass->code, 4, 1, f);
++			fwrite_uint_le(tile[i]->tclass->code, f);
+ 		else
+-			fwrite(&tile[i], 4, 1, f);	//zero//
++			fwrite_uint_le(0, f);
+ 	}
+ 	for (Object *obj=firstObject;obj;obj = obj->next)
+ 		oc++;
+-	fwrite(&oc, 4, 1, f);
++	fwrite_uint_le(oc, f);
+ 	for (Object *obj=firstObject;obj;obj = obj->next)
+ 	{
+-		fwrite(&obj->oclass->code, 4, 1, f);
+-		fwrite(&obj->state->mirror, 4, 1, f);
+-		fwrite(&obj->x, 4, 1, f);
+-		fwrite(&obj->y, 4, 1, f);
++		fwrite_uint_le(obj->oclass->code, f);
++		fwrite_uint_le(obj->state->mirror, f);
++		fwrite_uint_le(obj->x, f);
++		fwrite_uint_le(obj->y, f);
+ 	}
+-	fwrite(&bgnd, 4, 1, f);
+-	fwrite(&bgndImage, 4, 1, f);
++	fwrite_uint_le(bgnd, f);
++	fwrite_uint_le(bgndImage, f);
+ 	fclose(f);
+ }
+ 
+--- a/src/us/bytecode.cpp
++++ b/src/us/bytecode.cpp
+@@ -61,11 +61,11 @@ void UScriptByteCode::putInt(uint addr,
+ 
+ void UScriptByteCode::putFloat(uint addr, float f)
+ {
++	union { int i; float f; } conv;
++
+ 	makeRoom(addr + 4);
+-	bc[addr++] = ((unsigned char*)(&f))[0];
+-	bc[addr++] = ((unsigned char*)(&f))[1];
+-	bc[addr++] = ((unsigned char*)(&f))[2];
+-	bc[addr] = ((unsigned char*)(&f))[3];
++	conv.f = f;
++	putInt(addr, conv.i);
+ }
+ 
+ void UScriptByteCode::addByte(unsigned char b)
+@@ -98,7 +98,9 @@ int UScriptByteCode::getInt(uint addr)
+ 
+ float UScriptByteCode::getFloat(uint addr)
+ {
+-	return *((float*)&bc[addr]);
++	union { int i; float f; } conv;
++	conv.i = getInt(addr);
++	return conv.f;
+ }
+ 
+ String UScriptByteCode::getSS(uint index)

Deleted: packages/tags/nikwi/0.0.20120213-3/debian/patches/series
===================================================================
--- packages/trunk/nikwi/debian/patches/series	2016-03-29 16:46:20 UTC (rev 15719)
+++ packages/tags/nikwi/0.0.20120213-3/debian/patches/series	2016-03-29 19:24:10 UTC (rev 15721)
@@ -1,5 +0,0 @@
-makefiles.patch
-nikwideluxe_makedata.patch
-nikwideluxe_nikio.patch
-slashfx_main.patch
-uscript_type.patch

Copied: packages/tags/nikwi/0.0.20120213-3/debian/patches/series (from rev 15720, packages/trunk/nikwi/debian/patches/series)
===================================================================
--- packages/tags/nikwi/0.0.20120213-3/debian/patches/series	                        (rev 0)
+++ packages/tags/nikwi/0.0.20120213-3/debian/patches/series	2016-03-29 19:24:10 UTC (rev 15721)
@@ -0,0 +1,6 @@
+makefiles.patch
+nikwideluxe_makedata.patch
+nikwideluxe_nikio.patch
+slashfx_main.patch
+uscript_type.patch
+big-endian.patch




More information about the Pkg-games-commits mailing list