Sort include order.
[gemrb.git] / gemrb / plugins / TLKImporter / TlkOverride.h
blobde23e18bb81e538aad68fc2cc32aa9ff433114c6
1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 // TlkOverride.h: interface for the CTlkOverride class.
22 //////////////////////////////////////////////////////////////////////
24 #ifndef TLKOVERRIDE_H
25 #define TLKOVERRIDE_H
27 #include "globals.h"
29 #include "FileStream.h"
30 #include "Interface.h"
32 #ifdef CACHE_TLK_OVERRIDE
33 #include <map>
35 typedef std::map<ieStrRef, char *> StringMapType;
36 #endif
38 #define STRREF_START 300000
39 #define SEGMENT_SIZE 512
40 #define TOH_HEADER_SIZE 20
42 //the original games used these strings for custom biography (another quirk of the IE)
43 #define BIO_START 62016 //first BIO string
44 #define BIO_END (BIO_START+5) //last BIO string
46 typedef struct
48 ieDword strref;
49 ieByte dummy[20];
50 ieDword offset;
51 } EntryType;
53 class CTlkOverride
55 private:
56 #ifdef CACHE_TLK_OVERRIDE
57 StringMapType stringmap;
58 #endif
59 DataStream *tot_str;
60 DataStream *toh_str;
61 ieDword AuxCount;
62 ieDword FreeOffset;
64 void UpdateFreeOffset(ieDword NewFree);
65 void CloseResources();
66 DataStream *GetAuxHdr(bool create);
67 DataStream *GetAuxTlk(bool create);
68 ieStrRef GetNewStrRef();
69 ieDword LocateString(ieStrRef strref);
70 char* LocateString2(ieDword offset);
71 ieDword GetLength();
72 public:
73 CTlkOverride();
74 virtual ~CTlkOverride();
76 bool Init();
77 char *ResolveAuxString(ieStrRef strref, int &Length);
78 ieStrRef UpdateString(ieStrRef strref, const char *newvalue);
79 char *CS(const char *src);
82 #endif //TLKOVERRIDE_H