aboutsummaryrefslogtreecommitdiff
path: root/src/script.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.hh')
-rw-r--r--src/script.hh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/script.hh b/src/script.hh
index 0a83196..42ddd2e 100644
--- a/src/script.hh
+++ b/src/script.hh
@@ -101,4 +101,35 @@ struct TWriteScriptFile {
int Line;
};
+struct TReadBinaryFile: TReadStream {
+ // REGULAR FUNCTIONS
+ // =========================================================================
+ TReadBinaryFile(void);
+ void open(char *FileName);
+ int close(void);
+ void error(char *Text);
+ int getPosition(void);
+ int getSize(void);
+ void seek(int Offset);
+
+ // VIRTUAL FUNCTIONS
+ // =========================================================================
+ // TODO(fusion): `TReadStream` itself doesn't have a destructor on its VTABLE
+ // which makes me think there is something else going on here or the compiler
+ // optimized it away because it was never used but it seems problematic.
+ virtual ~TReadBinaryFile(void) override; // VTABLE[8]
+ // Duplicate destructor that also calls operator delete. // VTABLE[9]
+
+ uint8 readByte(void) override;
+ void readBytes(uint8 *Buffer, int Count) override;
+ bool eof(TReadBinaryFile *this) override;
+ void skip(int Count) override;
+
+ // DATA
+ // =========================================================================
+ FILE *File;
+ char Filename[4096];
+ int FileSize;
+};
+
#endif //TIBIA_SCRIPT_HH_