Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DataLoader Class Reference

#include <DataLoader.h>

List of all members.

Public Types

enum  { DATAFILE_OK, DATAFILE_INVALID, DATAFILE_NOTEXIST }

Public Member Functions

 DataLoader ()
void Reset ()
void UseFileSystem (bool use=true)
void UseVideo (Video *v)
void EnableMedia (bool enable=true)
int EnableDatafile (const char *name)
int DisableDatafile (const char *name)
void SetDataPath (const char *path)
const char * GetDataPath () const
bool IsFileSystemEnabled () const
bool IsMediaLoadEnabled () const
bool FindFile (const char *fname)
int ListFiles (const char *filter, List< Text > &list, bool recurse=false)
int ListArchiveFiles (const char *archive, const char *filter, List< Text > &list)
int LoadBuffer (const char *name, BYTE *&buf, bool null_terminate=false, bool optional=false)
int LoadBitmap (const char *name, Bitmap &bmp, int type=0, bool optional=false)
int CacheBitmap (const char *name, Bitmap *&bmp, int type=0, bool optional=false)
int LoadTexture (const char *name, Bitmap *&bmp, int type=0, bool preload_cache=false, bool optional=false)
int LoadSound (const char *fname, Sound *&snd, DWORD flags=0, bool optional=false)
int LoadStream (const char *fname, Sound *&snd, bool optional=false)
void ReleaseBuffer (BYTE *&buf)
int fread (void *buffer, size_t size, size_t count, BYTE *&stream)

Static Public Member Functions

static const char * TYPENAME ()
static DataLoaderGetLoader ()
static void Initialize ()
static void Close ()

Detailed Description

Definition at line 26 of file DataLoader.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
DATAFILE_OK 
DATAFILE_INVALID 
DATAFILE_NOTEXIST 

Definition at line 31 of file DataLoader.h.


Constructor & Destructor Documentation

DataLoader::DataLoader ( )

Definition at line 33 of file DataLoader.cpp.


Member Function Documentation

int DataLoader::CacheBitmap ( const char *  name,
Bitmap *&  bmp,
int  type = 0,
bool  optional = false 
)

Definition at line 472 of file DataLoader.cpp.

void DataLoader::Close ( )
static

Definition at line 57 of file DataLoader.cpp.

int DataLoader::DisableDatafile ( const char *  name)

Definition at line 135 of file DataLoader.cpp.

int DataLoader::EnableDatafile ( const char *  name)

Definition at line 90 of file DataLoader.cpp.

void DataLoader::EnableMedia ( bool  enable = true)

Definition at line 82 of file DataLoader.cpp.

bool DataLoader::FindFile ( const char *  fname)

Definition at line 163 of file DataLoader.cpp.

int DataLoader::fread ( void *  buffer,
size_t  size,
size_t  count,
BYTE *&  stream 
)

Definition at line 452 of file DataLoader.cpp.

const char* DataLoader::GetDataPath ( ) const
inline

Definition at line 48 of file DataLoader.h.

static DataLoader* DataLoader::GetLoader ( )
inlinestatic

Definition at line 35 of file DataLoader.h.

void DataLoader::Initialize ( )
static

Definition at line 48 of file DataLoader.cpp.

bool DataLoader::IsFileSystemEnabled ( ) const
inline

Definition at line 50 of file DataLoader.h.

bool DataLoader::IsMediaLoadEnabled ( ) const
inline

Definition at line 51 of file DataLoader.h.

int DataLoader::ListArchiveFiles ( const char *  archive,
const char *  filter,
List< Text > &  list 
)

Definition at line 213 of file DataLoader.cpp.

int DataLoader::ListFiles ( const char *  filter,
List< Text > &  list,
bool  recurse = false 
)

Definition at line 196 of file DataLoader.cpp.

int DataLoader::LoadBitmap ( const char *  name,
Bitmap bmp,
int  type = 0,
bool  optional = false 
)

Definition at line 495 of file DataLoader.cpp.

int DataLoader::LoadBuffer ( const char *  name,
BYTE *&  buf,
bool  null_terminate = false,
bool  optional = false 
)

Definition at line 345 of file DataLoader.cpp.

int DataLoader::LoadSound ( const char *  fname,
Sound *&  snd,
DWORD  flags = 0,
bool  optional = false 
)

Definition at line 816 of file DataLoader.cpp.

int DataLoader::LoadStream ( const char *  fname,
Sound *&  snd,
bool  optional = false 
)

Definition at line 904 of file DataLoader.cpp.

int DataLoader::LoadTexture ( const char *  name,
Bitmap *&  bmp,
int  type = 0,
bool  preload_cache = false,
bool  optional = false 
)

Definition at line 521 of file DataLoader.cpp.

void DataLoader::ReleaseBuffer ( BYTE *&  buf)

Definition at line 463 of file DataLoader.cpp.

void DataLoader::Reset ( )

Definition at line 68 of file DataLoader.cpp.

void DataLoader::SetDataPath ( const char *  path)

Definition at line 152 of file DataLoader.cpp.

static const char* DataLoader::TYPENAME ( )
inlinestatic

Definition at line 29 of file DataLoader.h.

void DataLoader::UseFileSystem ( bool  use = true)

Definition at line 76 of file DataLoader.cpp.

void DataLoader::UseVideo ( Video v)

Definition at line 40 of file DataLoader.cpp.


The documentation for this class was generated from the following files: