author | ecalot
<ecalot> 2006-06-19 06:01:41 UTC |
committer | ecalot
<ecalot> 2006-06-19 06:01:41 UTC |
parent | 9a7e51ac9bdf73e0fcce3ffbcd5c3fa02bf5c200 |
PR/src/include/image.h | +10 | -10 |
PR/src/include/object.h | +5 | -5 |
PR/src/include/palette.h | +6 | -6 |
PR/src/include/sound.h | +1 | -1 |
PR/src/lib/actions/export.c | +2 | -2 |
PR/src/lib/actions/import.c | +6 | -6 |
PR/src/lib/layers/pallist.c | +5 | -5 |
PR/src/lib/object/image/image16.c | +11 | -11 |
PR/src/lib/object/image/image2.c | +4 | -4 |
PR/src/lib/object/image/image256.c | +12 | -12 |
PR/src/lib/object/image/image_common.c | +11 | -11 |
PR/src/lib/object/object.c | +21 | -35 |
PR/src/lib/object/palette/pop1_16c.c | +5 | -5 |
PR/src/lib/object/palette/pop2_256c.c | +2 | -2 |
PR/src/ports/winfiles/pr.dev | +1 | -1 |
diff --git a/PR/src/include/image.h b/PR/src/include/image.h index 6498677..a6040fa 100644 --- a/PR/src/include/image.h +++ b/PR/src/include/image.h @@ -66,18 +66,18 @@ typedef struct { /*int mCompressGraphic(tBinary* input, tBinary* output, int ignoreFirstBytes) */ -int objImage16Set(void* o,tResource* res); -int objImage16Write(void* img,const char* file,int optionflag,const char* backupExtension); -int objImage256Set(void* o,tResource* res); -int objImage256Write(void* img,const char* file,int optionflag,const char* backupExtension); -int objImage2Set(void* o,tResource* res); -int objImage2Write(void* img,const char* file,int optionflag,const char* backupExtension); +int objectImage16Set(void* o,tResource* res); +int objectImage16Write(void* img,const char* file,int optionflag,const char* backupExtension); +int objectImage256Set(void* o,tResource* res); +int objectImage256Write(void* img,const char* file,int optionflag,const char* backupExtension); +int objectImage2Set(void* o,tResource* res); +int objectImage2Write(void* img,const char* file,int optionflag,const char* backupExtension); void* objectImage16Create(tBinary c, int *error); -void* objImage16Read(const char* file,tObject palette, int *result); +void* objectImage16Read(const char* file,tObject palette, int *result); void* objectImage256Create(tBinary c, int *error); -void* objImage256Read(const char* file,tObject palette, int *result); +void* objectImage256Read(const char* file,tObject palette, int *result); void* objectImage2Create(tBinary c, int *error); -void* objImage2Read(const char* file,tObject palette, int *result); +void* objectImage2Read(const char* file,tObject palette, int *result); #define getCarry(a) ((((a)>>4)&7)+1) #define getAlgor(a) a&0x4F @@ -85,7 +85,7 @@ void* objImage2Read(const char* file,tObject palette, int *result); int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes); int mCompressGraphic(tBinary* input, tBinary* output, int ignoreFirstBytes, int w, int h); -int objImageGetColorCount(void* img); +int objectImageGetColorCount(void* img); void applyPalette(tObject image, tObject palette); #endif diff --git a/PR/src/include/object.h b/PR/src/include/object.h index d21cccb..eb084a4 100644 --- a/PR/src/include/object.h +++ b/PR/src/include/object.h @@ -39,12 +39,12 @@ object.h: Princed Resources : Main item class types and prototypes tObject objectCreate(tResource* r, int* error); int objectWrite(tObject o, const char* file, int optionflag, const char* backupExtension); -tObject readObject(const char* file,tResource* newRes,int *result); -void setObject(tObject o,int *result,tResource* res); +tObject objectRead(const char* file,tResource* newRes,int *result); +void objectSet(tObject o,int *result,tResource* res); -int paletteGetBits(tObject pal); -int paletteGetColors(tObject pal); -tColor* paletteGetColorArray(tObject pal); +int objectPaletteGetBits(tObject pal); +int objectGetColors(tObject pal); +tColor* objectGetColorsArray(tObject pal); int getColorsByType(tResourceType type); diff --git a/PR/src/include/palette.h b/PR/src/include/palette.h index 70177ab..b34209c 100644 --- a/PR/src/include/palette.h +++ b/PR/src/include/palette.h @@ -65,18 +65,18 @@ int applyPalette(tPalette* p,tImage *i); void* objPalette_pop2_4bitsCreate(tBinary c, int *error); int objPalette_pop2_4bitsWrite(void* o, const char* file, int optionflag, const char* backupExtension); void* objectPalettePop1_16Create(tBinary c, int *error); -int objPalette_pop1_4bitsWrite(void* o, const char* file, int optionflag, const char* backupExtension); -void* objPop1Palette4bitsRead(const char* file,int *result); -int objPop1Palette4bitsSet(void* o,tResource* res); +int objectPalettePop1_16Write(void* o, const char* file, int optionflag, const char* backupExtension); +void* objectPalettePop1_16Read(const char* file,int *result); +int objectPalettePop1_16Set(void* o,tResource* res); /*int objPop2Palette4bitsSet(void* o,tResource* res);*/ void* objectPalettePop2_NColorsCreate(tBinary cont, int *error); -int objPop2PaletteNColorsWrite(void* o, const char* file, int optionflag, const char* backupExtension); +int objectPalettePop2_NColorsWrite(void* o, const char* file, int optionflag, const char* backupExtension); void* objPop2PaletteNColorsRead(const char* file,int *result); int objPop2PaletteNColorsSet(void* o,tResource* res); -tColor* objPalette_pop1_4bitsGetColors(void* o); +tColor* objectPalettePop1_16GetColors(void* o); tColor* objPalette_pop2_4bitsGetColors(void* o); -tColor* objPalette_pop2_ncolorsGetColors(void* o); +tColor* objectPalettePop2_NColorsGetColors(void* o); /* middle layer */ #define to8bits_A(a) (((a)<<2)|((a)>>4)) diff --git a/PR/src/include/sound.h b/PR/src/include/sound.h index 3c086d4..c5f1eb5 100644 --- a/PR/src/include/sound.h +++ b/PR/src/include/sound.h @@ -61,6 +61,6 @@ int objPcspeakerSet(void* o,tResource* res); int objMidiSet(void* o,tResource* res); #define objMidiWrite(a,b,c,d) objectBinaryWrite(a,b,c,d) -#define objPcspeakerWrite(a,b,c,d) objectBinaryWrite(a,b,c,d) +#define objectSoundPcspeakerWrite(a,b,c,d) objectBinaryWrite(a,b,c,d) #endif diff --git a/PR/src/lib/actions/export.c b/PR/src/lib/actions/export.c index aac8b27..953167b 100644 --- a/PR/src/lib/actions/export.c +++ b/PR/src/lib/actions/export.c @@ -151,9 +151,9 @@ showobj(o); } /*res.palette=currentPalette;*/ o=objectCreate(&res,&ok); -printf("getting the palette for the %d colours object ",paletteGetColors(o)); +printf("getting the palette for the %d colours object ",objectGetColors(o)); showobj(o); - pal=pl_get(&palettes,&priorityRight,paletteGetColors(o)); + pal=pl_get(&palettes,&priorityRight,objectGetColors(o)); printf("palette "); showobj(pal); applyPalette(o,pal); diff --git a/PR/src/lib/actions/import.c b/PR/src/lib/actions/import.c index de3b51b..b4f65f6 100644 --- a/PR/src/lib/actions/import.c +++ b/PR/src/lib/actions/import.c @@ -85,11 +85,11 @@ int import_full(const char* vFiledat, const char* vDirExt, tResourceList* r, int /* newRes.content=mLoadFileArray(vFileext);*/ /* if (newRes.content.size>0) {*/ /* TODO: let each format handle the files */ - o=readObject(vFileext,&newRes,&result); + o=objectRead(vFileext,&newRes,&result); /* if (!fatal(result)) */ if (!result) - setObject(o,&result,&newRes); - + objectSet(o,&result,&newRes); + /* if (!fatal(ok)) { if (hasFlag(verbose_flag)) fprintf(outputStream,PR_TEXT_IMPORT_ERRORS,getFileNameFromPath(vFileext)); error++; @@ -153,11 +153,11 @@ int import_partial(const char* vFiledat, const char* vDirExt, tResourceList* r, /* get save file name (if unknown document is in the XML) */ getFileName(vFileext,vDirExt,&res,vFiledat,vDatFileName,optionflag,backupExtension,NULL); - o=readObject(repairFolders(vFileext),&newRes,&result); + o=objectRead(repairFolders(vFileext),&newRes,&result); /* if (!fatal(ok)) */ if (!ok) - setObject(o,&result,&newRes); - + objectSet(o,&result,&newRes); + /* the file is in the partial matching list, so I'll import */ /* newRes.content=mLoadFileArray(vFileext); if (newRes.content.size>0) { diff --git a/PR/src/lib/layers/pallist.c b/PR/src/lib/layers/pallist.c index bc3c3e1..20d726f 100644 --- a/PR/src/lib/layers/pallist.c +++ b/PR/src/lib/layers/pallist.c @@ -51,7 +51,7 @@ tPaletteList paletteListCreate() { #ifndef DEBUG_TEST_PALLST void showobj(tObject o) { - printf("object type=%d colors=%d\n",o.type,paletteGetColors(o)); + printf("object type=%d colors=%d\n",o.type,objectGetColors(o)); } #endif @@ -110,11 +110,11 @@ showobj(o); } else { /* low priority insertion */ tPL_Node* insertNode=malloc(sizeof(tPL_Node)); - int colors=paletteGetColors(o); + int colors=objectGetColors(o); printf("adding with low priority:\n"); showobj(o); - while (pl->list_first && colors>=paletteGetColors(pl->list_first->object)) { + while (pl->list_first && colors>=objectGetColors(pl->list_first->object)) { printf("deleting: "); showobj(pl->list_first->object); pl->list_first=pl->list_first->next; /* Delete */ @@ -136,7 +136,7 @@ printf("getting PL\n"); *priorityRight=1; if (pl->priority_field.enabled) { - if (colors<=paletteGetColors(pl->priority_field.object)) { + if (colors<=objectGetColors(pl->priority_field.object)) { showobj(pl->priority_field.object); return pl->priority_field.object; } else { @@ -148,7 +148,7 @@ showobj(pl->priority_field.object); printf("first=%p with ",(void*)pl->list_first); showobj(pl->list_first->object); - while (node && colors>paletteGetColors(node->object)) + while (node && colors>objectGetColors(node->object)) { node=node->next; printf("next %p\n",(void*)node); } return node?node->object:objectCreate(NULL,&junk); diff --git a/PR/src/lib/object/image/image16.c b/PR/src/lib/object/image/image16.c index b2f67fb..27a3f2a 100644 --- a/PR/src/lib/object/image/image16.c +++ b/PR/src/lib/object/image/image16.c @@ -375,7 +375,7 @@ void* objectImage16Create(tBinary cont, int *error) { /* use get like main.c */ } /* image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=getCarry(image->type)) printf("error, palette mismatch (pal=%d bits=%d)\n",bits,getCarry(image->type)); image->bits=getCarry(image->type);*/ @@ -384,16 +384,16 @@ void* objectImage16Create(tBinary cont, int *error) { /* use get like main.c */ return (void*)image; } -int objImage16Write(void* img,const char* file,int optionflag,const char* backupExtension) { +int objectImage16Write(void* img,const char* file,int optionflag,const char* backupExtension) { tImage* i=img; int bits; int colors; tColor* colorArray; if (i->pal.type!=eResTypeNone) { - bits=4; /*paletteGetBits(i->pal);*/ - colors=16; /*paletteGetColors(i->pal);*/ - colorArray=paletteGetColorArray(i->pal); + bits=4; /*objectPaletteGetBits(i->pal);*/ + colors=16; /*objectGetColors(i->pal);*/ + colorArray=objectGetColorsArray(i->pal); } else { /* bits=getCarry(i->type); colors=1<<bits;*/ @@ -405,14 +405,14 @@ int objImage16Write(void* img,const char* file,int optionflag,const char* backup return mWriteBmp(file,i->pix,i->width,i->height,bits,colors,colorArray,i->widthInBytes,optionflag,backupExtension); } -void objImageFree(void* img) { +void objectImageFree(void* img) { if (!img) return; /* free bitmap */ free(((tImage*)img)->pix); free(img); } -void* objImage16Read(const char* file,tObject palette, int *result) { +void* objectImage16Read(const char* file,tObject palette, int *result) { int bits; tImage* image=(tImage*)malloc(sizeof(tImage)); tColor* colorArray; @@ -428,7 +428,7 @@ void* objImage16Read(const char* file,tObject palette, int *result) { /* check the palette information */ image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=image->bits) { /* bits=0 means all palettes allowed or ignore palette check */ *result=PR_RESULT_ERR_BMP_BITRATE_DIFFERS; free(image->pix); @@ -442,10 +442,10 @@ void* objImage16Read(const char* file,tObject palette, int *result) { free(colorArray); return (void*)image; } - /* TODO: generate image->type in objImageSet */ + /* TODO: generate image->type in objectImageSet */ -/*int mFormatImportBmp(tResource *res) { --> objImageSet */ -int objImage16Set(void* o,tResource* res) { +/*int mFormatImportBmp(tResource *res) { --> objectImageSet */ +int objectImage16Set(void* o,tResource* res) { tImage* img=o; tBinary decompressed,compressed; int algorithm; diff --git a/PR/src/lib/object/image/image2.c b/PR/src/lib/object/image/image2.c index 6b38221..42e7c84 100644 --- a/PR/src/lib/object/image/image2.c +++ b/PR/src/lib/object/image/image2.c @@ -128,7 +128,7 @@ void* objectImage2Create(tBinary cont, int *error) { /* use get like main.c */ return (void*)image; } -int objImage2Write(void* img,const char* file,int optionflag,const char* backupExtension) { +int objectImage2Write(void* img,const char* file,int optionflag,const char* backupExtension) { tImage* i=img; tColor* colorArray=objPalette_pop1_monoGetColors(); @@ -136,7 +136,7 @@ int objImage2Write(void* img,const char* file,int optionflag,const char* backupE return mWriteBmp(file,i->pix,i->width,i->height,1,2,colorArray,i->widthInBytes,optionflag,backupExtension); } -void* objImage2Read(const char* file,tObject palette, int *result) { +void* objectImage2Read(const char* file,tObject palette, int *result) { int bits; tImage* image=(tImage*)malloc(sizeof(tImage)); tColor* colorArray; @@ -153,7 +153,7 @@ void* objImage2Read(const char* file,tObject palette, int *result) { /* check the palette information */ - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (image->bits!=1) { *result=PR_RESULT_ERR_BMP_BITRATE_DIFFERS; free(image->pix); @@ -165,7 +165,7 @@ void* objImage2Read(const char* file,tObject palette, int *result) { return (void*)image; } -int objImage2Set(void* o,tResource* res) { +int objectImage2Set(void* o,tResource* res) { tImage* img=o; tBinary decompressed,compressed; int algorithm; diff --git a/PR/src/lib/object/image/image256.c b/PR/src/lib/object/image/image256.c index c858fcc..4f51f3a 100644 --- a/PR/src/lib/object/image/image256.c +++ b/PR/src/lib/object/image/image256.c @@ -328,7 +328,7 @@ void* objectImage256Create(tBinary cont, int *error) { /* use get like main.c */ } /* image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=getCarry(image->type)) printf("error, palette mismatch (pal=%d bits=%d)\n",bits,getCarry(image->type));*/ image->bits=getCarry(image->type); @@ -347,16 +347,16 @@ tColor* objPalette_256() { return c; } -int objImage256Write(void* img,const char* file,int optionflag,const char* backupExtension) { +int objectImage256Write(void* img,const char* file,int optionflag,const char* backupExtension) { tImage* i=img; int bits; int colors; tColor* colorArray; if (i->pal.type!=eResTypeNone) { - bits=paletteGetBits(i->pal); - colors=i->colorCount; /*paletteGetColors(i->pal);*/ - colorArray=paletteGetColorArray(i->pal); + bits=objectPaletteGetBits(i->pal); + colors=i->colorCount; /*objectGetColors(i->pal);*/ + colorArray=objectGetColorsArray(i->pal); } else { bits=8; /*getCarry(i->type);*/ colors=256; /*1<<bits;*/ @@ -367,14 +367,14 @@ int objImage256Write(void* img,const char* file,int optionflag,const char* backu return mWriteBmp(file,i->pix,i->width,i->height,bits,colors,colorArray,i->widthInBytes,optionflag,backupExtension); } -void objImage256Free(void* img) { +void objectImage256Free(void* img) { if (!img) return; /* free bitmap */ free(((tImage*)img)->pix); free(img); } -void* objImage256Read(const char* file,tObject palette, int *result) { +void* objectImage256Read(const char* file,tObject palette, int *result) { int bits; tImage* image=(tImage*)malloc(sizeof(tImage)); tColor* colorArray; @@ -390,7 +390,7 @@ void* objImage256Read(const char* file,tObject palette, int *result) { /* check the palette information */ image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=image->bits) { /* bits=0 means all palettes allowed or ignore palette check */ *result=PR_RESULT_ERR_BMP_BITRATE_DIFFERS; free(image->pix); @@ -404,10 +404,10 @@ void* objImage256Read(const char* file,tObject palette, int *result) { free(colorArray); return (void*)image; } - /* TODO: generate image->type in objImageSet */ + /* TODO: generate image->type in objectImageSet */ -/*int mFormatImportBmp(tResource *res) { --> objImageSet */ -int objImage256Set(void* o,tResource* res) { +/*int mFormatImportBmp(tResource *res) { --> objectImageSet */ +int objectImage256Set(void* o,tResource* res) { tImage* img=o; tBinary decompressed,compressed; @@ -436,7 +436,7 @@ int objImage256Set(void* o,tResource* res) { } /* common function TODO: move */ -int objImageGetColorCount(void* img) { +int objectImageGetColorCount(void* img) { tImage* i=img; return i->colorCount; } diff --git a/PR/src/lib/object/image/image_common.c b/PR/src/lib/object/image/image_common.c index b2f67fb..27a3f2a 100644 --- a/PR/src/lib/object/image/image_common.c +++ b/PR/src/lib/object/image/image_common.c @@ -375,7 +375,7 @@ void* objectImage16Create(tBinary cont, int *error) { /* use get like main.c */ } /* image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=getCarry(image->type)) printf("error, palette mismatch (pal=%d bits=%d)\n",bits,getCarry(image->type)); image->bits=getCarry(image->type);*/ @@ -384,16 +384,16 @@ void* objectImage16Create(tBinary cont, int *error) { /* use get like main.c */ return (void*)image; } -int objImage16Write(void* img,const char* file,int optionflag,const char* backupExtension) { +int objectImage16Write(void* img,const char* file,int optionflag,const char* backupExtension) { tImage* i=img; int bits; int colors; tColor* colorArray; if (i->pal.type!=eResTypeNone) { - bits=4; /*paletteGetBits(i->pal);*/ - colors=16; /*paletteGetColors(i->pal);*/ - colorArray=paletteGetColorArray(i->pal); + bits=4; /*objectPaletteGetBits(i->pal);*/ + colors=16; /*objectGetColors(i->pal);*/ + colorArray=objectGetColorsArray(i->pal); } else { /* bits=getCarry(i->type); colors=1<<bits;*/ @@ -405,14 +405,14 @@ int objImage16Write(void* img,const char* file,int optionflag,const char* backup return mWriteBmp(file,i->pix,i->width,i->height,bits,colors,colorArray,i->widthInBytes,optionflag,backupExtension); } -void objImageFree(void* img) { +void objectImageFree(void* img) { if (!img) return; /* free bitmap */ free(((tImage*)img)->pix); free(img); } -void* objImage16Read(const char* file,tObject palette, int *result) { +void* objectImage16Read(const char* file,tObject palette, int *result) { int bits; tImage* image=(tImage*)malloc(sizeof(tImage)); tColor* colorArray; @@ -428,7 +428,7 @@ void* objImage16Read(const char* file,tObject palette, int *result) { /* check the palette information */ image->pal=palette; - bits=paletteGetBits(image->pal); + bits=objectPaletteGetBits(image->pal); if (bits && bits!=image->bits) { /* bits=0 means all palettes allowed or ignore palette check */ *result=PR_RESULT_ERR_BMP_BITRATE_DIFFERS; free(image->pix); @@ -442,10 +442,10 @@ void* objImage16Read(const char* file,tObject palette, int *result) { free(colorArray); return (void*)image; } - /* TODO: generate image->type in objImageSet */ + /* TODO: generate image->type in objectImageSet */ -/*int mFormatImportBmp(tResource *res) { --> objImageSet */ -int objImage16Set(void* o,tResource* res) { +/*int mFormatImportBmp(tResource *res) { --> objectImageSet */ +int objectImage16Set(void* o,tResource* res) { tImage* img=o; tBinary decompressed,compressed; int algorithm; diff --git a/PR/src/lib/object/object.c b/PR/src/lib/object/object.c index 91da3c9..f2b4018 100644 --- a/PR/src/lib/object/object.c +++ b/PR/src/lib/object/object.c @@ -106,13 +106,13 @@ int objectWrite(tObject o, const char* file, int optionflag, const char* backupE error=objectBinaryWrite(o.obj,file,optionflag,backupExtension); break; case eResTypePalettePop1_16: /* save and remember palette file */ - error=objPalette_pop1_4bitsWrite(o.obj,file,optionflag,backupExtension); + error=objectPalettePop1_16Write(o.obj,file,optionflag,backupExtension); break; case eResTypePalettePop2_NColors: /* save and remember palette file */ - error=objPop2PaletteNColorsWrite(o.obj,file,optionflag,backupExtension); + error=objectPalettePop2_NColorsWrite(o.obj,file,optionflag,backupExtension); break; case eResTypeSoundPcspeaker: /* save pcs file */ - error=objPcspeakerWrite(o.obj,file,optionflag,backupExtension); + error=objectSoundPcspeakerWrite(o.obj,file,optionflag,backupExtension); break; case eResTypeSoundMidi: /* save midi file */ error=objMidiWrite(o.obj,file,optionflag,backupExtension); @@ -121,13 +121,13 @@ int objectWrite(tObject o, const char* file, int optionflag, const char* backupE error=objWaveWrite(o.obj,file,optionflag,backupExtension); break; case eResTypeImage2: /* save image */ - error=objImage2Write(o.obj,file,optionflag,backupExtension); + error=objectImage2Write(o.obj,file,optionflag,backupExtension); break; case eResTypeImage16: /* save image */ - error=objImage16Write(o.obj,file,optionflag,backupExtension); + error=objectImage16Write(o.obj,file,optionflag,backupExtension); break; case eResTypeImage256: /* save image */ - error=objImage256Write(o.obj,file,optionflag,backupExtension); + error=objectImage256Write(o.obj,file,optionflag,backupExtension); break; default: printf("Warning: Couldn't write unhooked type %d\n",o.type); @@ -139,7 +139,7 @@ printf("Warning: Couldn't write unhooked type %d\n",o.type); /* Palette class methods */ -int paletteGetBits(tObject pal) { +int objectPaletteGetBits(tObject pal) { switch (pal.type) { case eResTypePalettePop2_NColors: return 8; @@ -152,45 +152,31 @@ int paletteGetBits(tObject pal) { } } -int paletteGetColors(tObject object) { /* TODO: rename to objectGetColors */ +int objectGetColors(tObject object) { /* TODO: rename to objectGetColors */ switch (object.type) { case eResTypePalettePop2_NColors: - return PAL_COLORS_eResTypePalettePop2_NColors; /*256;*/ + return PAL_COLORS_eResTypePalettePop2_NColors; case eResTypePalettePop1_16: - return PAL_COLORS_eResTypePalettePop1_16; /*16;*/ + return PAL_COLORS_eResTypePalettePop1_16; case eResTypePalettePop1_Mono: - return PAL_COLORS_eResTypePalettePop1_Mono; /*2;*/ + return PAL_COLORS_eResTypePalettePop1_Mono; case eResTypeNone: return 256; case eResTypeImage16: case eResTypeImage2: case eResTypeImage256: - return objImageGetColorCount(object.obj); + return objectImageGetColorCount(object.obj); default: return 0; } } -/* -int getColorsByType(tResourceType t) { - switch (t) { - case eResTypeImage16: - return 16; - case eResTypeImage2: - return 2; - case eResTypeImage256: - return 256; - default: - return 0; - } -} -*/ -tColor* paletteGetColorArray(tObject pal) { +tColor* objectGetColorsArray(tObject pal) { switch (pal.type) { case eResTypePalettePop1_16: /* save and remember palette file */ - return objPalette_pop1_4bitsGetColors(pal.obj); + return objectPalettePop1_16GetColors(pal.obj); case eResTypePalettePop2_NColors: - return objPalette_pop2_ncolorsGetColors(pal.obj); + return objectPalettePop2_NColorsGetColors(pal.obj); default: return NULL; } @@ -200,13 +186,13 @@ tColor* paletteGetColorArray(tObject pal) { | Dat compiling primitive | \***************************************************************/ -void setObject(tObject o,int *result,tResource* res) { +void objectSet(tObject o,int *result,tResource* res) { switch (o.type) { case eResTypeLevelPop1: /*result=objLevelSet(o.obj,res); TODO */ break; case eResTypeImage16: - *result=objImage16Set(o.obj,res); + *result=objectImage16Set(o.obj,res); break; case eResTypeSoundWave: *result=objWaveSet(o.obj,res); @@ -218,7 +204,7 @@ void setObject(tObject o,int *result,tResource* res) { *result=objPcspeakerSet(o.obj,res); break; case eResTypePalettePop1_16: - *result=objPop1Palette4bitsSet(o.obj,res); + *result=objectPalettePop1_16Set(o.obj,res); break; case eResTypeOtherBinary: default: @@ -229,7 +215,7 @@ void setObject(tObject o,int *result,tResource* res) { } /* Format detection function (private function, not in header file) */ -tObject readObject(const char* file,tResource* res,int *result) { +tObject objectRead(const char* file,tResource* res,int *result) { /* return true if ok, false if error */ tObject o; switch (res->type) { @@ -237,7 +223,7 @@ tObject readObject(const char* file,tResource* res,int *result) { /*o.obj=objLevelRead(file,res.content,result); TODO */ break; case eResTypeImage16: - o.obj=objImage16Read(file,*res->palette,result); + o.obj=objectImage16Read(file,*res->palette,result); break; case eResTypeSoundWave: o.obj=objWaveRead(file,result); @@ -249,7 +235,7 @@ tObject readObject(const char* file,tResource* res,int *result) { o.obj=objPcspeakerRead(file,result); break; case eResTypePalettePop1_16: - o.obj=objPop1Palette4bitsRead(file,result); + o.obj=objectPalettePop1_16Read(file,result); break; case eResTypeOtherBinary: default: diff --git a/PR/src/lib/object/palette/pop1_16c.c b/PR/src/lib/object/palette/pop1_16c.c index 3b2a29b..9ed2e5f 100644 --- a/PR/src/lib/object/palette/pop1_16c.c +++ b/PR/src/lib/object/palette/pop1_16c.c @@ -192,7 +192,7 @@ void* objectPalettePop1_16Create(tBinary cont, int *error) { return (void*)pal; } -int objPalette_pop1_4bitsWrite(void* o, const char* file, int optionflag, const char* backupExtension) { +int objectPalettePop1_16Write(void* o, const char* file, int optionflag, const char* backupExtension) { tPop1_4bitsPalette* pal=o; char aux[260]; @@ -203,12 +203,12 @@ int objPalette_pop1_4bitsWrite(void* o, const char* file, int optionflag, const return writePal(file,16,pal->c,optionflag,backupExtension); } -tColor* objPalette_pop1_4bitsGetColors(void* o) { +tColor* objectPalettePop1_16GetColors(void* o) { tPop1_4bitsPalette* pal=o; return pal->c; } -tColor* paletteGetColorArrayForColors(int colors) { +tColor* objectGetColorsArrayForColors(int colors) { static tColor p1[2]; static tColor p4[2]; static tColor p8[2]; @@ -241,7 +241,7 @@ tColor* paletteGetColorArrayForColors(int colors) { } } -void* objPop1Palette4bitsRead(const char* file,int *result) { +void* objectPalettePop1_16Read(const char* file,int *result) { tPop1_4bitsPalette* pal=(tPop1_4bitsPalette*)malloc(sizeof(tPop1_4bitsPalette)); tColor* colorArray; int colors; @@ -268,7 +268,7 @@ void* objPop1Palette4bitsRead(const char* file,int *result) { return (void*)pal; } -int objPop1Palette4bitsSet(void* o,tResource* res) { +int objectPalettePop1_16Set(void* o,tResource* res) { tPop1_4bitsPalette* pal=o; int i; diff --git a/PR/src/lib/object/palette/pop2_256c.c b/PR/src/lib/object/palette/pop2_256c.c index 5f8bd48..b2f2a53 100644 --- a/PR/src/lib/object/palette/pop2_256c.c +++ b/PR/src/lib/object/palette/pop2_256c.c @@ -76,7 +76,7 @@ printf("created a palette with %d colors. cs=%ld\n",j,cont.size); return (void*)r; } -tColor* objPalette_pop2_ncolorsGetColors(void* o) { +tColor* objectPalettePop2_NColorsGetColors(void* o) { tGenericPalette* pal=o; return pal->colorArray; } @@ -87,7 +87,7 @@ int getColorsByPop2PaletteObject(void* o) { return pal->size; } -int objPop2PaletteNColorsWrite(void* o, const char* file, int optionflag, const char* backupExtension) { +int objectPalettePop2_NColorsWrite(void* o, const char* file, int optionflag, const char* backupExtension) { tGenericPalette* p=o; return writePal(file,p->size,p->colorArray,optionflag,backupExtension); } diff --git a/PR/src/ports/winfiles/pr.dev b/PR/src/ports/winfiles/pr.dev index c18f12f..606411a 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=27 +Build=33 LanguageID=2057 CharsetID=1252 CompanyName=Princed development team