C client: Fix schematic converter

This commit is contained in:
UnknownShadow200 2018-09-27 13:03:40 +10:00
parent 5f8254eb8a
commit a3a4143baa
3 changed files with 11 additions and 11 deletions

View File

@ -67,7 +67,7 @@ struct InflateState {
void Inflate_Init(struct InflateState* state, struct Stream* source);
void Inflate_Process(struct InflateState* state);
void Inflate_MakeStream(struct Stream* stream, struct InflateState* state, struct Stream* underlying);
NOINLINE_ void Inflate_MakeStream(struct Stream* stream, struct InflateState* state, struct Stream* underlying);
#define DEFLATE_BUFFER_SIZE 16384
@ -89,10 +89,10 @@ struct DeflateState {
UInt16 Prev[DEFLATE_BUFFER_SIZE];
bool WroteHeader;
};
void Deflate_MakeStream(struct Stream* stream, struct DeflateState* state, struct Stream* underlying);
NOINLINE_ void Deflate_MakeStream(struct Stream* stream, struct DeflateState* state, struct Stream* underlying);
struct GZipState { struct DeflateState Base; UInt32 Crc32, Size; };
void GZip_MakeStream(struct Stream* stream, struct GZipState* state, struct Stream* underlying);
NOINLINE_ void GZip_MakeStream(struct Stream* stream, struct GZipState* state, struct Stream* underlying);
struct ZLibState { struct DeflateState Base; UInt32 Adler32; };
void ZLib_MakeStream(struct Stream* stream, struct ZLibState* state, struct Stream* underlying);
NOINLINE_ void ZLib_MakeStream(struct Stream* stream, struct ZLibState* state, struct Stream* underlying);
#endif

View File

@ -1002,14 +1002,14 @@ ReturnCode Schematic_Save(struct Stream* stream) {
Stream_SetU16_BE(&tmp[63], World_Length);
Stream_SetU32_BE(&tmp[74], World_BlocksSize);
}
if ((res = Stream_Write(stream, sc_begin, sizeof(sc_begin)))) return res;
if ((res = Stream_Write(stream, tmp, sizeof(sc_begin)))) return res;
if ((res = Stream_Write(stream, World_Blocks, World_BlocksSize))) return res;
Mem_Copy(tmp, sc_data, sizeof(sc_data));
{
Stream_SetU32_BE(&tmp[7], World_BlocksSize);
}
if ((res = Stream_Write(stream, sc_data, sizeof(sc_data)))) return res;
if ((res = Stream_Write(stream, tmp, sizeof(sc_data)))) return res;
UInt8 chunk[8192] = { 0 };
Int32 i;

View File

@ -37,12 +37,12 @@ void Stream_Init(struct Stream* stream);
ReturnCode Stream_Skip(struct Stream* stream, UInt32 count);
ReturnCode Stream_DefaultReadU8(struct Stream* stream, UInt8* data);
void Stream_FromFile(struct Stream* stream, void* file);
NOINLINE_ void Stream_FromFile(struct Stream* stream, void* file);
/* Readonly Stream wrapping another Stream, only allows reading up to 'len' bytes from the wrapped stream. */
void Stream_ReadonlyPortion(struct Stream* stream, struct Stream* source, UInt32 len);
void Stream_ReadonlyMemory(struct Stream* stream, void* data, UInt32 len);
void Stream_WriteonlyMemory(struct Stream* stream, void* data, UInt32 len);
void Stream_ReadonlyBuffered(struct Stream* stream, struct Stream* source, void* data, UInt32 size);
NOINLINE_ void Stream_ReadonlyPortion(struct Stream* stream, struct Stream* source, UInt32 len);
NOINLINE_ void Stream_ReadonlyMemory(struct Stream* stream, void* data, UInt32 len);
NOINLINE_ void Stream_WriteonlyMemory(struct Stream* stream, void* data, UInt32 len);
NOINLINE_ void Stream_ReadonlyBuffered(struct Stream* stream, struct Stream* source, void* data, UInt32 size);
UInt16 Stream_GetU16_LE(UInt8* data);
UInt16 Stream_GetU16_BE(UInt8* data);