#include <fileio.h>
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< SEChunkInfo > | list_chunks_info |
| Please add comments here. | |
| int | file_size |
| The file size. | |
| FILE * | stream |
| The stream to loads the file. | |
Enum LoadState Enums the possibles states for the Load operation
| 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 |
| ScEng::SceneLoad::SceneLoad | ( | const char * | filename | ) |
Constructor Opens the file stream, calculates the file´s size and inits the list_chunks_info
| int ScEng::SceneLoad::OpenChunk | ( | ) |
Opens a chunk
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
| 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
| 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.
| post_load_callback | the PostLoadCallback that will be executed after the scene has been loaded. |
1.5.1-p1