#include "..\kosSyst.h" #include "pcx.h" int PCXFile::LoadPCXFile(Byte* filebuff, Dword filesize) { memcpy((Byte*)&Pcx_head,(Byte*)filebuff,sizeof(PCXHeader)); int state=0; if (Pcx_head.bManufacturer==0x0a && Pcx_head.bVersion==0x05) { width=Pcx_head.dwWidth-Pcx_head.dwX+1; height=Pcx_head.dwHeight-Pcx_head.dwY+1; buffer=kos_GetMemory(width*height*3); Byte* pPal=filebuff+filesize-768; Byte* pImg=filebuff+128; Byte* cBuffer=(Byte*)buffer; if (Pcx_head.bNPlanes==1) { /* 8-bit decoding */ Dword y,i; Byte cur_byte,counter; Dword cWidth; for(y=0;y=192) { counter=(cur_byte & 0x3F); cur_byte=*(pImg); pImg++; } for(i=0;i