author | ecalot
<ecalot> 2006-06-15 00:26:24 UTC |
committer | ecalot
<ecalot> 2006-06-15 00:26:24 UTC |
parent | af174c29e7f41c024c89b92d932445309087f633 |
PR/src/include/palette.h | +3 | -1 |
PR/src/lib/object/object.c | +14 | -0 |
PR/src/lib/object/palette/pop2_256c.c | +6 | -1 |
diff --git a/PR/src/include/palette.h b/PR/src/include/palette.h index 3656224..cb94f6f 100644 --- a/PR/src/include/palette.h +++ b/PR/src/include/palette.h @@ -87,8 +87,10 @@ tColor* objPalette_pop2_ncolorsGetColors(void* o); /* Hooks */ -#define PAL_COLORS_eResTypePop2PaletteNColors /*256*/ (int)(pal.obj) +#define PAL_COLORS_eResTypePop2PaletteNColors /*256*/ getColorsByPop2PaletteObject(pal.obj) #define PAL_COLORS_eResTypePop1Palette4bits 16 #define PAL_COLORS_eResTypePop1PaletteMono 2 +int getColorsByPop2PaletteObject(void* o); + #endif diff --git a/PR/src/lib/object/object.c b/PR/src/lib/object/object.c index ceeaff9..9169061 100644 --- a/PR/src/lib/object/object.c +++ b/PR/src/lib/object/object.c @@ -172,6 +172,20 @@ int paletteGetColors(tObject pal) { } } +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) { switch (pal.type) { case eResTypePop1Palette4bits: /* save and remember palette file */ diff --git a/PR/src/lib/object/palette/pop2_256c.c b/PR/src/lib/object/palette/pop2_256c.c index 7daab1e..7df4571 100644 --- a/PR/src/lib/object/palette/pop2_256c.c +++ b/PR/src/lib/object/palette/pop2_256c.c @@ -80,6 +80,12 @@ tColor* objPalette_pop2_ncolorsGetColors(void* o) { return pal->colorArray; } + +int getColorsByPop2PaletteObject(void* o) { + tGenericPalette* pal=o; + return pal->size; +} + int objPop2PaletteNColorsWrite(void* o, const char* file, int optionflag, const char* backupExtension) { tGenericPalette* p=o; return writePal(file,p->size,p->colorArray,optionflag,backupExtension); @@ -118,4 +124,3 @@ int objPop2PaletteNColorsSet(void* o,tResource* res) { mWriteFileInDatFile(res);*/ return PR_RESULT_SUCCESS; } -