mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 09:49:11 +00:00
WINTERMUTE: Rename FuncName->funcName in BFileManager
This commit is contained in:
parent
95983fa2ea
commit
caa5ee1d89
@ -124,7 +124,7 @@ CAdActor::~CAdActor() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdActor::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdActor::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -1268,7 +1268,7 @@ HRESULT CAdActor::MergeAnims(const char *AnimsFilename) {
|
||||
TOKEN_TABLE_END
|
||||
|
||||
|
||||
byte *FileBuffer = Game->_fileManager->ReadWholeFile(AnimsFilename);
|
||||
byte *FileBuffer = Game->_fileManager->readWholeFile(AnimsFilename);
|
||||
if (FileBuffer == NULL) {
|
||||
Game->LOG(0, "CAdActor::MergeAnims failed for file '%s'", AnimsFilename);
|
||||
return E_FAIL;
|
||||
|
@ -85,7 +85,7 @@ CAdEntity::~CAdEntity() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdEntity::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdEntity::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -1115,7 +1115,7 @@ HRESULT CAdGame::showCursor() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdGame::LoadFile(const char *Filename) {
|
||||
byte *Buffer = _fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = _fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdGame::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -1385,7 +1385,7 @@ HRESULT CAdGame::GetVersion(byte *VerMajor, byte *VerMinor, byte *ExtMajor, byt
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdGame::LoadItemsFile(const char *Filename, bool Merge) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdGame::LoadItemsFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -1919,16 +1919,16 @@ char *CAdGame::FindSpeechFile(char *StringID) {
|
||||
|
||||
for (int i = 0; i < _speechDirs.GetSize(); i++) {
|
||||
sprintf(Ret, "%s%s.ogg", _speechDirs[i], StringID);
|
||||
Common::SeekableReadStream *File = _fileManager->OpenFile(Ret);
|
||||
Common::SeekableReadStream *File = _fileManager->openFile(Ret);
|
||||
if (File) {
|
||||
_fileManager->CloseFile(File);
|
||||
_fileManager->closeFile(File);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
sprintf(Ret, "%s%s.wav", _speechDirs[i], StringID);
|
||||
File = _fileManager->OpenFile(Ret);
|
||||
File = _fileManager->openFile(Ret);
|
||||
if (File) {
|
||||
_fileManager->CloseFile(File);
|
||||
_fileManager->closeFile(File);
|
||||
return Ret;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ HRESULT CAdInventoryBox::display() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdInventoryBox::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdInventoryBox::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -85,7 +85,7 @@ CAdItem::~CAdItem() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdItem::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdItem::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -62,7 +62,7 @@ CAdLayer::~CAdLayer() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdLayer::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdLayer::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -55,7 +55,7 @@ CAdRegion::~CAdRegion() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRegion::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdRegion::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -188,7 +188,7 @@ HRESULT CAdResponseBox::CreateButtons() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdResponseBox::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdResponseBox::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -54,7 +54,7 @@ CAdRotLevel::~CAdRotLevel() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdRotLevel::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdRotLevel::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -52,7 +52,7 @@ CAdScaleLevel::~CAdScaleLevel() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScaleLevel::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdScaleLevel::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -504,7 +504,7 @@ HRESULT CAdScene::InitLoop() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdScene::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdScene::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -251,9 +251,9 @@ HRESULT CAdSentence::SetupTalkFile(const char *SoundFilename) {
|
||||
|
||||
AnsiString talkDefFileName = PathUtil::Combine(path, name + ".talk");
|
||||
|
||||
Common::SeekableReadStream *file = Game->_fileManager->OpenFile(talkDefFileName.c_str());
|
||||
Common::SeekableReadStream *file = Game->_fileManager->openFile(talkDefFileName.c_str());
|
||||
if (file) {
|
||||
Game->_fileManager->CloseFile(file);
|
||||
Game->_fileManager->closeFile(file);
|
||||
} else return S_OK; // no talk def file found
|
||||
|
||||
|
||||
|
@ -59,7 +59,7 @@ CAdSpriteSet::~CAdSpriteSet() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdSpriteSet::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdSpriteSet::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -70,7 +70,7 @@ CAdTalkDef::~CAdTalkDef() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdTalkDef::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdTalkDef::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -65,7 +65,7 @@ void CAdWaypointGroup::cleanup() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CAdWaypointGroup::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CAdWaypointGroup::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -63,8 +63,8 @@ namespace WinterMute {
|
||||
CBFileManager::CBFileManager(CBGame *inGame): CBBase(inGame) {
|
||||
_basePath = NULL;
|
||||
|
||||
InitPaths();
|
||||
RegisterPackages();
|
||||
initPaths();
|
||||
registerPackages();
|
||||
}
|
||||
|
||||
|
||||
@ -118,11 +118,11 @@ HRESULT CBFileManager::cleanup() {
|
||||
|
||||
#define MAX_FILE_SIZE 10000000
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
byte *CBFileManager::ReadWholeFile(const Common::String &Filename, uint32 *Size, bool MustExist) {
|
||||
byte *CBFileManager::readWholeFile(const Common::String &Filename, uint32 *Size, bool MustExist) {
|
||||
|
||||
byte *buffer = NULL;
|
||||
|
||||
Common::SeekableReadStream *File = OpenFile(Filename);
|
||||
Common::SeekableReadStream *File = openFile(Filename);
|
||||
if (!File) {
|
||||
if (MustExist) Game->LOG(0, "Error opening file '%s'", Filename.c_str());
|
||||
return NULL;
|
||||
@ -140,20 +140,20 @@ byte *CBFileManager::ReadWholeFile(const Common::String &Filename, uint32 *Size,
|
||||
buffer = new byte[File->size() + 1];
|
||||
if (buffer == NULL) {
|
||||
Game->LOG(0, "Error allocating buffer for file '%s' (%d bytes)", Filename.c_str(), File->size() + 1);
|
||||
CloseFile(File);
|
||||
closeFile(File);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (File->read(buffer, File->size()) != File->size()) {
|
||||
Game->LOG(0, "Error reading file '%s'", Filename.c_str());
|
||||
CloseFile(File);
|
||||
closeFile(File);
|
||||
delete [] buffer;
|
||||
return NULL;
|
||||
};
|
||||
|
||||
buffer[File->size()] = '\0';
|
||||
if (Size != NULL) *Size = File->size();
|
||||
CloseFile(File);
|
||||
closeFile(File);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
@ -165,7 +165,7 @@ Common::SeekableReadStream *CBFileManager::loadSaveGame(const Common::String &fi
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::SaveFile(const Common::String &Filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
|
||||
HRESULT CBFileManager::saveFile(const Common::String &Filename, byte *Buffer, uint32 BufferSize, bool Compressed, byte *PrefixBuffer, uint32 PrefixSize) {
|
||||
// TODO
|
||||
warning("Implement SaveFile");
|
||||
|
||||
@ -228,7 +228,7 @@ HRESULT CBFileManager::SaveFile(const Common::String &Filename, byte *Buffer, ui
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::RequestCD(int CD, char *PackageFile, char *Filename) {
|
||||
HRESULT CBFileManager::requestCD(int CD, char *PackageFile, char *Filename) {
|
||||
// unmount all non-local packages
|
||||
for (int i = 0; i < _packages.GetSize(); i++) {
|
||||
if (_packages[i]->_cD > 0) _packages[i]->close();
|
||||
@ -240,7 +240,7 @@ HRESULT CBFileManager::RequestCD(int CD, char *PackageFile, char *Filename) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::AddPath(TPathType Type, const Common::String &Path) {
|
||||
HRESULT CBFileManager::addPath(TPathType Type, const Common::String &Path) {
|
||||
if (Path.c_str() == NULL || strlen(Path.c_str()) < 1) return E_FAIL;
|
||||
|
||||
bool slashed = (Path[Path.size() - 1] == '\\' || Path[Path.size() - 1] == '/');
|
||||
@ -265,7 +265,7 @@ HRESULT CBFileManager::AddPath(TPathType Type, const Common::String &Path) {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::ReloadPaths() {
|
||||
HRESULT CBFileManager::reloadPaths() {
|
||||
// delete registered paths
|
||||
for (int i = 0; i < _singlePaths.GetSize(); i++)
|
||||
delete [] _singlePaths[i];
|
||||
@ -275,14 +275,14 @@ HRESULT CBFileManager::ReloadPaths() {
|
||||
delete [] _packagePaths[i];
|
||||
_packagePaths.RemoveAll();
|
||||
|
||||
return InitPaths();
|
||||
return initPaths();
|
||||
}
|
||||
|
||||
|
||||
#define TEMP_BUFFER_SIZE 32768
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::InitPaths() {
|
||||
RestoreCurrentDir();
|
||||
HRESULT CBFileManager::initPaths() {
|
||||
restoreCurrentDir();
|
||||
|
||||
AnsiString pathList;
|
||||
int numPaths;
|
||||
@ -294,16 +294,16 @@ HRESULT CBFileManager::InitPaths() {
|
||||
for (int i = 0; i < numPaths; i++) {
|
||||
char *path = CBUtils::StrEntry(i, pathList.c_str(), ';');
|
||||
if (path && strlen(path) > 0) {
|
||||
AddPath(PATH_SINGLE, path);
|
||||
addPath(PATH_SINGLE, path);
|
||||
}
|
||||
delete[] path;
|
||||
path = NULL;
|
||||
}
|
||||
AddPath(PATH_SINGLE, ".\\");
|
||||
addPath(PATH_SINGLE, ".\\");
|
||||
|
||||
|
||||
// package files paths
|
||||
AddPath(PATH_PACKAGE, "./");
|
||||
addPath(PATH_PACKAGE, "./");
|
||||
|
||||
/*#ifdef __APPLE__
|
||||
// search .app path and Resources dir in the bundle
|
||||
@ -338,20 +338,20 @@ HRESULT CBFileManager::InitPaths() {
|
||||
for (int i = 0; i < numPaths; i++) {
|
||||
char *path = CBUtils::StrEntry(i, pathList.c_str(), ';');
|
||||
if (path && strlen(path) > 0) {
|
||||
AddPath(PATH_PACKAGE, path);
|
||||
addPath(PATH_PACKAGE, path);
|
||||
}
|
||||
delete[] path;
|
||||
path = NULL;
|
||||
}
|
||||
AddPath(PATH_PACKAGE, "data");
|
||||
addPath(PATH_PACKAGE, "data");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::RegisterPackages() {
|
||||
RestoreCurrentDir();
|
||||
HRESULT CBFileManager::registerPackages() {
|
||||
restoreCurrentDir();
|
||||
|
||||
Game->LOG(0, "Scanning packages...");
|
||||
warning("Scanning packages");
|
||||
@ -360,7 +360,7 @@ HRESULT CBFileManager::RegisterPackages() {
|
||||
SearchMan.listMatchingMembers(files, "*.dcp");
|
||||
|
||||
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
|
||||
RegisterPackage((*it)->getName().c_str());
|
||||
registerPackage((*it)->getName().c_str());
|
||||
}
|
||||
#if 0
|
||||
AnsiString extension = AnsiString(PACKAGE_EXTENSION);
|
||||
@ -398,7 +398,7 @@ HRESULT CBFileManager::RegisterPackages() {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::RegisterPackage(const Common::String &Filename , bool SearchSignature) {
|
||||
HRESULT CBFileManager::registerPackage(const Common::String &Filename , bool SearchSignature) {
|
||||
// FILE *f = fopen(Filename, "rb");
|
||||
Common::File *package = new Common::File();
|
||||
package->open(Filename);
|
||||
@ -412,7 +412,7 @@ HRESULT CBFileManager::RegisterPackage(const Common::String &Filename , bool Sea
|
||||
|
||||
if (SearchSignature) {
|
||||
uint32 Offset;
|
||||
if (!FindPackageSignature(package, &Offset)) {
|
||||
if (!findPackageSignature(package, &Offset)) {
|
||||
delete package;
|
||||
return S_OK;
|
||||
} else {
|
||||
@ -524,7 +524,7 @@ HRESULT CBFileManager::RegisterPackage(const Common::String &Filename , bool Sea
|
||||
return S_OK;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::RegisterPackage(const char *Path, const char *Name, bool SearchSignature) {
|
||||
HRESULT CBFileManager::registerPackage(const char *Path, const char *Name, bool SearchSignature) {
|
||||
// TODO
|
||||
error("Implement RegisterPackage, this is the old one");
|
||||
#if 0
|
||||
@ -657,7 +657,7 @@ HRESULT CBFileManager::RegisterPackage(const char *Path, const char *Name, bool
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBFileManager::IsValidPackage(const AnsiString &fileName) const {
|
||||
bool CBFileManager::isValidPackage(const AnsiString &fileName) const {
|
||||
AnsiString plainName = PathUtil::GetFileNameWithoutExtension(fileName);
|
||||
|
||||
// check for device-type specific packages
|
||||
@ -668,7 +668,7 @@ bool CBFileManager::IsValidPackage(const AnsiString &fileName) const {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::File *CBFileManager::OpenPackage(const Common::String &Name) {
|
||||
Common::File *CBFileManager::openPackage(const Common::String &Name) {
|
||||
//TODO: Is it really necessary to do this when we have the ScummVM-system?
|
||||
|
||||
//RestoreCurrentDir();
|
||||
@ -696,8 +696,8 @@ Common::File *CBFileManager::OpenPackage(const Common::String &Name) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::File *CBFileManager::OpenSingleFile(const Common::String &Name) {
|
||||
RestoreCurrentDir();
|
||||
Common::File *CBFileManager::openSingleFile(const Common::String &Name) {
|
||||
restoreCurrentDir();
|
||||
|
||||
Common::File *ret = NULL;
|
||||
char Filename[MAX_PATH];
|
||||
@ -721,8 +721,8 @@ Common::File *CBFileManager::OpenSingleFile(const Common::String &Name) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBFileManager::GetFullPath(const Common::String &filename, char *Fullname) {
|
||||
RestoreCurrentDir();
|
||||
bool CBFileManager::getFullPath(const Common::String &filename, char *Fullname) {
|
||||
restoreCurrentDir();
|
||||
|
||||
Common::File f;
|
||||
bool found = false;
|
||||
@ -751,7 +751,7 @@ bool CBFileManager::GetFullPath(const Common::String &filename, char *Fullname)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBFileEntry *CBFileManager::GetPackageEntry(const Common::String &Filename) {
|
||||
CBFileEntry *CBFileManager::getPackageEntry(const Common::String &Filename) {
|
||||
char *upc_name = new char[strlen(Filename.c_str()) + 1];
|
||||
strcpy(upc_name, Filename.c_str());
|
||||
CBPlatform::strupr(upc_name);
|
||||
@ -767,7 +767,7 @@ CBFileEntry *CBFileManager::GetPackageEntry(const Common::String &Filename) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::SeekableReadStream *CBFileManager::OpenFile(const Common::String &filename, bool AbsPathWarning, bool keepTrackOf) {
|
||||
Common::SeekableReadStream *CBFileManager::openFile(const Common::String &filename, bool AbsPathWarning, bool keepTrackOf) {
|
||||
if (strcmp(filename.c_str(), "") == 0) return NULL;
|
||||
//Game->LOG(0, "open file: %s", Filename);
|
||||
/*#ifdef __WIN32__
|
||||
@ -780,14 +780,14 @@ Common::SeekableReadStream *CBFileManager::OpenFile(const Common::String &filena
|
||||
}
|
||||
#endif*/
|
||||
|
||||
Common::SeekableReadStream *File = OpenFileRaw(filename);
|
||||
Common::SeekableReadStream *File = openFileRaw(filename);
|
||||
if (File && keepTrackOf) _openFiles.Add(File);
|
||||
return File;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::CloseFile(Common::SeekableReadStream *File) {
|
||||
HRESULT CBFileManager::closeFile(Common::SeekableReadStream *File) {
|
||||
for (int i = 0; i < _openFiles.GetSize(); i++) {
|
||||
if (_openFiles[i] == File) {
|
||||
delete _openFiles[i];
|
||||
@ -800,8 +800,8 @@ HRESULT CBFileManager::CloseFile(Common::SeekableReadStream *File) {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::SeekableReadStream *CBFileManager::OpenFileRaw(const Common::String &Filename) {
|
||||
RestoreCurrentDir();
|
||||
Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &Filename) {
|
||||
restoreCurrentDir();
|
||||
|
||||
if (scumm_strnicmp(Filename.c_str(), "savegame:", 9) == 0) {
|
||||
CBSaveThumbFile *SaveThumbFile = new CBSaveThumbFile(Game);
|
||||
@ -829,7 +829,7 @@ Common::SeekableReadStream *CBFileManager::OpenFileRaw(const Common::String &Fil
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::RestoreCurrentDir() {
|
||||
HRESULT CBFileManager::restoreCurrentDir() {
|
||||
if (!_basePath) return S_OK;
|
||||
else {
|
||||
/*if (!chdir(_basePath)) return S_OK;
|
||||
@ -841,7 +841,7 @@ HRESULT CBFileManager::RestoreCurrentDir() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFileManager::SetBasePath(const Common::String &Path) {
|
||||
HRESULT CBFileManager::setBasePath(const Common::String &Path) {
|
||||
cleanup();
|
||||
|
||||
if (Path.c_str()) {
|
||||
@ -849,15 +849,15 @@ HRESULT CBFileManager::SetBasePath(const Common::String &Path) {
|
||||
strcpy(_basePath, Path.c_str());
|
||||
}
|
||||
|
||||
InitPaths();
|
||||
RegisterPackages();
|
||||
initPaths();
|
||||
registerPackages();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBFileManager::FindPackageSignature(Common::File *f, uint32 *Offset) {
|
||||
bool CBFileManager::findPackageSignature(Common::File *f, uint32 *Offset) {
|
||||
byte buf[32768];
|
||||
|
||||
byte Signature[8];
|
||||
|
@ -42,29 +42,29 @@ namespace WinterMute {
|
||||
class CBFile;
|
||||
class CBFileManager: CBBase {
|
||||
public:
|
||||
bool FindPackageSignature(Common::File *f, uint32 *Offset);
|
||||
bool findPackageSignature(Common::File *f, uint32 *Offset);
|
||||
HRESULT cleanup();
|
||||
HRESULT SetBasePath(const Common::String &path);
|
||||
HRESULT RestoreCurrentDir();
|
||||
HRESULT setBasePath(const Common::String &path);
|
||||
HRESULT restoreCurrentDir();
|
||||
char *_basePath;
|
||||
bool GetFullPath(const Common::String &filename, char *fullname);
|
||||
Common::SeekableReadStream *OpenFileRaw(const Common::String &filename);
|
||||
HRESULT CloseFile(Common::SeekableReadStream *File);
|
||||
Common::SeekableReadStream *OpenFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true);
|
||||
CBFileEntry *GetPackageEntry(const Common::String &filename);
|
||||
Common::File *OpenSingleFile(const Common::String &name);
|
||||
Common::File *OpenPackage(const Common::String &name);
|
||||
HRESULT RegisterPackages();
|
||||
HRESULT InitPaths();
|
||||
HRESULT ReloadPaths();
|
||||
bool getFullPath(const Common::String &filename, char *fullname);
|
||||
Common::SeekableReadStream *openFileRaw(const Common::String &filename);
|
||||
HRESULT closeFile(Common::SeekableReadStream *File);
|
||||
Common::SeekableReadStream *openFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true);
|
||||
CBFileEntry *getPackageEntry(const Common::String &filename);
|
||||
Common::File *openSingleFile(const Common::String &name);
|
||||
Common::File *openPackage(const Common::String &name);
|
||||
HRESULT registerPackages();
|
||||
HRESULT initPaths();
|
||||
HRESULT reloadPaths();
|
||||
typedef enum {
|
||||
PATH_PACKAGE, PATH_SINGLE
|
||||
} TPathType;
|
||||
HRESULT AddPath(TPathType Type, const Common::String &path);
|
||||
HRESULT RequestCD(int CD, char *PackageFile, char *Filename);
|
||||
HRESULT addPath(TPathType Type, const Common::String &path);
|
||||
HRESULT requestCD(int CD, char *PackageFile, char *Filename);
|
||||
Common::SeekableReadStream *loadSaveGame(const Common::String &filename);
|
||||
HRESULT SaveFile(const Common::String &filename, byte *Buffer, uint32 BufferSize, bool Compressed = false, byte *PrefixBuffer = NULL, uint32 PrefixSize = 0);
|
||||
byte *ReadWholeFile(const Common::String &filename, uint32 *Size = NULL, bool MustExist = true);
|
||||
HRESULT saveFile(const Common::String &filename, byte *Buffer, uint32 BufferSize, bool Compressed = false, byte *PrefixBuffer = NULL, uint32 PrefixSize = 0);
|
||||
byte *readWholeFile(const Common::String &filename, uint32 *Size = NULL, bool MustExist = true);
|
||||
CBFileManager(CBGame *inGame = NULL);
|
||||
virtual ~CBFileManager();
|
||||
CBArray<char *, char *> _singlePaths;
|
||||
@ -74,10 +74,10 @@ public:
|
||||
|
||||
Common::HashMap<Common::String, CBFileEntry *> _files;
|
||||
private:
|
||||
HRESULT RegisterPackage(const char *Path, const char *Name, bool SearchSignature = false);
|
||||
HRESULT RegisterPackage(const Common::String &filename, bool SearchSignature = false);
|
||||
HRESULT registerPackage(const char *Path, const char *Name, bool SearchSignature = false);
|
||||
HRESULT registerPackage(const Common::String &filename, bool SearchSignature = false);
|
||||
Common::HashMap<Common::String, CBFileEntry *>::iterator _filesIter;
|
||||
bool IsValidPackage(const AnsiString &fileName) const;
|
||||
bool isValidPackage(const AnsiString &fileName) const;
|
||||
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ int CBFont::GetTextWidth(byte *text, int MaxLenght) {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFont::LoadFile(const char * Filename)
|
||||
{
|
||||
BYTE* Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
BYTE* Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if(Buffer==NULL){
|
||||
Game->LOG(0, "CBFont::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -187,7 +187,7 @@ bool CBFont::IsTrueType(CBGame *Game, const char *Filename) {
|
||||
TOKEN_TABLE_END
|
||||
|
||||
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) return false;
|
||||
|
||||
byte *WorkBuffer = Buffer;
|
||||
|
@ -246,7 +246,7 @@ void CBFontBitmap::DrawChar(byte c, int x, int y) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontBitmap::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -405,7 +405,7 @@ int CBFontTT::GetLetterHeight() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBFontTT::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBFontTT::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -637,11 +637,11 @@ void CBFontTT::AfterLoad() {
|
||||
HRESULT CBFontTT::InitFont() {
|
||||
if (!_fontFile) return E_FAIL;
|
||||
|
||||
Common::SeekableReadStream *file = Game->_fileManager->OpenFile(_fontFile);
|
||||
Common::SeekableReadStream *file = Game->_fileManager->openFile(_fontFile);
|
||||
if (!file) {
|
||||
// the requested font file is not in wme file space; try loading a system font
|
||||
AnsiString fontFileName = PathUtil::Combine(CBPlatform::GetSystemFontPath(), PathUtil::GetFileName(_fontFile));
|
||||
file = Game->_fileManager->OpenFile(fontFileName.c_str(), false);
|
||||
file = Game->_fileManager->openFile(fontFileName.c_str(), false);
|
||||
if (!file) {
|
||||
Game->LOG(0, "Error loading TrueType font '%s'", _fontFile);
|
||||
//return E_FAIL;
|
||||
@ -682,7 +682,7 @@ HRESULT CBFontTT::InitFont() {
|
||||
error = FT_Open_Face(Game->_fontStorage->GetFTLibrary(), &args, 0, &_fTFace);
|
||||
if (error) {
|
||||
SAFE_DELETE_ARRAY(_fTStream);
|
||||
Game->_fileManager->CloseFile(file);
|
||||
Game->_fileManager->closeFile(file);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@ -745,7 +745,7 @@ void CBFontTT::FTCloseProc(FT_Stream stream) {
|
||||
|
||||
CBGame *Game = f->Game;
|
||||
|
||||
Game->_fileManager->CloseFile(f);
|
||||
Game->_fileManager->closeFile(f);
|
||||
stream->descriptor.pointer = NULL;
|
||||
}*/
|
||||
|
||||
|
@ -688,7 +688,7 @@ void CBGame::GetOffset(int *OffsetX, int *OffsetY) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBGame::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBGame::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -1728,10 +1728,10 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
Stack->CorrectParams(1);
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
|
||||
Common::SeekableReadStream *File = _fileManager->OpenFile(Filename, false);
|
||||
Common::SeekableReadStream *File = _fileManager->openFile(Filename, false);
|
||||
if (!File) Stack->PushBool(false);
|
||||
else {
|
||||
_fileManager->CloseFile(File);
|
||||
_fileManager->closeFile(File);
|
||||
Stack->PushBool(true);
|
||||
}
|
||||
return S_OK;
|
||||
@ -2082,7 +2082,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
const char *Filename = Stack->Pop()->GetString();
|
||||
bool AsHex = Stack->Pop()->GetBool(false);
|
||||
|
||||
Common::SeekableReadStream *File = _fileManager->OpenFile(Filename, false);
|
||||
Common::SeekableReadStream *File = _fileManager->openFile(Filename, false);
|
||||
if (File) {
|
||||
crc remainder = crc_initialize();
|
||||
byte Buf[1024];
|
||||
@ -2105,7 +2105,7 @@ HRESULT CBGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
|
||||
} else
|
||||
Stack->PushInt(checksum);
|
||||
|
||||
_fileManager->CloseFile(File);
|
||||
_fileManager->closeFile(File);
|
||||
File = NULL;
|
||||
} else Stack->PushNULL();
|
||||
|
||||
@ -3515,7 +3515,7 @@ HRESULT CBGame::LoadSettings(const char *Filename) {
|
||||
TOKEN_TABLE_END
|
||||
|
||||
|
||||
byte *OrigBuffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *OrigBuffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (OrigBuffer == NULL) {
|
||||
Game->LOG(0, "CBGame::LoadSettings failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -84,13 +84,13 @@ HRESULT CBImage::loadFile(const Common::String &filename) {
|
||||
error("CBImage::loadFile : Unsupported fileformat %s", filename.c_str());
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *file = Game->_fileManager->OpenFile(filename.c_str());
|
||||
Common::SeekableReadStream *file = Game->_fileManager->openFile(filename.c_str());
|
||||
if (!file) return E_FAIL;
|
||||
|
||||
_decoder->loadStream(*file);
|
||||
_surface = _decoder->getSurface();
|
||||
_palette = _decoder->getPalette();
|
||||
Game->_fileManager->CloseFile(file);
|
||||
Game->_fileManager->closeFile(file);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -87,10 +87,10 @@ HRESULT CBPackage::read(Common::SeekableReadStream *file, uint32 offset, byte *b
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::SeekableReadStream *CBPackage::GetFilePointer() {
|
||||
Common::File *file = Game->_fileManager->OpenPackage(_name);
|
||||
Common::File *file = Game->_fileManager->openPackage(_name);
|
||||
if (!file) {
|
||||
Game->_fileManager->RequestCD(_cD, _name, "");
|
||||
file = Game->_fileManager->OpenPackage(_name);
|
||||
Game->_fileManager->requestCD(_cD, _name, "");
|
||||
file = Game->_fileManager->openPackage(_name);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ HRESULT CBPersistMgr::readHeader(const Common::String &filename) {
|
||||
_saving = false;
|
||||
|
||||
_loadStream = g_system->getSavefileManager()->openForLoading(filename);
|
||||
//_buffer = Game->_fileManager->ReadWholeFile(Filename, &_bufferSize);
|
||||
//_buffer = Game->_fileManager->readWholeFile(Filename, &_bufferSize);
|
||||
if (_loadStream) {
|
||||
uint32 Magic;
|
||||
Magic = getDWORD();
|
||||
@ -348,7 +348,7 @@ HRESULT CBPersistMgr::initLoad(const char *filename) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBPersistMgr::saveFile(const char *filename) {
|
||||
return Game->_fileManager->SaveFile(filename, ((Common::MemoryWriteStreamDynamic *)_saveStream)->getData(), ((Common::MemoryWriteStreamDynamic *)_saveStream)->size(), Game->_compressedSavegames, _richBuffer, _richBufferSize);
|
||||
return Game->_fileManager->saveFile(filename, ((Common::MemoryWriteStreamDynamic *)_saveStream)->getData(), ((Common::MemoryWriteStreamDynamic *)_saveStream)->size(), Game->_compressedSavegames, _richBuffer, _richBufferSize);
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ bool CBRegion::PointInRegion(int X, int Y) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBRegion::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBRegion::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -77,7 +77,7 @@ CBSoundBuffer::~CBSoundBuffer() {
|
||||
}
|
||||
|
||||
if (_file) {
|
||||
Game->_fileManager->CloseFile(_file);
|
||||
Game->_fileManager->closeFile(_file);
|
||||
_file = NULL;
|
||||
}
|
||||
|
||||
@ -104,9 +104,9 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
|
||||
delete _stream;
|
||||
_stream = NULL;
|
||||
|
||||
if (_file) Game->_fileManager->CloseFile(_file);
|
||||
if (_file) Game->_fileManager->closeFile(_file);
|
||||
|
||||
_file = Game->_fileManager->OpenFile(Filename);
|
||||
_file = Game->_fileManager->openFile(Filename);
|
||||
if (!_file) {
|
||||
Game->LOG(0, "Error opening sound file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -146,7 +146,7 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
|
||||
bool NewlyCreated = false;
|
||||
|
||||
if(!_soundBuffer || ForceReload || _streamed){
|
||||
if(!_file) _file = Game->_fileManager->OpenFile(Filename);
|
||||
if(!_file) _file = Game->_fileManager->openFile(Filename);
|
||||
if(!_file){
|
||||
Game->LOG(0, "Error opening sound file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
@ -176,7 +176,7 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
|
||||
|
||||
// close file (if not streaming)
|
||||
if(!_streamed && _file){
|
||||
Game->_fileManager->CloseFile(_file);
|
||||
Game->_fileManager->closeFile(_file);
|
||||
_file = NULL;
|
||||
}
|
||||
*/
|
||||
|
@ -138,10 +138,10 @@ CBSoundBuffer *CBSoundMgr::addSound(const char *Filename, TSoundType Type, bool
|
||||
AnsiString name = PathUtil::GetFileNameWithoutExtension(Filename);
|
||||
|
||||
AnsiString newFile = PathUtil::Combine(path, name + "ogg");
|
||||
Common::SeekableReadStream *file = Game->_fileManager->OpenFile(newFile.c_str());
|
||||
Common::SeekableReadStream *file = Game->_fileManager->openFile(newFile.c_str());
|
||||
if (file) {
|
||||
Filename = newFile.c_str();
|
||||
Game->_fileManager->CloseFile(file);
|
||||
Game->_fileManager->closeFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,13 +123,13 @@ HRESULT CBSprite::Draw(int X, int Y, CBObject *Register, float ZoomX, float Zoom
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBSprite::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType CacheType) {
|
||||
Common::SeekableReadStream *File = Game->_fileManager->OpenFile(Filename);
|
||||
Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
|
||||
if (!File) {
|
||||
Game->LOG(0, "CBSprite::LoadFile failed for file '%s'", Filename);
|
||||
if (Game->_dEBUG_DebugMode) return LoadFile("invalid_debug.bmp", LifeTime, CacheType);
|
||||
else return LoadFile("invalid.bmp", LifeTime, CacheType);
|
||||
} else {
|
||||
Game->_fileManager->CloseFile(File);
|
||||
Game->_fileManager->closeFile(File);
|
||||
File = NULL;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ HRESULT CBSprite::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType
|
||||
ret = S_OK;
|
||||
}
|
||||
} else {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer) {
|
||||
if (FAILED(ret = LoadBuffer(Buffer, true, LifeTime, CacheType))) Game->LOG(0, "Error parsing SPRITE file '%s'", Filename);
|
||||
delete [] Buffer;
|
||||
|
@ -175,7 +175,7 @@ HRESULT CBStringTable::LoadFile(const char *Filename, bool ClearOld) {
|
||||
if (ClearOld) _strings.clear();
|
||||
|
||||
uint32 Size;
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename, &Size);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename, &Size);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CBStringTable::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -105,14 +105,14 @@ CBSurface *CBSurfaceStorage::addSurface(const char *Filename, bool default_ck, b
|
||||
}
|
||||
}
|
||||
|
||||
Common::SeekableReadStream *File = Game->_fileManager->OpenFile(Filename);
|
||||
Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
|
||||
if (!File) {
|
||||
if (Filename) Game->LOG(0, "Missing image: '%s'", Filename);
|
||||
if (Game->_dEBUG_DebugMode)
|
||||
return addSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
|
||||
else
|
||||
return addSurface("invalid.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
|
||||
} else Game->_fileManager->CloseFile(File);
|
||||
} else Game->_fileManager->closeFile(File);
|
||||
|
||||
|
||||
CBSurface *surface;
|
||||
|
@ -125,11 +125,11 @@ HRESULT CPartEmitter::addSprite(const char *Filename) {
|
||||
}
|
||||
|
||||
// check if file exists
|
||||
Common::SeekableReadStream *File = Game->_fileManager->OpenFile(Filename);
|
||||
Common::SeekableReadStream *File = Game->_fileManager->openFile(Filename);
|
||||
if (!File) {
|
||||
Game->LOG(0, "Sprite '%s' not found", Filename);
|
||||
return E_FAIL;
|
||||
} else Game->_fileManager->CloseFile(File);
|
||||
} else Game->_fileManager->closeFile(File);
|
||||
|
||||
char *Str = new char[strlen(Filename) + 1];
|
||||
strcpy(Str, Filename);
|
||||
|
@ -76,7 +76,7 @@ Common::SeekableReadStream *openPkgFile(const Common::String &Filename, CBFileMa
|
||||
if (fileName[i] == '/') fileName[i] = '\\';
|
||||
}
|
||||
|
||||
fileEntry = fileManager->GetPackageEntry(fileName);
|
||||
fileEntry = fileManager->getPackageEntry(fileName);
|
||||
if (!fileEntry) return NULL;
|
||||
|
||||
file = fileEntry->_package->GetFilePointer();
|
||||
|
@ -86,7 +86,7 @@ void CSXFile::cleanup() {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSXFile::Close() {
|
||||
if (_readFile) {
|
||||
Game->_fileManager->CloseFile(_readFile);
|
||||
Game->_fileManager->closeFile(_readFile);
|
||||
_readFile = NULL;
|
||||
}
|
||||
if ((FILE *)_writeFile) {
|
||||
@ -130,7 +130,7 @@ HRESULT CSXFile::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
|
||||
_mode = 1;
|
||||
}
|
||||
if (_mode == 1) {
|
||||
_readFile = Game->_fileManager->OpenFile(_filename);
|
||||
_readFile = Game->_fileManager->openFile(_filename);
|
||||
if (!_readFile) {
|
||||
//Script->RuntimeError("File.%s: Error opening file '%s' for reading.", Name, _filename);
|
||||
Close();
|
||||
@ -711,7 +711,7 @@ HRESULT CSXFile::persist(CBPersistMgr *persistMgr) {
|
||||
if (_mode != 0) {
|
||||
// open for reading
|
||||
if (_mode == 1) {
|
||||
_readFile = Game->_fileManager->OpenFile(_filename);
|
||||
_readFile = Game->_fileManager->openFile(_filename);
|
||||
if (!_readFile) Close();
|
||||
}
|
||||
// open for writing / appending
|
||||
|
@ -191,7 +191,7 @@ HRESULT CScEngine::cleanup() {
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
byte *WINAPI CScEngine::LoadFile(void *Data, char *Filename, uint32 *Size) {
|
||||
CBGame *Game = (CBGame *)Data;
|
||||
return Game->_fileManager->ReadWholeFile(Filename, Size);
|
||||
return Game->_fileManager->readWholeFile(Filename, Size);
|
||||
}
|
||||
|
||||
|
||||
@ -286,7 +286,7 @@ byte *CScEngine::GetCompiledScript(const char *Filename, uint32 *OutSize, bool I
|
||||
|
||||
uint32 Size;
|
||||
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename, &Size);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename, &Size);
|
||||
if (!Buffer) {
|
||||
Game->LOG(0, "CScEngine::GetCompiledScript - error opening script '%s'", Filename);
|
||||
return NULL;
|
||||
|
@ -96,7 +96,7 @@ CUIButton::~CUIButton() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIButton::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -95,7 +95,7 @@ CUIEdit::~CUIEdit() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEdit::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIEdit::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -56,7 +56,7 @@ CUIEntity::~CUIEntity() {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIEntity::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIEntity::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -96,7 +96,7 @@ HRESULT CUIText::display(int OffsetX, int OffsetY) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIText::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIText::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -120,7 +120,7 @@ HRESULT CUITiledImage::display(int X, int Y, int Width, int Height) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUITiledImage::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUITiledImage::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -201,7 +201,7 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CUIWindow::LoadFile(const char *Filename) {
|
||||
byte *Buffer = Game->_fileManager->ReadWholeFile(Filename);
|
||||
byte *Buffer = Game->_fileManager->readWholeFile(Filename);
|
||||
if (Buffer == NULL) {
|
||||
Game->LOG(0, "CUIWindow::LoadFile failed for file '%s'", Filename);
|
||||
return E_FAIL;
|
||||
|
@ -395,7 +395,7 @@ HRESULT CVidPlayer::loadSubtitles(const char *Filename, const char *SubtitleFile
|
||||
}
|
||||
|
||||
DWORD Size;
|
||||
BYTE *Buffer = Game->m_FileManager->ReadWholeFile(NewFile, &Size, false);
|
||||
BYTE *Buffer = Game->m_FileManager->readWholeFile(NewFile, &Size, false);
|
||||
if (Buffer == NULL) return S_OK; // no subtitles
|
||||
|
||||
|
||||
|
@ -132,7 +132,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo
|
||||
cleanup();
|
||||
|
||||
_filename = filename;
|
||||
_file = Game->_fileManager->OpenFile(filename, true, false);
|
||||
_file = Game->_fileManager->openFile(filename, true, false);
|
||||
if (!_file) return E_FAIL;
|
||||
|
||||
//if (Filename != _filename) CBUtils::SetString(&_filename, Filename);
|
||||
@ -159,7 +159,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo
|
||||
#if 0
|
||||
cleanup();
|
||||
|
||||
_file = Game->_fileManager->OpenFile(Filename);
|
||||
_file = Game->_fileManager->openFile(Filename);
|
||||
if (!_file) return E_FAIL;
|
||||
|
||||
if (Filename != _filename) CBUtils::SetString(&_filename, Filename);
|
||||
|
Loading…
Reference in New Issue
Block a user