r6375 - packages/trunk/simutrans/debian/patches
Ansgar Burchardt
ansgar-guest at alioth.debian.org
Sat Mar 29 20:25:15 UTC 2008
Author: ansgar-guest
Date: 2008-03-29 20:25:14 +0000 (Sat, 29 Mar 2008)
New Revision: 6375
Modified:
packages/trunk/simutrans/debian/patches/makeobj-endianness
Log:
makeobj now works on PowerPC :-)
Modified: packages/trunk/simutrans/debian/patches/makeobj-endianness
===================================================================
--- packages/trunk/simutrans/debian/patches/makeobj-endianness 2008-03-29 19:46:43 UTC (rev 6374)
+++ packages/trunk/simutrans/debian/patches/makeobj-endianness 2008-03-29 20:25:14 UTC (rev 6375)
@@ -9,10 +9,8 @@
../besch/writer/way_writer.cc:21:
warning: deprecated conversion from string constant to ‘char*’
-
TODO:
- * image nodes still broken
- * make patch less ugly
+ * make patch less ugly, esp. the part where obj_besch_t is written
* copy, uncopy (see calls to fwrite in root_writer.cc)
Index: simutrans-99.18~0.svn1664/besch/writer/bridge_writer.cc
@@ -425,7 +423,58 @@
===================================================================
--- simutrans-99.18~0.svn1664.orig/besch/writer/image_writer.cc
+++ simutrans-99.18~0.svn1664/besch/writer/image_writer.cc
-@@ -323,16 +323,14 @@
+@@ -95,9 +95,12 @@
+ */
+ static PIXVAL pixrgb_to_pixval(int rgb)
+ {
++ PIXVAL pix;
++
+ for (int i = 0; i < SPECIAL; i++) {
+ if (rgbtab[i] == (PIXRGB)rgb) {
+- return 0x8000 + i;
++ pix = 0x8000 + i;
++ return endian_uint16(&pix);
+ }
+ }
+
+@@ -106,7 +109,8 @@
+ const int b = (rgb >> 0) & 0xFF;
+
+ // RGB 555
+- return ((r & 0xF8) << 7) | ((g & 0xF8) << 2) | ((b & 0xF8) >> 3);
++ pix = ((r & 0xF8) << 7) | ((g & 0xF8) << 2) | ((b & 0xF8) >> 3);
++ return endian_uint16(&pix);
+ }
+
+
+@@ -157,7 +161,7 @@
+ for (line = 0; line < dim->ymax-dim->ymin + 1; line++) {
+ int row = 0;
+ PIXRGB pix = block_getpix(x, y + line);
+- unsigned char count = 0;
++ uint16 count = 0;
+
+ do {
+ count = 0;
+@@ -167,7 +171,7 @@
+ pix = block_getpix(x + row, y + line);
+ }
+
+- *dest++ = count;
++ *dest++ = endian_uint16(&count);
+
+ run_counter = dest++;
+ count = 0;
+@@ -178,7 +182,7 @@
+ row ++;
+ pix = block_getpix(x + row, y + line);
+ }
+- *run_counter = count;
++ *run_counter = endian_uint16(&count);
+ } while (row < img_size);
+
+ *dest++ = 0;
+@@ -323,16 +327,14 @@
obj_node_t node(this, 12 + (bild.len * sizeof(uint16)), &parent, false);
// to avoid any problems due to structure changes, we write manually the data
@@ -450,7 +499,7 @@
if (bild.len) {
// only called, if there is something to store
-@@ -344,14 +342,13 @@
+@@ -344,14 +346,13 @@
obj_node_t node(this, 10 + (bild.len * sizeof(uint16)), &parent, false);
// to avoid any problems due to structure changes, we write manually the data
@@ -1012,3 +1061,20 @@
fclose(outfp);
}
+Index: simutrans-99.18~0.svn1664/besch/writer/xref_writer.cc
+===================================================================
+--- simutrans-99.18~0.svn1664.orig/besch/writer/xref_writer.cc
++++ simutrans-99.18~0.svn1664/besch/writer/xref_writer.cc
+@@ -22,9 +22,9 @@
+
+ char c = fatal ? 1 : 0;
+
+- node.write_data_at(outfp, &type, 0, sizeof(obj_type));
+- node.write_data_at(outfp, &c, sizeof(obj_type), sizeof(char));
+- node.write_data_at(outfp, text, sizeof(obj_type) + sizeof(char), len + 1);
++ node.write_uint32(outfp, (uint32) type, 0);
++ node.write_uint8 (outfp, c, 4);
++ node.write_data_at(outfp, text, 5, len + 1);
+ node.write(outfp);
+ }
+
More information about the Pkg-games-commits
mailing list