This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgamegraphics.h
88 lines (75 loc) · 5.22 KB
/
gamegraphics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef gamegraphics_h
#define gamegraphics_h
#define repeat_record_start 0
#define repeat_record 1
#define run_record 2
struct palette
{
unsigned char blue;
unsigned char green;
unsigned char red;
unsigned char reserved;
};
struct BitMapHeader {
unsigned short int bfType;
unsigned int bfSize;
unsigned short int bfReserved1;
unsigned short int bfReserved2;
unsigned int bfOffBits;
};
struct BitMapInfoHeader{
unsigned int biSize;
int biWidth;
int biHeight;
unsigned short int biPlanes;
unsigned short int biBitCount;
unsigned int biCompression;
unsigned int biSizeImage;
int biXPelsPerMeter;
int biYPelsPerMeter;
unsigned int biClrUsed;
unsigned int biClrImportant;
} ;
struct LGFontHeader {
unsigned char duh[76];
unsigned long dataoffset;
unsigned short width;
unsigned short height;
} ;
void extractTextureBitmap(int ImageCount, char filePathIn[255], char PaletteFile[255], int PaletteNo, int BitmapSize, int FileType, char OutFileName[255],char auxPalPath[255],int useTGA);
void extractPanels(int ImageCount, char filePathIn[255], char PaletteFile[255], int PaletteNo, int BitmapSize, int FileType, int game, char OutFileName[255], int useTGA);
void extractCrittersUW1(char fileAssoc[255], char fileCrit[255], char PaletteFile[255], int PaletteNo, int BitmapSize, int FileType, int game, int CritterNo, char OutFileName[255], int useTGA, int SkipFileOutput, int ItemId, int fileXX, int fileYY);
void extractCrittersUW2(char fileAssoc[255], char fileCrit[255], char PaletteFile[255], int PaletteNo, int BitmapSize, int FileType, int game, int CritterNo, char OutFileName[255], int useTGA, int SkipFileOutput);
void writeBMP(unsigned char *buffer, long Start, long SizeH, long SizeV, int index, palette *pal, char OutFileName[255]);
void writeBMPBW(unsigned char *bits, long Start, long SizeH, long SizeV, int index, palette *pal, char OutFileName[255]);
void writeTGA(unsigned char *bits, long Start, long SizeH, long SizeV, int index, palette *pal, char OutFileName[255], int Alpha);
void getPalette(char filePathPal[255], palette *pal, int paletteNo);
void getPaletteIndex(char filePathPal[255], palette *pal, int paletteNo);
void LoadAuxilaryPal(char auxpalPath[255], palette auxpal[16], palette gamepal[256], int PalIndex);
void copyNibbles(unsigned char *InputData, unsigned char *OutputData, int NoOfNibbles, int add_ptr);
int getcount(unsigned char *nibbles, int *addr_ptr, int size);
//void DecodeRLEBitmap(unsigned char *imageData, int datalen, int imageWidth, int imageHeight, unsigned char *outputImg, palette *auxpal, int index, int BitSize, char OutFileName[255]);
void DecodeRLEBitmap(unsigned char *imageData, int datalen, int imageWidth, int imageHeight, unsigned char *outputImg , int BitSize);
//void writeBMP4(unsigned char *bits, long Start, long SizeH, long SizeV, int index, palette auxpal[16], char OutFileName[255]);
int getNibble(unsigned char *nibbles, int *addr_ptr);
bool load_cuts_anim(char filePathIn[255], char filePathOut[255], int useTGA, bool ErrorHandling, int isAlpha);
void ua_image_decode_rle(unsigned char *FileIn, unsigned char *pixels, unsigned int bits, unsigned int datalen, unsigned int maxpix, int addr_ptr, unsigned char *auxpal);
void extractUW2Bitmaps(char filePathIn[255],char PaletteFile[255],int PaletteNo,char OutFileName[255], int useTGA);
void ExtractShockGraphics(char GraphicsFile[255], char PaletteFile[255], int PaletteChunk, char OutFileName[255], int useTGA);
void ExtractShockCutscenes(char GraphicsFile[255], char PaletteFile[255], int PaletteChunk, char OutFileName[255], int useTGA);
void ExtractShockFont(char GraphicsFile[255], char PaletteFile[255], int PaletteChunk, char OutFileName[255], int useTGA);
int LoadShockPal(palette *pal, char PaletteFile[255], int PaletteNo);
void UncompressBitmap(unsigned char *chunk_bits, unsigned char *bits, int numbits);
//void WriteShockBitmaps(unsigned char *art_ark, palette *pal,int index, int textureOffset, char OutFileName[255], int useTGA);
void WriteShockBitmaps(unsigned char *art_ark, palette *pal, int index, int textureOffset, char OutFileName[255], int useTGA, int isCutscene);
void WriteShockFont(unsigned char *art_ark, palette *pal, int index, int textureOffset, char OutFileName[255], int useTGA, int Width, int Height, int isColour);
void WriteShockCutsceneBitmaps(unsigned char *KeyFrame, unsigned char *art_ark, palette *pal,int index, int textureOffset, char OutFileName[255], int useTGA);
//void ApplyKeyFrame(unsigned char *keyframe,unsigned char *output,int BitMapSize);
void cyclePalette(palette *pal, int Start, int length);
void copyPalette(palette *inPal, palette *outPal);
void extractAllCrittersUW1(char fileAssoc[255], char CritPath[255], char PaletteFile[255], int game, int useTGA);
void extractAllCrittersUW2(char fileAssoc[255], char CritPath[255], char PaletteFile[255], int game, int useTGA);
bool PrintAnimName(int game, int animNo);
void PrintCritAngle(int angle);
void ExtractWeaponAnimations(int ImageCount, char filePathIn[255], char PaletteFile[255], int PaletteNo, int BitmapSize, int FileType, char OutFileName[255], char auxPalPath[255], char animFile[255], int useTGA ,int game);
#endif /*gamegraphics_h*/