Image file reader and writer, one subclass per file format.
Its RTTI descriptor lacks a base class. ABmpFile, ATgaFile, and AGifFile derive from it. The virtual function table pointer sits after the data members at offset 0x14, and the object is 0x18 bytes, the size AGifFile allocates with no added member.
The table has six slots. Slot 0 is the type function, and slots 1, 3, and 5 point at the shared pure virtual stub. Slot 2 and the destructor at slot 4 are inline, so every translation unit that needs the table emits its own copy of it, at 0x0083d218, 0x0083d928, and 0x0083fe28.
mFile and mDuration are written by the subclasses and mBounds by their header readers, so all three are protected. mUnreadWord is written only by Open() and SetUnreadWord(), and no reader of it was located.
| AGfxFile * AGfxFile::Open |
( |
const char * | pszPath, |
|
|
int * | pnError, |
|
|
bool | bRead ) |
|
static |
Open an image file and construct the reader for its extension.
The extension selects the class through GrabExt(): BMP, DIB, and RLE give ABmpFile, TGA gives ATgaFile, and GIF gives AGifFile. Each is allocated through the plain allocator and receives the open file.
An unrecognised extension retains the null result and then writes mDuration through it, dereferencing null. The open file is not closed. Write() is the one caller.
- Parameters
-
| pszPath | The file to open. |
| pnError | Receives kAGfxFileOk, or kAGfxFileOpenFailed when the file cannot be opened. |
| bRead | True to open for reading, false to open for writing. |
- Returns
- The reader, or null when the file cannot be opened.
- Ghidra address:
- NTSC-U/C: 0x005f9bc8
- Ghidra address:
- PAL: 0x0063a8d8