forked from metin2/server
Add project files.
This commit is contained in:
43
libgame/include/attribute.h
Normal file
43
libgame/include/attribute.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef __INC_METIN_II_ATTRIBUTE_H__
|
||||
#define __INC_METIN_II_ATTRIBUTE_H__
|
||||
|
||||
enum EDataType
|
||||
{
|
||||
D_DWORD,
|
||||
D_WORD,
|
||||
D_BYTE
|
||||
};
|
||||
|
||||
//
|
||||
// <20><> <20>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
//
|
||||
class CAttribute
|
||||
{
|
||||
public:
|
||||
CAttribute(DWORD width, DWORD height); // dword Ÿ<><C5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 0<><30> ä<><C3A4><EFBFBD><EFBFBD>.
|
||||
CAttribute(DWORD * attr, DWORD width, DWORD height); // attr<74><72> <20>о smart<72>ϰ<EFBFBD> <20>Ӽ<EFBFBD><D3BC><EFBFBD> <20>о<EFBFBD><D0BE>´<EFBFBD>.
|
||||
~CAttribute();
|
||||
void Alloc();
|
||||
int GetDataType();
|
||||
void * GetDataPtr();
|
||||
void Set(DWORD x, DWORD y, DWORD attr);
|
||||
void Remove(DWORD x, DWORD y, DWORD attr);
|
||||
DWORD Get(DWORD x, DWORD y);
|
||||
void CopyRow(DWORD y, DWORD * row);
|
||||
|
||||
private:
|
||||
void Initialize(DWORD width, DWORD height);
|
||||
|
||||
private:
|
||||
int dataType;
|
||||
DWORD defaultAttr;
|
||||
DWORD width, height;
|
||||
|
||||
void * data;
|
||||
|
||||
BYTE ** bytePtr;
|
||||
WORD ** wordPtr;
|
||||
DWORD ** dwordPtr;
|
||||
};
|
||||
|
||||
#endif
|
26
libgame/include/grid.h
Normal file
26
libgame/include/grid.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef __INC_METIN_II_GRID_H__
|
||||
#define __INC_METIN_II_GRID_H__
|
||||
|
||||
class CGrid
|
||||
{
|
||||
public:
|
||||
CGrid(int w, int h);
|
||||
CGrid(CGrid * pkGrid, int w, int h);
|
||||
~CGrid();
|
||||
|
||||
void Clear();
|
||||
int FindBlank(int w, int h);
|
||||
bool IsEmpty(int iPos, int w, int h);
|
||||
bool Put(int iPos, int w, int h);
|
||||
void Get(int iPos, int w, int h);
|
||||
void Print();
|
||||
unsigned int GetSize();
|
||||
|
||||
protected:
|
||||
int m_iWidth;
|
||||
int m_iHeight;
|
||||
|
||||
char * m_pGrid;
|
||||
};
|
||||
|
||||
#endif
|
46
libgame/include/targa.h
Normal file
46
libgame/include/targa.h
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef __INC_METIN_II_SERVER_TARGA_H__
|
||||
#define __INC_METIN_II_SERVER_TARGA_H__
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct TGA_HEADER
|
||||
{
|
||||
char idLen; // 0
|
||||
char palType; // <20>ķ<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1, <20><><EFBFBD><EFBFBD> 0
|
||||
char imgType; // <20>ķ<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1, <20><><EFBFBD><EFBFBD> 2
|
||||
WORD colorBegin; // 0
|
||||
WORD colorCount; // <20>ķ<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 256, <20><><EFBFBD><EFBFBD> 0
|
||||
char palEntrySize; // <20>ķ<EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 24, <20><><EFBFBD><EFBFBD> 0
|
||||
WORD left;
|
||||
WORD top;
|
||||
WORD width;
|
||||
WORD height;
|
||||
char colorBits;
|
||||
char desc;
|
||||
};
|
||||
|
||||
#define IMAGEDESC_ORIGIN_MASK 0x30
|
||||
#define IMAGEDESC_TOPLEFT 0x20
|
||||
#define IMAGEDESC_BOTLEFT 0x00
|
||||
#define IMAGEDESC_BOTRIGHT 0x10
|
||||
#define IMAGEDESC_TOPRIGHT 0x30
|
||||
|
||||
#pragma pack()
|
||||
|
||||
class CTargaImage
|
||||
{
|
||||
public:
|
||||
CTargaImage();
|
||||
~CTargaImage();
|
||||
|
||||
void Create(int x, int y);
|
||||
char * GetBasePointer(int line = 0);
|
||||
bool Save(const char * filename);
|
||||
|
||||
protected:
|
||||
TGA_HEADER m_header;
|
||||
char * m_pbuf;
|
||||
int m_x, m_y;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user