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 pathutils.h
32 lines (25 loc) · 1.68 KB
/
utils.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
#ifndef util_h
#define util_h
#include <fstream>
long ConvertInt16(unsigned char Byte1, unsigned char Byte2);
long ConvertInt24(unsigned char Byte1, unsigned char Byte2, unsigned char Byte3);
long ConvertInt32(unsigned char Byte1, unsigned char Byte2, unsigned char Byte3, unsigned char Byte4);
void WriteInt32(FILE *file, long val);
void WriteInt24(FILE *file, long val);
void WriteInt16(FILE *file, long val);
void WriteInt8(FILE *file, long val);
long getFileSize(FILE *file);
long getValAtAddress(unsigned char *buffer, long Address, int size);
int getValAtCoordinate(int x, int y, int BlockStart,unsigned char *buffer, int size);
int LoadShockFile(char *filePath,long fileSize, unsigned char *archive_ark);
long getShockBlockAddress(long BlockNo, unsigned char *tmp_ark, long *chunkPackedLength, long *chunkUnpackedLength, long *chunkType);
int LoadShockChunk(long AddressOfBlockStart, int chunkType, unsigned char *archive_ark, unsigned char *OutputChunk,long chunkPackedLength,long chunkUnpackedLength);
unsigned char* unpackUW2(unsigned char *tmp, int address_pointer, int *datalen);
void unpack_data(unsigned char *pack, unsigned char *unpack, unsigned long unpacksize);
long getShockBlockAddress(long BlockNo, unsigned char *tmp_ark, long *chunkPackedLength, long *chunkUnpackedLength, long *chunkType);
void RepackUW2(char InputFile[255], char OutputFile[255],int BlocksToUnpack);
unsigned char *get_rwops_uw2dec(unsigned char *buffer, unsigned int blocknum, int *datalen);
void RepackShock(char InputFile[255], char OutputFile[255]);
void ParseTerrainProperties(int game);
void getNoOfFramesForShockDoors(int index, int *NoOfFrames, int *ChunkId);
#endif /*util_h*/