forked from cyxx/f2bgl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.h
46 lines (38 loc) · 1010 Bytes
/
file.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
/*
* Fade To Black engine rewrite
* Copyright (C) 2006-2012 Gregory Montoir ([email protected])
*/
#ifndef FILE_H__
#define FILE_H__
#include "util.h"
enum FileType {
kFileType_DATA = 0,
kFileType_SOUND,
kFileType_TEXT,
kFileType_VOICE,
kFileType_RUNTIME,
};
enum FileLanguage {
kFileLanguage_EN = 0,
kFileLanguage_FR,
kFileLanguage_GR,
kFileLanguage_SP,
kFileLanguage_IT,
};
enum FilePosition {
kFilePosition_CUR = 0,
kFilePosition_SET
};
extern bool g_isDemo;
bool fileInit(int language, int voice, const char *dataPath);
bool fileExists(const char *fileName, int fileType);
FILE *fileOpen(const char *fileName, int *fileSize, int fileType, bool errorIfNotFound = true);
void fileClose(FILE *fp);
void fileRead(FILE *fp, void *buf, int size);
uint8_t fileReadByte(FILE *fp);
uint16_t fileReadUint16LE(FILE *fp);
uint32_t fileReadUint32LE(FILE *fp);
uint32_t fileGetPos(FILE *fp);
void fileSetPos(FILE *fp, uint32_t pos, int origin);
int fileEof(FILE *fp);
#endif // __FILE_H__