-
Notifications
You must be signed in to change notification settings - Fork 2
/
Savefile.h
44 lines (37 loc) · 1023 Bytes
/
Savefile.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
// savefile.h
//
#ifndef savefile_h
#define savefile_h
#include "list.h"
#include "common.h"
#define RBUFF_MAXLEN 4096
#define rle_code 0x0f
class savefile
{ private:
HANDLE sfile;
unsigned long rbufflen;
unsigned long rbuffptr;
byte rbuff[RBUFF_MAXLEN+1];
bool rbhigh;
bool rlemode;
bool rlestart;
byte rlecount;
byte rlebyte;
private:
bool getnibble(byte *n);
bool getrlenibble(byte *n);
bool putnibble(byte n);
bool flushnibble(void);
bool putrlenibble(byte n);
bool flushrlenibble(void);
public:
savefile();
~savefile();
bool sopen(LPCTSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,
DWORD dwCreationDistribution,DWORD dwFlagsAndAttributes);
void sclose(void);
bool sread(LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead);
bool swrite(LPCVOID lpBuffer,DWORD nNumberOfBytesToWrite);
bool flushfilewrite(void);
};
#endif