mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
dyskowy * [new] uniezależnienie VCMI od rozprutych lodów * [new] CAmbarCendamo może przyjąć do odczytu mapę w pamięci * [bugfix] poprawione generowanie nagłówka BMPa * [bugfix] w nowym handlerze nie dałeś stdafxa * [new] CPregame korzysta bezpośrednio z lodów * [change] CPCXConv przy otwieraniu z pamięci nie kopiuje źródla, tylko sie na nie ustawia * [removed] wskaźnik procentowy przy czytaniu defów - 2 razy szybciej wczytuje się mapa * [new] odpalanie wybranego scenariusza * [new] strzałkami można rpzesuwać wybrany scenariusz, ale działa tylko gdy nie wybrano filtru (kiedy indziej dokończę)
63 lines
3.0 KiB
C++
63 lines
3.0 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 BMPPalette
|
|
{
|
|
unsigned char R,G,B,F;
|
|
};
|
|
|
|
class CDefHandler
|
|
{
|
|
private:
|
|
std::string defName, curDir;
|
|
int totalEntries, DEFType, totalBlocks, fullWidth, fullHeight;
|
|
unsigned char fbuffer[800];
|
|
bool allowRepaint;
|
|
int length;
|
|
unsigned char * FDef;
|
|
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::vector<Cimage> ourImages;
|
|
|
|
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); //zapisuje klastke 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;
|
|
};
|
|
|
|
#endif // CDEFHANDLER_H
|