diff --git a/map_edit/m1read.c b/map_edit/m1read.c index e30499e..6cbfd9b 100644 --- a/map_edit/m1read.c +++ b/map_edit/m1read.c @@ -15,6 +15,7 @@ #include "ackeng.h" #include "m1.h" +extern UCHAR colordat[]; extern UCHAR *Bitmaps[]; extern UCHAR *ObjBitmaps[]; extern UCHAR ObjbmNum[]; @@ -38,6 +39,20 @@ e++; return(e); } +short LoadPalette(char *paletteName) { + FILE *fp; + + GetCombinedPath(assetsPath, paletteName); + fp = fopen(tempFilename, "rb"); + if (fp == NULL) + return -1; + + fread(colordat, 768, 1, fp); + + fclose(fp); + return 0; +} + /**************************************************************************** ** ** ****************************************************************************/ @@ -275,6 +290,10 @@ while (1) if (!strnicmp(LineBuf,"PALFILE:",8)) { strcpy(PalName,SkipSpaces(&LineBuf[8])); + if (LoadPalette(PalName)) { + printf("Error loading palette \"%s\".\n",PalName); + result = -1; + } continue; }