Ares
Static Public Member Functions | Static Public Attributes

CSFLoader Class Reference

#include <src/Misc/CSFLoader.h>

List of all members.

Static Public Member Functions

static void LoadAdditionalCSF (const char *fileName)

Static Public Attributes

static int CSFCount = 0
static int NextValueIndex = 0

Member Function Documentation

void CSFLoader::LoadAdditionalCSF ( const char *  fileName) [static]
{
        //The main stringtable must have been loaded (memory allocation)
        //To do that, use StringTable::LoadFile.
        if(StringTable::is_Loaded() && pFileName && *pFileName) {
                CCFileClass* pFile;
                GAME_ALLOC(CCFileClass, pFile, pFileName);
                if(pFile->Exists(NULL) && pFile->Open(eFileMode::Read)) {
                        CSFHeader header;

                        if(pFile->ReadBytes(&header, sizeof(CSFHeader)) == sizeof(CSFHeader)) {
                                if(header.Signature == CSF_SIGNATURE &&
                                        header.CSFVersion >= 2 &&
                                        header.Language == StringTable::get_Language()) //should stay in one language
                                {
                                        ++CSFCount;
                                        StringTable::ReadFile(pFileName); //must be modified to do the rest ;)

                                        qsort(
                                                StringTable::get_Labels(),
                                                StringTable::get_LabelCount(),
                                                sizeof(CSFLabel),
                                                (int (__cdecl *)(const void *,const void *))_strcmpi);
                                }
                        }
                }
                GAME_DEALLOC(pFile);
        }
};

Member Data Documentation

int CSFLoader::CSFCount = 0 [static]
int CSFLoader::NextValueIndex = 0 [static]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines