mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-26 08:41:13 +02:00
23a7b708d8
* drawing window text-bitmap-subtitle * destructor for CDefEssential * version changed to 0.5x (or maybe it should be 0.6 ?) * minor changes
76 lines
3.5 KiB
C++
76 lines
3.5 KiB
C++
#ifndef CDEFHANDLER_H
|
|
#define CDEFHANDLER_H
|
|
|
|
#include "SDL.h"
|
|
#include "CSemiDefHandler.h"
|
|
|
|
class CDefEssential;
|
|
|
|
struct BMPHeader
|
|
{
|
|
int fullSize, _h1, _h2, _h3, _c1, _c2, _c3, _c4, x, y,
|
|
dataSize1, dataSize2; //DataSize=X*Y+2*Y
|
|
unsigned char _c5[8];
|
|
void print(std::ostream & out);
|
|
BMPHeader(){_h1=_h2=0;for(int i=0;i<8;i++)_c5[i]=0;};
|
|
};/*
|
|
struct DEFHeader
|
|
{
|
|
int type, width, height, groups;
|
|
unsigned char palette[767];
|
|
};
|
|
struct DEFGroup
|
|
{
|
|
int ID, items, unknown1, unknown2;
|
|
};*/
|
|
|
|
struct BMPPalette
|
|
{
|
|
unsigned char R,G,B,F;
|
|
};
|
|
|
|
class CDefHandler
|
|
{
|
|
private:
|
|
int totalEntries, DEFType, totalBlocks, fullWidth, fullHeight;
|
|
bool allowRepaint;
|
|
int length;
|
|
BMPPalette palette[256];
|
|
unsigned int * RWEntries;
|
|
int * RLEntries;
|
|
struct SEntry
|
|
{
|
|
std::string name;
|
|
int offset;
|
|
int group;
|
|
} ;
|
|
std::vector<SEntry> SEntries ;
|
|
char id[2];
|
|
|
|
|
|
public:
|
|
std::string defName, curDir;
|
|
std::vector<Cimage> ourImages;
|
|
bool alphaTransformed;
|
|
bool notFreeImgs;
|
|
|
|
CDefHandler();
|
|
~CDefHandler();
|
|
static void print (std::ostream & stream, int nr, int bytcon);
|
|
int readNormalNr (int pos, int bytCon, unsigned char * str=NULL, bool cyclic=false);
|
|
static unsigned char * CDefHandler::writeNormalNr (int nr, int bytCon);
|
|
SDL_Surface * getSprite (int SIndex, unsigned char * FDef); //zapisuje klatke o zadanym numerze do "testtt.bmp"
|
|
void openDef(std::string name);
|
|
void expand(unsigned char N,unsigned char & BL, unsigned char & BR);
|
|
void openFromMemory(unsigned char * table, int size, std::string name);
|
|
CDefEssential * essentialize();
|
|
};
|
|
|
|
class CDefEssential //DefHandler with images only
|
|
{
|
|
public:
|
|
std::vector<Cimage> ourImages;
|
|
~CDefEssential();
|
|
};
|
|
|
|
#endif // CDEFHANDLER_H
|