[ Home ]

wolfcore.h File Reference

Wolfenstein 3-D file decoder. More...

#include "../../common/platform.h"

Include dependency graph for wolfcore.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  parTimes_t
struct  picNum_t

Functions

wtBoolean GFXFile_Setup (char *dictfname, char *headfname, char *graphfname)
void GFXFile_Shutdown (void)
 Shutdown graphic files.
void GFXFile_cacheChunk (W32 chunkId)
 Load graphic chunk into memory.
void * GFXFile_getChunk (W32 chunkId)
 Get raw data.
void * GFXFile_decodeChunk_RGB24 (W32 chunkId, W32 *width_out, W32 *height_out, W8 *palette)
 Decode graphic chunk into RGB24 image data.
void * GFXFile_decodeChunk_RGB32 (W32 chunkId, W32 *width_out, W32 *height_out, W8 *palette)
 Decode graphic chunk into RGB32 image data.
void GFXFile_printPicTable (void)
 Prints out graphic header information [Used for debugging].
void GFXFile_decodeFont (W32 fontId, W32 font_width, W32 font_height, const char *path)
 Extract and save font as TGA file.
wtBoolean GFXFile_decodeScript (W32 textId_start, W32 textId_end, const char *path)
 Extract and save game script to file.
wtBoolean GFXFile_decodeGFX (W32 start, W32 end, W8 *palette, const char *path)
 Decode gfx data into TGA files.
wtBoolean PageFile_Setup (const char *pagefname, W32 *nBlocks, W32 *SpriteStart, W32 *SoundStart)
 Setup page file for decoding.
void PageFile_Shutdown (void)
 Shutdown page cache.
void * PageFile_getPage (W32 pagenum, W32 *length)
 Get Page file raw data.
void * PageFile_decodeWall (W8 *data, W8 *palette)
void * PageFile_decodeSprite (W8 *data, W8 *palette)
wtBoolean PageFile_ReduxDecodePageData (const char *vsfname, const char *wallPath, const char *spritePath, const char *soundPath, W32 bScale, W8 *palette)
 Redux the Page file data.
wtBoolean AudioFile_Setup (const char *aheadfname, const char *audfname)
 Setup for audio decoding.
void AudioFile_Shutdown (void)
 Shutdown audio decoder.
void * AudioFile_CacheAudioChunk (W32 chunk)
 Cache audio data.
void AudioFile_dataByteSwap (void *data, W32 length)
wtBoolean AudioFile_ReduxDecodeSound (W32 start, W32 end, const char *path)
 Decode sound fx.
wtBoolean AudioFile_ReduxDecodeMusic (W32 start, W32 end, const char *path, char *songNames[])
 Decode music chunks.
wtBoolean MapFile_ReduxDecodeMapData (const char *fmaphead, const char *fmap, const char *path, W8 *palette, W32 *ceilingColour, char *musicFileName[], parTimes_t *parTimes, char *format)
 Convert map to Redux file format.
void * wolfcore_ReduxGFX (W32 chunkid, void *data, W32 *width, W32 *height, W32 *ChunkChange, W8 *gamePalette, picNum_t *picNum)
 Scale and/or reassemble image chunks.

Variables

const W32 SAMPLERATE


Detailed Description

Wolfenstein 3-D file decoder.

Author:
Michael Liebscher
Date:
2007
Note:
Portion of this code was derived from Wolfenstein 3-D, and was originally written by Id Software, Inc.

Function Documentation

void* AudioFile_CacheAudioChunk ( W32  chunk  ) 

Cache audio data.

Parameters:
[in] chunk Id of chunk to cache.
Returns:
On success pointer to raw data, otherwise NULL.

Here is the caller graph for this function:

wtBoolean AudioFile_ReduxDecodeMusic ( W32  start,
W32  end,
const char *  path,
char *  songNames[] 
)

Decode music chunks.

Parameters:
[in] start Start of music chunks.
[in] end End of music chunks.
[in] songNames Song titles.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean AudioFile_ReduxDecodeSound ( W32  start,
W32  end,
const char *  path 
)

Decode sound fx.

Parameters:
[in] start Start of sound fx chunks.
[in] end End of sound fx chunks.
[in] path Directory path to save file to.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean AudioFile_Setup ( const char *  aheadfname,
const char *  audfname 
)

Setup for audio decoding.

Parameters:
[in] aheadfname Audio header file name.
[in] audfname Audio file name.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

void AudioFile_Shutdown ( void   ) 

Shutdown audio decoder.

Returns:
Nothing.

Here is the caller graph for this function:

void GFXFile_cacheChunk ( W32  chunkId  ) 

Load graphic chunk into memory.

Parameters:
[in] chunkId Chunk number to cache.
Returns:
On success the length of the chunk in bytes, otherwise -1.

Here is the call graph for this function:

