git » fp-git.git » commit dcfa21e

last changes

author ecalot
2006-08-03 16:31:30 UTC
committer ecalot
2006-08-03 16:31:30 UTC
parent d85c90ff2705f24eb81ac96e62fc9b8fe1c8ac6d

last changes

PR/src/Makefile +7 -7
PR/src/include/disk.h +2 -0
PR/src/lib/object/image/image16.c +4 -0
PR/src/lib/object/image/image2.c +5 -1

diff --git a/PR/src/Makefile b/PR/src/Makefile
index e07bf95..7950fe3 100644
--- a/PR/src/Makefile
+++ b/PR/src/Makefile
@@ -171,19 +171,19 @@ $(XMLFILE): xml/resources.xml
 	$(INFO) Compiling main item class...
 	$(CC) $(OPTIONS) -c lib/object/object.c -o $@
 
-.image2.o: lib/object/image/image2.c include/compress.h include/common.h include/image.h include/memory.h include/disk.h include/dat.h include/object.h include/palette.h include/bitmap.h
+.image2.o: lib/object/image/image2.c include/common.h include/compress.h include/dat.h include/disk.h include/image.h include/memory.h include/object.h include/palette.h include/bitmap.h
 	$(INFO) Compiling 2 colors image type class...
 	$(CC) $(OPTIONS) -c lib/object/image/image2.c -o $@
 
-.image16.o: lib/object/image/image16.c include/compress.h include/common.h include/image.h include/memory.h include/disk.h include/dat.h include/object.h include/palette.h include/bitmap.h
+.image16.o: lib/object/image/image16.c include/common.h include/compress.h include/dat.h include/disk.h include/image.h include/memory.h include/object.h include/palette.h include/bitmap.h
 	$(INFO) Compiling 16 colors image type class...
 	$(CC) $(OPTIONS) -c lib/object/image/image16.c -o $@
 
-.image256.o: lib/object/image/image256.c include/compress.h include/common.h include/image.h include/memory.h include/disk.h include/dat.h include/object.h include/palette.h include/bitmap.h
+.image256.o: lib/object/image/image256.c include/common.h include/compress.h include/dat.h include/disk.h include/image.h include/memory.h include/object.h include/palette.h include/bitmap.h
 	$(INFO) Compiling 256 colors image type class...
 	$(CC) $(OPTIONS) -c lib/object/image/image256.c -o $@
 
-.image_common.o: lib/object/image/image_common.c include/compress.h include/common.h include/image.h include/memory.h include/disk.h include/dat.h include/object.h include/palette.h include/bitmap.h
+.image_common.o: lib/object/image/image_common.c include/common.h include/compress.h include/disk.h include/image.h include/memory.h
 	$(INFO) Compiling common functions for image type class...
 	$(CC) $(OPTIONS) -c lib/object/image/image_common.c -o $@
 
@@ -223,7 +223,7 @@ $(XMLFILE): xml/resources.xml
 	$(INFO) Compiling unknown.xml generating module...
 	$(CC) $(OPTIONS) -c lib/xml/unknown.c -o $@
 
-.tree.o: lib/xml/tree.c include/common.h include/list.h include/memory.h include/parse.h include/unknown.h
+.tree.o: lib/xml/tree.c include/common.h include/list.h include/memory.h include/stringflag.h include/parse.h include/unknown.h
 	$(INFO) Compiling XML tree special handling routines...
 	$(CC) $(OPTIONS) -c lib/xml/tree.c -o $@
 
@@ -231,7 +231,7 @@ $(XMLFILE): xml/resources.xml
 	$(INFO) Compiling XML parsing module...
 	$(CC) $(OPTIONS) -c lib/xml/parse.c -o $@
 
-.search.o: lib/xml/search.c include/common.h include/memory.h include/parse.h include/search.h include/translate.h
+.search.o: lib/xml/search.c include/common.h include/memory.h include/parse.h include/search.h include/translate.h include/stringflag.h
 	$(INFO) Compiling XML search features...
 	$(CC) $(OPTIONS) -c lib/xml/search.c -o $@
 
@@ -275,7 +275,7 @@ $(XMLFILE): xml/resources.xml
 	$(INFO) Compiling MIDI audio files support \(mid\)...
 	$(CC) $(OPTIONS) -c lib/formats/mid.c -o $@
 
-.plv.o: lib/formats/plv.c include/plv.h include/disk.h include/dat.h
+.plv.o: lib/formats/plv.c include/dat.h include/disk.h include/memory.h include/plv.h
 	$(INFO) Compiling prince level files support \(plv\)...
 	$(CC) $(OPTIONS) -c lib/formats/plv.c -o $@
 
diff --git a/PR/src/include/disk.h b/PR/src/include/disk.h
index 254a886..1d86b57 100644
--- a/PR/src/include/disk.h
+++ b/PR/src/include/disk.h
@@ -80,6 +80,8 @@ int recurseDirectory(const char* path,int recursive, void* pass, void (*function
 #define array2short(a) (((*(a)))|((*((a)+1))<<8))
 #define array2long(a)  (((*(a)))|((*((a)+1))<<8)|((*((a)+2))<<16)|((*((a)+3))<<24))
 
+#define short2array(a,s) (a)[0]=(s);(a)[1]=(s)>>8
+
 #ifdef MACOS
 #define freadshort(var,file)  macfreads ((var),file)
 #define freadlong(var,file)   macfreadl ((var),file)
diff --git a/PR/src/lib/object/image/image16.c b/PR/src/lib/object/image/image16.c
index b4ab31f..453e448 100644
--- a/PR/src/lib/object/image/image16.c
+++ b/PR/src/lib/object/image/image16.c
@@ -190,11 +190,15 @@ int objectImage16Set(void* o,tResource* res) {
 	 */
 
 	/* (16 bits)height (Intel short int format) */
+	short2array(compressed.data,img->height);
+	short2array(compressed.data+2,img->width);
+#if 0
 	compressed.data[0]=img->height; /* TODO: use shorttoarray */
 	compressed.data[1]=img->height>>8;
 	/* (16 bits)width (Intel short int format) */
 	compressed.data[2]=img->width;
 	compressed.data[3]=img->width>>8;
+#endif
 	/* (8 bits)00000000+(4 bits)palette type+(4 bits)algorithm */
 	compressed.data[4]=0;
 	compressed.data[5]=0xb0|algorithm;
diff --git a/PR/src/lib/object/image/image2.c b/PR/src/lib/object/image/image2.c
index f97db40..6ed0689 100644
--- a/PR/src/lib/object/image/image2.c
+++ b/PR/src/lib/object/image/image2.c
@@ -176,13 +176,17 @@ int objectImage2Set(void* o,tResource* res) {
 	/*
 	 * Write header
 	 */
-
+/* TODO: merge with objectImage16Set */
 	/* (16 bits)height (Intel short int format) */
+	short2array(compressed.data,img->height);
+	short2array(compressed.data+2,img->width);
+#if 0
 	compressed.data[0]=img->height; /* TODO: use shorttoarray */
 	compressed.data[1]=img->height>>8;
 	/* (16 bits)width (Intel short int format) */
 	compressed.data[2]=img->width;
 	compressed.data[3]=img->width>>8;
+#endif
 	/* (8 bits)00000000+(4 bits)palette type+(4 bits)algorithm */
 	compressed.data[4]=0;
 	compressed.data[5]=algorithm;