ScEng::SceneLoad Class Reference

#include <fileio.h>

List of all members.

Public Types

enum  CHUNKS { CHUNK_HEADER_SIZE = 8 }
enum  LOADSTATE { LOAD_FAILED = 0, LOAD_OK = 1, LOAD_NO = 2 }

Public Member Functions

 SceneLoad (const char *filename)
 ~SceneLoad ()
 Destructor.
int OpenChunk ()
unsigned int CurChunkID ()
 Returns the current ChunkID.
void CloseChunk ()
 Closes the current chunk and moves to the next chunk.
void BackChunk ()
 Closes the current chunk and returns back to its begining so it can be opened again by another OpenChunk call.
bool Read (void *buf, unsigned short num_bytes, int &num_read_bytes)
void ReadString (std::string &the_string)
int Pos ()
 Please add comments here.
void PostLoad ()
 After all the blocks are loaded and their dependencies are set, this method is called to post process them.
void RegisterPostLoadCallback (PostLoadCallback *post_load_callback)

Public Attributes

std::vector< SEChunkInfolist_chunks_info
 Please add comments here.
int file_size
 The file size.
FILE * stream
 The stream to loads the file.


Detailed Description

Loads a SC file Please add comments here


Member Enumeration Documentation

enum ScEng::SceneLoad::CHUNKS

Enum Chunks Enums the Chunks used for this class

Enumerator:
CHUNK_HEADER_SIZE  8 bytes.4 bytes for ID and 4 bytes for chunk size

enum ScEng::SceneLoad::LOADSTATE

Enum LoadState Enums the possibles states for the Load operation

Enumerator:
LOAD_FAILED  There was an error loading and SceneEngine should be aborted!
LOAD_OK  Load OK
LOAD_NO  No more chunks to load in this level


Constructor & Destructor Documentation

ScEng::SceneLoad::SceneLoad ( const char *  filename  ) 

Constructor Opens the file stream, calculates the file´s size and inits the list_chunks_info


Member Function Documentation

int ScEng::SceneLoad::OpenChunk (  ) 

Opens a chunk

Returns:
LOAD_OK if the chunks was open correctly

LOAD_NO if there is no more chunks to be open

LOAD_FAILED if the file contains an error

bool ScEng::SceneLoad::Read ( void *  buf,
unsigned short  num_bytes,
int &  num_read_bytes 
)

Reads the file

Parameters:
buf the buffer to store the readed data
num_bytes the number of bytes to be readed
num_read_bytes Please add comments here

void ScEng::SceneLoad::ReadString ( std::string &  the_string  ) 

Reads a string

Parameters:
the_string the string to hold the data readed

void ScEng::SceneLoad::RegisterPostLoadCallback ( PostLoadCallback post_load_callback  ) 

After all the blocks are loaded and their dependencies are set, this method is called to post process them.

Parameters:
post_load_callback the PostLoadCallback that will be executed after the scene has been loaded.


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:22 2007 for SceneEngine by  doxygen 1.5.1-p1