aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-03-19 21:57:28 +0100
committerStrangerke2013-03-19 21:57:28 +0100
commitf2d4151dd7db6eb0bffc4874825b15e22f61a36f (patch)
tree7230054bc70197508067074e1b35c40ff6e427f7 /engines
parentdb6d7e256bd1a1654002005fec3524ddcd300c75 (diff)
downloadscummvm-rg350-f2d4151dd7db6eb0bffc4874825b15e22f61a36f.tar.gz
scummvm-rg350-f2d4151dd7db6eb0bffc4874825b15e22f61a36f.tar.bz2
scummvm-rg350-f2d4151dd7db6eb0bffc4874825b15e22f61a36f.zip
HOPKINS: Remove setParent() from FileManager
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/anim.cpp4
-rw-r--r--engines/hopkins/computer.cpp20
-rw-r--r--engines/hopkins/dialogs.cpp6
-rw-r--r--engines/hopkins/events.cpp10
-rw-r--r--engines/hopkins/files.cpp5
-rw-r--r--engines/hopkins/files.h3
-rw-r--r--engines/hopkins/font.cpp8
-rw-r--r--engines/hopkins/globals.cpp6
-rw-r--r--engines/hopkins/graphics.cpp16
-rw-r--r--engines/hopkins/hopkins.cpp29
-rw-r--r--engines/hopkins/hopkins.h2
-rw-r--r--engines/hopkins/lines.cpp2
-rw-r--r--engines/hopkins/objects.cpp42
-rw-r--r--engines/hopkins/script.cpp4
-rw-r--r--engines/hopkins/sound.cpp6
-rw-r--r--engines/hopkins/talk.cpp22
16 files changed, 91 insertions, 94 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index c21bb8ee01..2d66aeeaa9 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -502,7 +502,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
_vm->_globals.Bank[idx]._loadedFl = true;
_vm->_globals.Bank[idx]._filename = filename;
- byte *fileDataPtr = _vm->_fileManager.loadFile(filename);
+ byte *fileDataPtr = _vm->_fileManager->loadFile(filename);
_vm->_globals.Bank[idx]._fileHeader = 0;
if (fileDataPtr[1] == 'L' && fileDataPtr[2] == 'E')
@@ -543,7 +543,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
Common::File f;
if (f.exists(ofsFilename)) {
- byte *ofsData = _vm->_fileManager.loadFile(ofsFilename);
+ byte *ofsData = _vm->_fileManager->loadFile(ofsFilename);
byte *curOfsData = ofsData;
for (int objIdx = 0; objIdx < _vm->_globals.Bank[idx]._objDataIdx; ++objIdx, curOfsData += 8) {
int x1 = READ_LE_INT16(curOfsData);
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index 8bde4dc5e7..a9bc4880c1 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -83,7 +83,7 @@ void ComputerManager::setTextMode() {
Common::File f;
if (!f.exists(filename))
filename = "FONTE.SPR"; // Used by the BeOS and OS/2 versions as an alternative
- _vm->_fontManager._font = _vm->_fileManager.loadFile(filename);
+ _vm->_fontManager._font = _vm->_fileManager->loadFile(filename);
_vm->_fontManager._fontFixedWidth = 8;
_vm->_fontManager._fontFixedHeight = 8;
@@ -352,8 +352,8 @@ static const char _spanishText[] =
*/
void ComputerManager::loadMenu() {
char *ptr;
- if (_vm->_fileManager.fileExists("COMPUTAN.TXT")) {
- ptr = (char *)_vm->_fileManager.loadFile("COMPUTAN.TXT");
+ if (_vm->_fileManager->fileExists("COMPUTAN.TXT")) {
+ ptr = (char *)_vm->_fileManager->loadFile("COMPUTAN.TXT");
} else if (_vm->_globals._language == LANG_FR) {
ptr = (char *)_vm->_globals.allocMemory(sizeof(_frenchText));
strcpy(ptr, _frenchText);
@@ -468,7 +468,7 @@ void ComputerManager::outText2(const Common::String &msg) {
*/
void ComputerManager::restoreFBIRoom() {
_vm->_globals.freeMemory(_vm->_fontManager._font);
- _vm->_fontManager._font = _vm->_fileManager.loadFile("FONTE3.SPR");
+ _vm->_fontManager._font = _vm->_fileManager->loadFile("FONTE3.SPR");
_vm->_fontManager._fontFixedWidth = 12;
_vm->_fontManager._fontFixedHeight = 21;
@@ -489,8 +489,8 @@ void ComputerManager::readText(int idx) {
else if (_vm->_globals._language == LANG_SP)
filename = "THOPKES.TXT";
- byte *ptr = _vm->_fileManager.loadFile(filename);
- uint16 fileSize = _vm->_fileManager.fileSize(filename);
+ byte *ptr = _vm->_fileManager->loadFile(filename);
+ uint16 fileSize = _vm->_fileManager->fileSize(filename);
int pos;
for (pos = 0; pos < fileSize; pos++) {
if (ptr[pos] == '%') {
@@ -551,7 +551,7 @@ void ComputerManager::displayGamesSubMenu() {
_vm->_soundManager.loadSample(1, "SOUND37.WAV");
_vm->_soundManager.loadSample(2, "SOUND38.WAV");
_vm->_soundManager.loadSample(3, "SOUND39.WAV");
- _breakoutSpr = _vm->_fileManager.loadFile("CASSE.SPR");
+ _breakoutSpr = _vm->_fileManager->loadFile("CASSE.SPR");
loadHiscore();
setModeVGA256();
@@ -640,7 +640,7 @@ void ComputerManager::newLevel() {
}
f.close();
- _breakoutLevel = (int16 *)_vm->_fileManager.loadFile(file);
+ _breakoutLevel = (int16 *)_vm->_fileManager->loadFile(file);
displayBricks();
_vm->_objectsManager.addStaticSprite(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, false, 0, 0);
@@ -810,7 +810,7 @@ int ComputerManager::displayHiscores() {
_vm->_graphicsManager.resetDirtyRects();
loadHiscore();
_vm->_graphicsManager.loadVgaImage("HISCORE.PCX");
- byte *ptr = _vm->_fileManager.loadFile("ALPHA.SPR");
+ byte *ptr = _vm->_fileManager->loadFile("ALPHA.SPR");
_vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100);
@@ -863,7 +863,7 @@ void ComputerManager::getScoreName() {
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
- byte *ptr = _vm->_fileManager.loadFile("ALPHA.SPR");
+ byte *ptr = _vm->_fileManager->loadFile("ALPHA.SPR");
_vm->_graphicsManager.fadeInBreakout();
for (int strPos = 0; strPos <= 4; strPos++) {
displayHiscoreLine(ptr, 9 * strPos + 140, 78, 1);
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp
index 78ced9897e..05a7e72dc6 100644
--- a/engines/hopkins/dialogs.cpp
+++ b/engines/hopkins/dialogs.cpp
@@ -69,7 +69,7 @@ void DialogsManager::showOptionsDialog() {
filename = "OPTIES.SPR";
}
- _vm->_globals._optionDialogSpr = _vm->_fileManager.loadFile(filename);
+ _vm->_globals._optionDialogSpr = _vm->_fileManager->loadFile(filename);
_vm->_globals._optionDialogFl = true;
int scrollOffset = _vm->_graphicsManager._scrollOffset;
@@ -352,10 +352,10 @@ void DialogsManager::showInventory() {
size_t filesize = f.size();
_inventWin1 = _vm->_globals.allocMemory(filesize);
- _vm->_fileManager.readStream(f, _inventWin1, filesize);
+ _vm->_fileManager->readStream(f, _inventWin1, filesize);
f.close();
- _inventBuf2 = _vm->_fileManager.loadFile("INVENT2.SPR");
+ _inventBuf2 = _vm->_fileManager->loadFile("INVENT2.SPR");
_inventX = _vm->_graphicsManager._scrollOffset + 152;
_inventY = 114;
diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp
index 7732c4d386..af97e313a6 100644
--- a/engines/hopkins/events.cpp
+++ b/engines/hopkins/events.cpp
@@ -80,18 +80,18 @@ void EventsManager::initMouseData() {
switch (_vm->_globals._language) {
case LANG_EN:
if (!_mouseLinuxFl)
- _mouseCursor = _vm->_fileManager.loadFile("SOUAN.SPR");
+ _mouseCursor = _vm->_fileManager->loadFile("SOUAN.SPR");
else
- _mouseCursor = _vm->_fileManager.loadFile("LSOUAN.SPR");
+ _mouseCursor = _vm->_fileManager->loadFile("LSOUAN.SPR");
break;
case LANG_FR:
if (!_mouseLinuxFl)
- _mouseCursor = _vm->_fileManager.loadFile("SOUFR.SPR");
+ _mouseCursor = _vm->_fileManager->loadFile("SOUFR.SPR");
else
- _mouseCursor = _vm->_fileManager.loadFile("LSOUFR.SPR");
+ _mouseCursor = _vm->_fileManager->loadFile("LSOUFR.SPR");
break;
case LANG_SP:
- _mouseCursor = _vm->_fileManager.loadFile("SOUES.SPR");
+ _mouseCursor = _vm->_fileManager->loadFile("SOUES.SPR");
break;
}
}
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp
index 5a15c1d68d..1d63d16bd6 100644
--- a/engines/hopkins/files.cpp
+++ b/engines/hopkins/files.cpp
@@ -33,10 +33,7 @@
namespace Hopkins {
-FileManager::FileManager() {
-}
-
-void FileManager::setParent(HopkinsEngine *vm) {
+FileManager::FileManager(HopkinsEngine *vm) {
_vm = vm;
}
diff --git a/engines/hopkins/files.h b/engines/hopkins/files.h
index 461bd22bf2..f66910699a 100644
--- a/engines/hopkins/files.h
+++ b/engines/hopkins/files.h
@@ -41,8 +41,7 @@ class FileManager {
public:
HopkinsEngine *_vm;
- FileManager();
- void setParent(HopkinsEngine *vm);
+ FileManager(HopkinsEngine *vm);
bool fileExists(const Common::String &file);
byte *loadFile(const Common::String &file);
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 5de601a65f..38c69f4d9a 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -50,13 +50,13 @@ void FontManager::setParent(HopkinsEngine *vm) {
void FontManager::loadZoneText() {
switch (_vm->_globals._language) {
case LANG_EN:
- _zoneText = _vm->_fileManager.loadFile("ZONEAN.TXT");
+ _zoneText = _vm->_fileManager->loadFile("ZONEAN.TXT");
break;
case LANG_FR:
- _zoneText = _vm->_fileManager.loadFile("ZONE01.TXT");
+ _zoneText = _vm->_fileManager->loadFile("ZONE01.TXT");
break;
case LANG_SP:
- _zoneText = _vm->_fileManager.loadFile("ZONEES.TXT");
+ _zoneText = _vm->_fileManager->loadFile("ZONEES.TXT");
break;
}
}
@@ -90,7 +90,7 @@ void FontManager::clearAll() {
}
void FontManager::initData() {
- _font = _vm->_fileManager.loadFile("FONTE3.SPR");
+ _font = _vm->_fileManager->loadFile("FONTE3.SPR");
_fontFixedWidth = 12;
_fontFixedHeight = 21;
loadZoneText();
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 637ca236b2..6b2d36151e 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -316,7 +316,7 @@ void Globals::clearVBob() {
// Load Object
void Globals::loadObjects() {
- byte *data = _vm->_fileManager.loadFile("OBJET.DAT");
+ byte *data = _vm->_fileManager->loadFile("OBJET.DAT");
byte *srcP = data;
for (int idx = 0; idx < 300; ++idx) {
@@ -394,14 +394,14 @@ void Globals::setHidingUseCount(int idx) {
// Load Hiding Items
void Globals::loadHidingItems(const Common::String &file) {
resetHidingItems();
- byte *ptr = _vm->_fileManager.loadFile(file);
+ byte *ptr = _vm->_fileManager->loadFile(file);
Common::String filename = Common::String((const char *)ptr);
Common::File f;
if (!f.exists(filename))
return;
- byte *spriteData = _vm->_fileManager.loadFile(filename);
+ byte *spriteData = _vm->_fileManager->loadFile(filename);
_hidingItemData[1] = spriteData;
int curBufIdx = 60;
for (int i = 0; i <= 21; i++) {
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 241be7ede0..c81e20bdf3 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -199,7 +199,7 @@ void GraphicsManager::loadScreen(const Common::String &file) {
assert(!_videoPtr);
bool flag = true;
- if (_vm->_fileManager.searchCat(file, RES_PIC) == g_PTRNUL) {
+ if (_vm->_fileManager->searchCat(file, RES_PIC) == g_PTRNUL) {
if (!f.open(file))
error("loadScreen - %s", file.c_str());
@@ -1740,20 +1740,20 @@ void GraphicsManager::displayFont(byte *surface, const byte *spriteData, int xp,
void GraphicsManager::initScreen(const Common::String &file, int mode, bool initializeScreen) {
Common::String filename = file + ".ini";
- byte *ptr = _vm->_fileManager.searchCat(filename, RES_INI);
+ byte *ptr = _vm->_fileManager->searchCat(filename, RES_INI);
if (ptr == g_PTRNUL) {
- ptr = _vm->_fileManager.loadFile(filename);
+ ptr = _vm->_fileManager->loadFile(filename);
}
if (!mode) {
filename = file + ".spr";
_vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN);
if (initializeScreen) {
- _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.searchCat(filename, RES_SLI);
+ _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->searchCat(filename, RES_SLI);
if (_vm->_globals.SPRITE_ECRAN) {
- _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile(filename);
+ _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->loadFile(filename);
} else {
- _vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile("RES_SLI.RES");
+ _vm->_globals.SPRITE_ECRAN = _vm->_fileManager->loadFile("RES_SLI.RES");
}
}
}
@@ -1784,9 +1784,9 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
_vm->_globals._answerBuffer = _vm->_globals.freeMemory(_vm->_globals._answerBuffer);
filename = file + ".rep";
- byte *dataP = _vm->_fileManager.searchCat(filename, RES_REP);
+ byte *dataP = _vm->_fileManager->searchCat(filename, RES_REP);
if (dataP == g_PTRNUL)
- dataP = _vm->_fileManager.loadFile(filename);
+ dataP = _vm->_fileManager->loadFile(filename);
_vm->_globals._answerBuffer = dataP;
_vm->_objectsManager._forceZoneFl = true;
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 323682815e..628c8eb8d8 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -45,8 +45,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe
_dialogsManager = new DialogsManager(this);
_debugger = new Debugger(this);
_eventsManager = new EventsManager(this);
+ _fileManager = new FileManager(this);
- _fileManager.setParent(this);
_fontManager.setParent(this);
_globals.setParent(this);
_graphicsManager.setParent(this);
@@ -60,6 +60,7 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe
}
HopkinsEngine::~HopkinsEngine() {
+ delete _fileManager;
delete _eventsManager;
delete _debugger;
delete _dialogsManager;
@@ -103,7 +104,7 @@ Common::Error HopkinsEngine::run() {
_saveLoadManager.initSaves();
_globals.setConfig();
- _fileManager.initCensorship();
+ _fileManager->initCensorship();
initializeSystem();
if (!getIsDemo())
@@ -155,7 +156,7 @@ bool HopkinsEngine::runWin95Demo() {
_globals._speed = 3;
_graphicsManager.fadeOutLong();
_globals.iRegul = 1;
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
_objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
@@ -445,7 +446,7 @@ bool HopkinsEngine::runLinuxDemo() {
playIntro();
_globals.iRegul = 0;
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
_objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
@@ -809,7 +810,7 @@ bool HopkinsEngine::runFull() {
_graphicsManager.fadeOutLong();
}
_globals.iRegul = 0;
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
_objectsManager._mapCarPosX = _objectsManager._mapCarPosY = 0;
memset(_globals._saveData, 0, 2000);
@@ -1536,7 +1537,7 @@ bool HopkinsEngine::runFull() {
_globals._exitId = handleBaseMap(); // Handles the base map (non-Windows)
//_globals._exitId = WBASE(); // Handles the 3D Doom level (Windows)
_soundManager.stopSound();
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
_globals.iRegul = 0;
_graphicsManager._lineNbr = SCREEN_WIDTH;
@@ -1583,8 +1584,8 @@ void HopkinsEngine::initializeSystem() {
_eventsManager->initMouseData();
_fontManager.initData();
- _dialogsManager->_inventoryIcons = _fileManager.loadFile("ICONE.SPR");
- _objectsManager._headSprites = _fileManager.loadFile("TETE.SPR");
+ _dialogsManager->_inventoryIcons = _fileManager->loadFile("ICONE.SPR");
+ _objectsManager._headSprites = _fileManager->loadFile("TETE.SPR");
_eventsManager->setMouseOn();
_eventsManager->_mouseFl = false;
@@ -2196,7 +2197,7 @@ void HopkinsEngine::playEnding() {
_globals.iRegul = 0;
_globals._exitId = 300;
}
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
_globals.iRegul = 0;
}
@@ -2382,13 +2383,13 @@ void HopkinsEngine::loadCredits() {
byte *bufPtr;
switch (_globals._language) {
case LANG_EN:
- bufPtr = _fileManager.loadFile("CREAN.TXT");
+ bufPtr = _fileManager->loadFile("CREAN.TXT");
break;
case LANG_FR:
- bufPtr = _fileManager.loadFile("CREFR.TXT");
+ bufPtr = _fileManager->loadFile("CREFR.TXT");
break;
case LANG_SP:
- bufPtr = _fileManager.loadFile("CREES.TXT");
+ bufPtr = _fileManager->loadFile("CREES.TXT");
break;
default:
error("Unhandled language");
@@ -2750,7 +2751,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi
_globals._exitId = 0;
_globals._disableInventFl = true;
_soundManager.playSound(soundId);
- _globals.PERSO = _fileManager.loadFile("VAISSEAU.SPR");
+ _globals.PERSO = _fileManager->loadFile("VAISSEAU.SPR");
if (backgroundFilename.size())
_graphicsManager.loadImage(backgroundFilename);
@@ -2837,7 +2838,7 @@ void HopkinsEngine::handleOceanMaze(int16 curExitId, Common::String backgroundFi
_graphicsManager.fadeOutLong();
_objectsManager.removeSprite(0);
_objectsManager.clearScreen();
- _globals.PERSO = _fileManager.loadFile("PERSO.SPR");
+ _globals.PERSO = _fileManager->loadFile("PERSO.SPR");
_globals._characterType = 0;
}
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 8e90c3f369..3b1a18c9c1 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -147,10 +147,10 @@ public:
DialogsManager *_dialogsManager;
Debugger *_debugger;
EventsManager *_eventsManager;
+ FileManager *_fileManager;
FontManager _fontManager;
Globals _globals;
- FileManager _fileManager;
GraphicsManager _graphicsManager;
LinesManager _linesManager;
MenuManager _menuManager;
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 030cb1ec7c..1372520de6 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -111,7 +111,7 @@ void LinesManager::loadLines(const Common::String &file) {
resetLines();
_linesNumb = 0;
_lastLine = 0;
- byte *ptr = _vm->_fileManager.loadFile(file);
+ byte *ptr = _vm->_fileManager->loadFile(file);
for (int idx = 0; READ_LE_INT16((uint16 *)ptr + (idx * 5)) != -1; idx++) {
addLine(idx,
(Directions)READ_LE_INT16((uint16 *)ptr + (idx * 5)),
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index c4a7c11905..55a50dcf98 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -269,7 +269,7 @@ void ObjectsManager::removeObjectDataBuf() {
* Load Sprite from file
*/
byte *ObjectsManager::loadSprite(const Common::String &file) {
- return _vm->_fileManager.loadFile(file);
+ return _vm->_fileManager->loadFile(file);
}
/**
@@ -1665,7 +1665,7 @@ void ObjectsManager::loadZone(const Common::String &file) {
if (!f.exists(file))
error("File not found : %s", file.c_str());
- byte *ptr = _vm->_fileManager.loadFile(file);
+ byte *ptr = _vm->_fileManager->loadFile(file);
int bufId = 0;
int zoneLineIdx = 0;
int bobZoneIdx;
@@ -1733,7 +1733,7 @@ void ObjectsManager::handleCityMap() {
_vm->_linesManager.loadLines("PLAN.OB2");
_vm->_globals.loadHidingItems("PLAN.CA2");
loadZone("PLAN.ZO2");
- _spritePtr = _vm->_fileManager.loadFile("VOITURE.SPR");
+ _spritePtr = _vm->_fileManager->loadFile("VOITURE.SPR");
_vm->_animationManager->loadAnim("PLAN");
_vm->_graphicsManager.displayAllBob();
_vm->_graphicsManager.initScreen("PLAN", 2, false);
@@ -2115,7 +2115,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
_vm->_globals._saveData->_data[svField357] = 1;
loc = &_vm->_globals._saveData->_realHopkins;
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR");
_vm->_globals._characterType = 0;
addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 34, 190);
animateSprite(0);
@@ -2140,7 +2140,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
_vm->_globals._saveData->_data[svField357] = 0;
loc = &_vm->_globals._saveData->_samantha;
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("PSAMAN.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR");
_vm->_globals._characterType = 2;
addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->_zoomFactor, false, 20, 127);
animateSprite(0);
@@ -2531,9 +2531,9 @@ void ObjectsManager::OPTI_OBJET() {
int lastOpcodeResult = 1;
file = "OBJET1.ini";
- data = _vm->_fileManager.searchCat(file, RES_INI);
+ data = _vm->_fileManager->searchCat(file, RES_INI);
if (data == g_PTRNUL) {
- data = _vm->_fileManager.loadFile(file);
+ data = _vm->_fileManager->loadFile(file);
if (data == g_PTRNUL)
error("INI file %s not found", file.c_str());
}
@@ -2748,7 +2748,7 @@ void ObjectsManager::doActionBack(int idx) {
if (_curGestureFile != 1) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 1;
- _gestureBuf = _vm->_fileManager.loadFile("DOS.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("DOS.SPR");
}
switch (idx) {
@@ -2789,7 +2789,7 @@ void ObjectsManager::doActionRight(int idx) {
if (_curGestureFile != 3) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 3;
- _gestureBuf = _vm->_fileManager.loadFile("PROFIL.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("PROFIL.SPR");
}
switch (idx) {
@@ -2830,7 +2830,7 @@ void ObjectsManager::doActionDiagRight(int idx) {
if (_curGestureFile != 4) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 4;
- _gestureBuf = _vm->_fileManager.loadFile("3Q.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("3Q.SPR");
}
switch (idx) {
@@ -2871,7 +2871,7 @@ void ObjectsManager::doActionFront(int idx) {
if (_curGestureFile != 2) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 2;
- _gestureBuf = _vm->_fileManager.loadFile("FACE.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("FACE.SPR");
}
switch (idx) {
@@ -2894,7 +2894,7 @@ void ObjectsManager::doActionDiagLeft(int idx) {
if (_curGestureFile != 4) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 4;
- _gestureBuf = _vm->_fileManager.loadFile("3Q.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("3Q.SPR");
}
switch (idx) {
@@ -2935,7 +2935,7 @@ void ObjectsManager::doActionLeft(int idx) {
if (_curGestureFile != 3) {
_gestureBuf = _vm->_globals.freeMemory(_gestureBuf);
_curGestureFile = 3;
- _gestureBuf = _vm->_fileManager.loadFile("PROFIL.SPR");
+ _gestureBuf = _vm->_fileManager->loadFile("PROFIL.SPR");
}
switch (idx) {
@@ -3043,7 +3043,7 @@ int ObjectsManager::getBobFrameIndex(int idx) {
void ObjectsManager::loadLinkFile(const Common::String &file) {
Common::File f;
Common::String filename = file + ".LNK";
- byte *ptr = _vm->_fileManager.searchCat(filename, RES_LIN);
+ byte *ptr = _vm->_fileManager->searchCat(filename, RES_LIN);
size_t nbytes = _vm->_globals._catalogSize;
if (ptr == g_PTRNUL) {
if (!f.open(filename))
@@ -3053,7 +3053,7 @@ void ObjectsManager::loadLinkFile(const Common::String &file) {
ptr = _vm->_globals.allocMemory(nbytes);
if (g_PTRNUL == ptr)
error("INILINK");
- _vm->_fileManager.readStream(f, ptr, nbytes);
+ _vm->_fileManager->readStream(f, ptr, nbytes);
f.close();
}
if (!OBSSEUL) {
@@ -3064,12 +3064,12 @@ void ObjectsManager::loadLinkFile(const Common::String &file) {
Common::String filename2 = Common::String((const char *)ptr + 1000);
if (!filename2.empty()) {
- _vm->_globals._hidingItemData[1] = _vm->_fileManager.searchCat(filename2, RES_SLI);
+ _vm->_globals._hidingItemData[1] = _vm->_fileManager->searchCat(filename2, RES_SLI);
if (_vm->_globals._hidingItemData[1] || _vm->_globals._hidingItemData[1] == g_PTRNUL) {
- _vm->_globals._hidingItemData[1] = _vm->_fileManager.loadFile(filename2);
+ _vm->_globals._hidingItemData[1] = _vm->_fileManager->loadFile(filename2);
} else {
- _vm->_globals._hidingItemData[1] = _vm->_fileManager.loadFile("RES_SLI.RES");
+ _vm->_globals._hidingItemData[1] = _vm->_fileManager->loadFile("RES_SLI.RES");
}
int curDataCacheId = 60;
@@ -3783,17 +3783,17 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
if (_vm->_globals._characterType) {
if (!_vm->_globals._saveData->_data[svAlternateSpriteFl] && !_vm->_globals._saveData->_data[svField356]) {
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR");
_vm->_globals._characterType = 0;
}
}
if (!_vm->_globals._characterType && _vm->_globals._saveData->_data[svAlternateSpriteFl] == 1) {
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("HOPFEM.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR");
_vm->_globals._characterType = 1;
}
if (_vm->_globals._characterType != 2 && _vm->_globals._saveData->_data[svField356] == 1) {
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("PSAMAN.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("PSAMAN.SPR");
_vm->_globals._characterType = 2;
}
_vm->_globals.loadCharacterData();
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 57c48c534f..41870ee15c 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -948,7 +948,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 56:
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("HOPFEM.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("HOPFEM.SPR");
_vm->_globals._characterType = 1;
_vm->_globals._saveData->_data[svAlternateSpriteFl] = 1;
_vm->_globals.loadCharacterData();
@@ -958,7 +958,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 57:
- _vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR");
+ _vm->_globals.PERSO = _vm->_fileManager->loadFile("PERSO.SPR");
_vm->_globals._characterType = 0;
_vm->_globals._saveData->_data[svAlternateSpriteFl] = 0;
_vm->_globals.loadCharacterData();
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index c7025ec260..d7a6c81a51 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -520,7 +520,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
filename = Common::String::format("%s%d", prefix.c_str(), mappedFileNumber);
- if (!_vm->_fileManager.searchCat(filename + ".WAV", RES_VOI)) {
+ if (!_vm->_fileManager->searchCat(filename + ".WAV", RES_VOI)) {
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
filename = "ENG_VOI.RES";
// Win95 and Linux versions uses another set of names
@@ -533,7 +533,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
catPos = _vm->_globals._catalogPos;
catLen = _vm->_globals._catalogSize;
- } else if (!_vm->_fileManager.searchCat(filename + ".APC", RES_VOI)) {
+ } else if (!_vm->_fileManager->searchCat(filename + ".APC", RES_VOI)) {
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
filename = "ENG_VOI.RES";
// Win95 and Linux versions uses another set of names
@@ -546,7 +546,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode, bool dispTxtFl) {
catPos = _vm->_globals._catalogPos;
catLen = _vm->_globals._catalogSize;
- } else if (!_vm->_fileManager.searchCat(filename + ".RAW", RES_VOI)) {
+ } else if (!_vm->_fileManager->searchCat(filename + ".RAW", RES_VOI)) {
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
filename = "ENG_VOI.RES";
// Win95 and Linux versions uses another set of names
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 583e48db5c..05ad3e2190 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -58,11 +58,11 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
_vm->_graphicsManager._scrollStatus = 1;
bool oldDisableInventFl = _vm->_globals._disableInventFl;
_vm->_globals._disableInventFl = true;
- _characterBuffer = _vm->_fileManager.searchCat(filename, RES_PER);
+ _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
- _characterBuffer = _vm->_fileManager.loadFile(filename);
- _characterSize = _vm->_fileManager.fileSize(filename);
+ _characterBuffer = _vm->_fileManager->loadFile(filename);
+ _characterSize = _vm->_fileManager->fileSize(filename);
}
_vm->_globals._saveData->_data[svDialogField4] = 0;
@@ -79,7 +79,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
}
_dialogueMesgId1 = READ_LE_INT16((uint16 *)_characterBuffer + 40);
_paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110;
- _characterSprite = _vm->_fileManager.searchCat(spriteFilename, RES_SAN);
+ _characterSprite = _vm->_fileManager->searchCat(spriteFilename, RES_SAN);
if (_characterSprite) {
_characterSprite = _vm->_objectsManager.loadSprite(spriteFilename);
} else {
@@ -158,11 +158,11 @@ void TalkManager::startStaticCharacterDialogue(const Common::String &filename) {
// TODO: The original disables the mouse cursor here
bool oldDisableInventFl = _vm->_globals._disableInventFl;
_vm->_globals._disableInventFl = true;
- _characterBuffer = _vm->_fileManager.searchCat(filename, RES_PER);
+ _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
- _characterBuffer = _vm->_fileManager.loadFile(filename);
- _characterSize = _vm->_fileManager.fileSize(filename);
+ _characterBuffer = _vm->_fileManager->loadFile(filename);
+ _characterSize = _vm->_fileManager->fileSize(filename);
}
_vm->_globals._saveData->_data[svDialogField4] = 0;
@@ -978,11 +978,11 @@ void TalkManager::animateObject(const Common::String &filename) {
_vm->_objectsManager._zoneNum = -1;
_vm->_eventsManager->_mouseCursorId = 4;
_vm->_eventsManager->changeMouseCursor(0);
- _characterBuffer = _vm->_fileManager.searchCat(filename, RES_PER);
+ _characterBuffer = _vm->_fileManager->searchCat(filename, RES_PER);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
- _characterBuffer = _vm->_fileManager.loadFile(filename);
- _characterSize = _vm->_fileManager.fileSize(filename);
+ _characterBuffer = _vm->_fileManager->loadFile(filename);
+ _characterSize = _vm->_fileManager->fileSize(filename);
}
Common::String screenFilename;
Common::String spriteFilename;
@@ -994,7 +994,7 @@ void TalkManager::animateObject(const Common::String &filename) {
if (curScreenFilename == "NULL")
curScreenFilename = Common::String::format("IM%d", _vm->_globals._screenId);
- _characterSprite = _vm->_fileManager.searchCat(spriteFilename, RES_SAN);
+ _characterSprite = _vm->_fileManager->searchCat(spriteFilename, RES_SAN);
if (_characterSprite)
_characterSprite = _vm->_objectsManager.loadSprite(spriteFilename);
else