#include <stdio.h>
#include <string.h>
#include "../../common/platform.h"
#include "../../common/common_utils.h"
#include "../../string/wtstring.h"
#include "../../memory/memory.h"
#include "../../loaders/wav.h"
#include "../../loaders/tga.h"
#include "../../image/image.h"
#include "../../image/hq2x.h"
#include "../../image/scalebit.h"

Data Structures | |
| struct | PageList_t |
| struct | t_compshape |
Functions | |
| PUBLIC wtBoolean | PageFile_Setup (const char *pagefname, W32 *nBlocks, W32 *SpriteStart, W32 *SoundStart) |
| Setup page file for decoding. | |
| PUBLIC void | PageFile_Shutdown (void) |
| Shutdown page cache. | |
| PRIVATE void | PageFile_ReadFromFile (W8 *buf, SW32 offset, W32 length) |
| Reads in data from Page file. | |
| PUBLIC void * | PageFile_getPage (W32 pagenum, W32 *length) |
| Get Page file raw data. | |
| PUBLIC void * | PageFile_decodeWall_RGB24 (W8 *data, W8 *palette) |
| Decodes raw wall data into RGB-24. | |
| PUBLIC void * | PageFile_decodeWall_RGB32 (W8 *data, W8 *palette) |
| Decodes raw wall data into RGB-32. | |
| PUBLIC void * | PageFile_decodeSprite_RGB24 (W8 *data, W8 *palette) |
| Decodes raw sprite data into RGB-24. | |
| PUBLIC void * | PageFile_decodeSprite_RGB32 (W8 *data, W8 *palette) |
| Decodes raw sprite data into RGB32. | |
| PUBLIC wtBoolean | PageFile_ReduxDecodePageData (const char *vsfname, const char *wallPath, const char *spritePath, const char *soundPath, W32 scaleFilter, W8 *palette) |
| Redux the Page file data. | |
Variables | |
| PUBLIC const W32 | SAMPLERATE = 7000 |
| wtBoolean | _saveAudioAsWav |
| PRIVATE PageList_t * | PMPages = NULL |
| PRIVATE FILE * | file_handle_page = NULL |
| PUBLIC void* PageFile_decodeSprite_RGB24 | ( | W8 * | data, | |
| W8 * | palette | |||
| ) |
Decodes raw sprite data into RGB-24.
| [in] | data | Raw sprite data. |
| [in] | palette | Palette array. |
| PUBLIC void* PageFile_decodeSprite_RGB32 | ( | W8 * | data, | |
| W8 * | palette | |||
| ) |
Decodes raw sprite data into RGB32.
| [in] | data | Raw sprite data. |
| [in] | palette | Palette array. |

| PUBLIC void* PageFile_decodeWall_RGB24 | ( | W8 * | data, | |
| W8 * | palette | |||
| ) |
Decodes raw wall data into RGB-24.
| [in] | data | Raw wall data. |
| [in] | palette | Palette array. |
| PUBLIC void* PageFile_decodeWall_RGB32 | ( | W8 * | data, | |
| W8 * | palette | |||
| ) |
Decodes raw wall data into RGB-32.
| [in] | data | Raw wall data. |
| [in] | palette | Palette array. |

| PUBLIC void* PageFile_getPage | ( | W32 | pagenum, | |
| W32 * | length | |||
| ) |
Get Page file raw data.
| [in] | pagenum | Page to load. |
| [in] | length | Length of data. |


| PRIVATE void PageFile_ReadFromFile | ( | W8 * | buf, | |
| SW32 | offset, | |||
| W32 | length | |||
| ) |
Reads in data from Page file.
| [out] | buf | Storage location for data. |
| [in] | offset | Number of bytes from beginning of file. |
| [in] | length | Maximum number of items to be read. |

| PUBLIC wtBoolean PageFile_ReduxDecodePageData | ( | const char * | vsfname, | |
| const char * | wallPath, | |||
| const char * | spritePath, | |||
| const char * | soundPath, | |||
| W32 | scaleFilter, | |||
| W8 * | palette | |||
| ) |
Redux the Page file data.
| [in] | vsfname | data file name. |
| [in] | wallPath | Path to save wall data. |
| [in] | spritePath | Path to save sprite data. |
| [in] | soundPath | Path to save sound data. |
| [in] | scaleFilter | Scale images [0 = Original, 1 = Scale2x, 2 = hq2x]. |
| [in] | palette | Palette array. |


| PUBLIC wtBoolean PageFile_Setup | ( | const char * | pagefname, | |
| W32 * | nBlocks, | |||
| W32 * | SpriteStart, | |||
| W32 * | SoundStart | |||
| ) |
Setup page file for decoding.
| [in] | pagefname | Source buffer to convert from |
| [out] | nBlocks | Destination buffer to convert to. |
| [out] | SpriteStart | Offset index for sprite data. |
| [out] | SoundStart | Offset index for sound data. |

