author | ecalot
<ecalot> 2006-06-25 00:29:58 UTC |
committer | ecalot
<ecalot> 2006-06-25 00:29:58 UTC |
parent | 3e574838052faabe011cc7722aadacd40104c304 |
PR/src/include/compress.h | +3 | -3 |
PR/src/lib/compression/lzg_decompress.c | +1 | -3 |
PR/src/lib/compression/rle_decompress.c | +5 | -7 |
PR/src/lib/compression/rlev_decompress.c | +7 | -11 |
PR/src/lib/object/image/image16.c | +7 | -7 |
PR/src/lib/object/image/image256.c | +2 | -2 |
PR/src/lib/object/image/image_common.c | +7 | -7 |
PR/src/ports/winfiles/pr.dev | +1 | -1 |
diff --git a/PR/src/include/compress.h b/PR/src/include/compress.h index c54f6bc..3c3fee7 100644 --- a/PR/src/include/compress.h +++ b/PR/src/include/compress.h @@ -63,11 +63,11 @@ void compressRle(const unsigned char* input, int inputSize, unsigned char* output, int *outputSize); /* decompress and allocates output */ -int expandLzg(/*const unsigned char* input, int inputSize*/ tBinary input, +int expandLzg(tBinary input, unsigned char** output, int *outputSize); -int expandRle(const unsigned char* input, int inputSize, +int expandRle(/*const unsigned char* input, int inputSize,*/tBinary input, unsigned char** output, int *outputSize); -int expandRleV(const unsigned char* input, int inputSize, +int expandRleV(/*const unsigned char* input, int inputSize,*/tBinary input, unsigned char* output, int *outputSize); #endif diff --git a/PR/src/lib/compression/lzg_decompress.c b/PR/src/lib/compression/lzg_decompress.c index 1949947..d80ad90 100644 --- a/PR/src/lib/compression/lzg_decompress.c +++ b/PR/src/lib/compression/lzg_decompress.c @@ -44,8 +44,7 @@ unsigned char popBit(unsigned char *byte) { } /* Expands LZ Groody algorithm. This is the core of PR */ -int expandLzg(/*const unsigned char* input, int inputSize,*/ tBinary input, - unsigned char** output2, int *outputSize) { +int expandLzg(tBinary input, unsigned char** output2, int *outputSize) { int oCursor=0, iCursor=0; unsigned char maskbyte=0; @@ -99,4 +98,3 @@ int expandLzg(/*const unsigned char* input, int inputSize,*/ tBinary input, return (!maskbyte)-1; /*return rep?COMPRESS_RESULT_WARNING:COMPRESS_RESULT_SUCCESS;*/ } - diff --git a/PR/src/lib/compression/rle_decompress.c b/PR/src/lib/compression/rle_decompress.c index 9a974d6..1ce09f0 100644 --- a/PR/src/lib/compression/rle_decompress.c +++ b/PR/src/lib/compression/rle_decompress.c @@ -37,8 +37,7 @@ rle_decompress.c: Princed Resources : Image Compression Library #include "compress.h" /* Expands RLE algorithm */ -int expandRle(const unsigned char* input, int inputSize, - unsigned char** output, int *outputSize) { +int expandRle(tBinary input, unsigned char** output, int *outputSize) { register signed char rep=1; int oCursor=0; int iCursor=0; @@ -47,20 +46,19 @@ int expandRle(const unsigned char* input, int inputSize, if ((*output=malloc(40000))==NULL) return PR_RESULT_COMPRESS_RESULT_FATAL; /* main loop */ - while (iCursor<inputSize) { - rep=(signed char)(input[iCursor++]); + while (iCursor<input.size) { + rep=(signed char)(input.data[iCursor++]); if (rep<0) { /* Negative */ - while (rep++) (*output)[oCursor++]=input[iCursor]; + while (rep++) (*output)[oCursor++]=input.data[iCursor]; iCursor++; } else { /* Positive */ rep=~rep; - while ((rep++)&&(iCursor<inputSize)) (*output)[oCursor++]=input[iCursor++]; + while ((rep++)&&(iCursor<input.size)) (*output)[oCursor++]=input.data[iCursor++]; } } *outputSize=oCursor; return (rep==1)?PR_RESULT_SUCCESS:PR_RESULT_COMPRESS_RESULT_WARNING; } - diff --git a/PR/src/lib/compression/rlev_decompress.c b/PR/src/lib/compression/rlev_decompress.c index 5b36732..fd67828 100644 --- a/PR/src/lib/compression/rlev_decompress.c +++ b/PR/src/lib/compression/rlev_decompress.c @@ -37,27 +37,24 @@ rlev_decompress.c: Princed Resources : Image Compression Library : #include <stdlib.h> #include "compress.h" -/* Expands RLE algorithm */ -int expandRleV(const unsigned char* input, int inputSize, - unsigned char* output, int *outputSize) { +/* Expands RLEV algorithm */ +int expandRleV(tBinary input, unsigned char* output, int *outputSize) { register unsigned char rep=0; int oCursor=0; int iCursor=0; - int done=0; /* main loop */ - while (iCursor<inputSize) { - rep=(input[iCursor++]); - done=0; + while (iCursor<input.size) { + rep=(input.data[iCursor++]); if (rep&0x80) { /* repeat */ rep&=(~0x80); rep++; - while (rep--) (output)[oCursor++]=input[iCursor]; + while (rep--) (output)[oCursor++]=input.data[iCursor]; iCursor++; } else { /* jump */ rep++; - while ((rep--)&&(iCursor<inputSize)) { - (output)[oCursor++]=input[iCursor++]; + while ((rep--)&&(iCursor<input.size)) { + (output)[oCursor++]=input.data[iCursor++]; } } } @@ -65,4 +62,3 @@ int expandRleV(const unsigned char* input, int inputSize, *outputSize=oCursor; return (rep==255)?PR_RESULT_SUCCESS:PR_RESULT_COMPRESS_RESULT_WARNING; } - diff --git a/PR/src/lib/object/image/image16.c b/PR/src/lib/object/image/image16.c index 85db446..4239d4c 100644 --- a/PR/src/lib/object/image/image16.c +++ b/PR/src/lib/object/image/image16.c @@ -152,7 +152,7 @@ void cmp_antiTransposeImage(tBinary* b, int widthInBytes, int height) { /* Expands an array into an image */ int mExpandGraphic(tBinary input, tImage *image) { /* - * Reads input.data and extracts tImage + * Reads input and extracts tImage * returns the next image address or -1 in case of error */ @@ -194,21 +194,21 @@ int mExpandGraphic(tBinary input, tImage *image) { result=PR_RESULT_SUCCESS; break; case COMPRESS_RLE_LR: /* RLE Left to Right Compression Algorithm */ - result=expandRle(input.data,input.size,&(image->pix),&imageSizeInBytes); + result=expandRle(input,&(image->pix),&imageSizeInBytes); checkSize; break; case COMPRESS_RLE_UD: /* RLE Up to Down Compression Algorithm */ - result=expandRle(input.data,input.size,&(image->pix),&imageSizeInBytes); + result=expandRle(input,&(image->pix),&imageSizeInBytes); checkResult; checkSize; cmp_transposeImage(image,imageSizeInBytes); break; case COMPRESS_LZG_LR: /* LZ Groody Left to Right Compression Algorithm */ - result=expandLzg(input/*.data,input.size*/,&(image->pix),&imageSizeInBytes); + result=expandLzg(input,&(image->pix),&imageSizeInBytes); checkSize; break; case COMPRESS_LZG_UD: /* LZ Groody Up to Down Compression Algorithm */ - result=expandLzg(input/*.data,input.size*/,&(image->pix),&imageSizeInBytes); + result=expandLzg(input,&(image->pix),&imageSizeInBytes); checkResult; checkSize; cmp_transposeImage(image,imageSizeInBytes); @@ -231,7 +231,7 @@ int mCompressGraphic(tBinary* input, tBinary* output, int ignoreFirstBytes, int int imageSizeInBytes; int max_alg=1; - /* Initialize variables */ + /* Initialise variables */ imageSizeInBytes=input->size; /*=image->widthInBytes*image->height;*/ /* @@ -408,7 +408,7 @@ void* objectImage16Read(const char* file,tObject palette, int *result) { int colors; *result=readBmp(file,&(image->pix),&(image->height),&(image->width),&(image->bits),&colors,&colorArray,&(image->widthInBytes)); - /* check if image was succesfully read loaded */ + /* check if image was successfully read loaded */ if (*result!=PR_RESULT_SUCCESS) { free(image); return NULL; diff --git a/PR/src/lib/object/image/image256.c b/PR/src/lib/object/image/image256.c index e650088..8522a4b 100644 --- a/PR/src/lib/object/image/image256.c +++ b/PR/src/lib/object/image/image256.c @@ -220,7 +220,7 @@ int pop2decompress(tBinary input, int verify, unsigned char** output,int* output /* First layer: expand the LGZ */ tempOutputSize=osCheck+6; - remaining=expandLzg(input/*.data,input.size*/,&tempOutput,&tempOutputSize); + remaining=expandLzg(input,&tempOutput,&tempOutputSize); /*printf("Call:\n return=%d function input.data size=%d\n internal output size=%d result output size=%d\n", remaining,input.size,osCheck,tempOutputSize);*/ /*if ((osCheck+6)!=tempOutputSize) @@ -254,7 +254,7 @@ int pop2decompress(tBinary input, int verify, unsigned char** output,int* output /*printf("Remaining tailing data: size=%d first=%02x %02x\n", remaining,start[0],start[1]);*/ tempOutputSize=0; - expandLzg(tail/*.data,tail.size*/,&tempOutput,&tempOutputSize); /* TODO: check error output */ + expandLzg(tail,&tempOutput,&tempOutputSize); /* TODO: check error output */ lineI=tempOutput; diff --git a/PR/src/lib/object/image/image_common.c b/PR/src/lib/object/image/image_common.c index 85db446..4239d4c 100644 --- a/PR/src/lib/object/image/image_common.c +++ b/PR/src/lib/object/image/image_common.c @@ -152,7 +152,7 @@ void cmp_antiTransposeImage(tBinary* b, int widthInBytes, int height) { /* Expands an array into an image */ int mExpandGraphic(tBinary input, tImage *image) { /* - * Reads input.data and extracts tImage + * Reads input and extracts tImage * returns the next image address or -1 in case of error */ @@ -194,21 +194,21 @@ int mExpandGraphic(tBinary input, tImage *image) { result=PR_RESULT_SUCCESS; break; case COMPRESS_RLE_LR: /* RLE Left to Right Compression Algorithm */ - result=expandRle(input.data,input.size,&(image->pix),&imageSizeInBytes); + result=expandRle(input,&(image->pix),&imageSizeInBytes); checkSize; break; case COMPRESS_RLE_UD: /* RLE Up to Down Compression Algorithm */ - result=expandRle(input.data,input.size,&(image->pix),&imageSizeInBytes); + result=expandRle(input,&(image->pix),&imageSizeInBytes); checkResult; checkSize; cmp_transposeImage(image,imageSizeInBytes); break; case COMPRESS_LZG_LR: /* LZ Groody Left to Right Compression Algorithm */ - result=expandLzg(input/*.data,input.size*/,&(image->pix),&imageSizeInBytes); + result=expandLzg(input,&(image->pix),&imageSizeInBytes); checkSize; break; case COMPRESS_LZG_UD: /* LZ Groody Up to Down Compression Algorithm */ - result=expandLzg(input/*.data,input.size*/,&(image->pix),&imageSizeInBytes); + result=expandLzg(input,&(image->pix),&imageSizeInBytes); checkResult; checkSize; cmp_transposeImage(image,imageSizeInBytes); @@ -231,7 +231,7 @@ int mCompressGraphic(tBinary* input, tBinary* output, int ignoreFirstBytes, int int imageSizeInBytes; int max_alg=1; - /* Initialize variables */ + /* Initialise variables */ imageSizeInBytes=input->size; /*=image->widthInBytes*image->height;*/ /* @@ -408,7 +408,7 @@ void* objectImage16Read(const char* file,tObject palette, int *result) { int colors; *result=readBmp(file,&(image->pix),&(image->height),&(image->width),&(image->bits),&colors,&colorArray,&(image->widthInBytes)); - /* check if image was succesfully read loaded */ + /* check if image was successfully read loaded */ if (*result!=PR_RESULT_SUCCESS) { free(image); return NULL; diff --git a/PR/src/ports/winfiles/pr.dev b/PR/src/ports/winfiles/pr.dev index d8f1d23..3775517 100644 --- a/PR/src/ports/winfiles/pr.dev +++ b/PR/src/ports/winfiles/pr.dev @@ -933,7 +933,7 @@ BuildCmd= Major=1 Minor=3 Release=0 -Build=70 +Build=71 LanguageID=2057 CharsetID=1252 CompanyName=Princed development team