CDefHandler.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef CDEFH_H
  2. #define CDEFH_H
  3. //#include "CDefHandler.h"
  4. //var
  5. // Form1 {$IFDEF KOL_MCK} : PForm1 {$ELSE} : TForm1 {$ENDIF} ;
  6. struct BMPPalette
  7. {
  8. unsigned char R,G,B,F;
  9. };
  10. class CDefHandler
  11. {
  12. public:
  13. std::string defName, curDir;
  14. int totalEntries, DEFType, totalBlocks, fullWidth, fullHeight;
  15. unsigned char fbuffer[800];
  16. // TempBmp: PBitmap;
  17. bool allowRepaint;
  18. int length;
  19. unsigned char * FDef;
  20. BMPPalette palette[256];
  21. // FBmp, //Поток BMP (Memory)
  22. // FTemp: PStream; //Временный поток (Memory)
  23. // TempLongInt: LongInt; //Временная переменная
  24. unsigned int * RWEntries;
  25. int * RLEntries;
  26. struct SEntry
  27. {
  28. std::string name;
  29. int offset;
  30. } ;
  31. std::vector<SEntry> SEntries ;
  32. char id[2];
  33. struct BMPHeader
  34. {
  35. int fullSize, _h1, _h2, _h3, _c1, _c2, _c3, _c4, x, y,
  36. dataSize1, dataSize2; //DataSize=X*Y+2*Y
  37. unsigned char _c5[8];
  38. } ;
  39. void print (std::ostream & stream, int nr, int bytcon);
  40. int readNormalNr (int pos, int bytCon, unsigned char * str=NULL, bool cyclic=false);
  41. unsigned char * CDefHandler::writeNormalNr (int nr, int bytCon);
  42. void getSprite (long SIndex); //zapisuje klastke o zadanym numerze do "testtt.bmp"
  43. void openDef(std::string name);
  44. void expand(unsigned char N,unsigned char & BL, unsigned char & BR);
  45. };
  46. #endif // CDEFH_H