Here is the caller graph for this function:

void* GFXFile_decodeChunk_RGB24 ( W32  chunkId,
W32 *  width_out,
W32 *  height_out,
W8 *  palette 
)

Decode graphic chunk into RGB24 image data.

Parameters:
[in] chunkId Graphic chunk to decode.
[out] width_out Width of image in pixels.
[out] height_out Height of image in pixels.
[in] palette Pointer to image palette (Must have 768 entries).
Returns:
Pointer to RGB24 image data on success, otherwise NULL.
Note:
Caller is responsible for freeing allocated data by calling MM_FREE()

Here is the caller graph for this function:

void* GFXFile_decodeChunk_RGB32 ( W32  chunkId,
W32 *  width_out,
W32 *  height_out,
W8 *  palette 
)

Decode graphic chunk into RGB32 image data.

Parameters:
[in] chunkId Graphic chunk to decode.
[out] width_out Width of image in pixels.
[out] height_out Height of image in pixels.
[in] palette Pointer to image palette (Must have 768 entries).
Returns:
Pointer to RGB32 image data on success, otherwise NULL.
Note:
Caller is responsible for freeing allocated data by calling MM_FREE()

Here is the caller graph for this function:

void GFXFile_decodeFont ( W32  fontId,
W32  font_width,
W32  font_height,
const char *  path 
)

Extract and save font as TGA file.

Parameters:
[in] fontId Font chunk to save.
[in] font_width Width of font slate in pixels.
[in] font_height Height of font slate in pixels.
[in] path Path to save font files to.
Returns:
Nothing.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean GFXFile_decodeGFX ( W32  start,
W32  end,
W8 *  palette,
const char *  path 
)

Decode gfx data into TGA files.

Parameters:
[in] start start offset.
[in] end end offset.
[in] palette Pointer to palette array.
[in] path Directory path to save files to.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean GFXFile_decodeScript ( W32  textId_start,
W32  textId_end,
const char *  path 
)

Extract and save game script to file.

Parameters:
[in] textId_start Text start identifier.
[in] textId_end Text end identifier.
[in] path Path to save script into.
Returns:
Nothing.

Here is the call graph for this function:

Here is the caller graph for this function:

void* GFXFile_getChunk ( W32  chunkId  ) 

Get raw data.

Parameters:
[in] chunkId Graphic chunk number.
Returns:
Pointer to raw data on success, otherwise NULL.

Here is the caller graph for this function:

wtBoolean MapFile_ReduxDecodeMapData ( const char *  fmaphead,
const char *  fmap,
const char *  path,
W8 *  palette,
W32 *  ceilingColour,
char *  musicFileName[],
parTimes_t *  parTimes,
char *  format 
)

Convert map to Redux file format.

Parameters:
[in] fmaphead Map header file name.
[in] fmap Map file name.
[in] path Path to save redux map to.
[in] palette Pointer to palette array.
[in] ceilingColour Array of ceiling colours.
[in] musicFileName Array of music titles.
[in] parTimes Struct with the parTimes.
Returns:
On success true, otherwise false.
Note:
Caller must free allocated data.

Here is the call graph for this function:

Here is the caller graph for this function:

void* PageFile_getPage ( W32  pagenum,
W32 *  length 
)

Get Page file raw data.

Parameters:
[in] pagenum Page to load.
[in] length Length of data.
Returns:
On success pointer to data block, otherwise NULL.
Note:
Caller is responsible for freeing allocated data by calling MM_FREE.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean PageFile_ReduxDecodePageData ( const char *  vsfname,
const char *  wallPath,
const char *  spritePath,
const char *  soundPath,
W32  scaleFilter,
W8 *  palette 
)

Redux the Page file data.

Parameters:
[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.
Returns:
On success true, otherwise false.
Note:
Caller is responsible for freeing allocated data by calling MM_FREE.

Here is the call graph for this function:

Here is the caller graph for this function:

wtBoolean PageFile_Setup ( const char *  pagefname,
W32 *  nBlocks,
W32 *  SpriteStart,
W32 *  SoundStart 
)

Setup page file for decoding.

Parameters:
[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.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

Here is the caller graph for this function:

void* wolfcore_ReduxGFX ( W32  chunkid,
void *  data,
W32 *  width,
W32 *  height,
W32 *  chunkChange,
W8 *  gamePalette,
picNum_t *  picNum 
)

Scale and/or reassemble image chunks.

Parameters:
[in] chunkid Chunk id of data.
[in] data Image data in the form RGB32.
[out] width Width of image in pixels.
[out] height Height of image in pixels.
[out] chunkChange Next iteration use this chunk id.
[out] gamePalette Palette to Redux image data with.
[out] picNum Image details.
Returns:
Image data on success, otherwise NULL.

Here is the call graph for this function:

Here is the caller graph for this function: