Merge pull request #6 from bluegr/hopkins

Hopkins: More cleanup commits
This commit is contained in:
Strangerke 2013-01-07 11:07:33 -08:00
commit 823f99b19f
18 changed files with 833 additions and 1282 deletions

View File

@ -58,7 +58,13 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui
byte *screenP = _vm->_graphicsManager._vesaScreen;
byte *ptr = _vm->_globals.allocMemory(20);
_vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename);
// The Windows 95 demo only contains the interlaced version of the BOMBE1 and BOMBE2 videos
if (_vm->getPlatform() == Common::kPlatformWindows && _vm->getIsDemo() && filename == "BOMBE1A.ANM")
_vm->_fileManager.constructFilename("ANM", "BOMBE1.ANM");
else if (_vm->getPlatform() == Common::kPlatformWindows && _vm->getIsDemo() && filename == "BOMBE2A.ANM")
_vm->_fileManager.constructFilename("ANM", "BOMBE2.ANM");
else
_vm->_fileManager.constructFilename("ANM", filename);
if (!f.open(_vm->_globals._curFilename))
error("File not found - %s", _vm->_globals._curFilename.c_str());
@ -233,7 +239,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
screenP = _vm->_graphicsManager._vesaScreen;
ptr = _vm->_globals.allocMemory(20);
_vm->_fileManager.constructFilename(_vm->_globals.HOPANM, filename);
_vm->_fileManager.constructFilename("ANM", filename);
if (!f.open(_vm->_globals._curFilename))
error("Error opening file - %s", _vm->_globals._curFilename.c_str());
@ -470,7 +476,7 @@ void AnimationManager::loadAnim(const Common::String &animName) {
clearAnim();
Common::String filename = animName + ".ANI";
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);
_vm->_fileManager.constructFilename("ANIM", filename);
Common::File f;
if (!f.open(_vm->_globals._curFilename))
@ -495,7 +501,7 @@ void AnimationManager::loadAnim(const Common::String &animName) {
for (int idx = 0; idx <= 5; ++idx) {
if (files[idx][0]) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, files[idx]);
_vm->_fileManager.constructFilename("ANIM", files[idx]);
if (!f.exists(_vm->_globals._curFilename))
error("File not found");
@ -539,7 +545,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
byte *v13;
byte *v19;
int result = 0;
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);
_vm->_fileManager.constructFilename("ANIM", filename);
_vm->_globals.Bank[idx].field1C = _vm->_fileManager.fileSize(_vm->_globals._curFilename);
_vm->_globals.Bank[idx]._loadedFl = true;
_vm->_globals.Bank[idx]._filename = filename;
@ -581,7 +587,7 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) {
} while (ch != '.');
ofsFilename += ".OFS";
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, ofsFilename);
_vm->_fileManager.constructFilename("ANIM", ofsFilename);
Common::File f;
if (f.exists(_vm->_globals._curFilename)) {
v19 = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
@ -727,7 +733,7 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui
}
screenP = _vm->_graphicsManager._vesaScreen;
v10 = _vm->_globals.allocMemory(22);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file);
_vm->_fileManager.constructFilename("SEQ", file);
if (!f.open(_vm->_globals._curFilename))
error("Error opening file - %s", _vm->_globals._curFilename.c_str());
@ -883,7 +889,7 @@ void AnimationManager::playSequence2(const Common::String &file, uint32 rate1, u
_vm->_eventsManager._mouseFl = false;
screenP = _vm->_graphicsManager._vesaScreen;
v11 = _vm->_globals.allocMemory(22);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSEQ, file);
_vm->_fileManager.constructFilename("SEQ", file);
if (!f.open(_vm->_globals._curFilename))
error("File not found - %s", _vm->_globals._curFilename.c_str());

View File

@ -78,7 +78,7 @@ void ComputerManager::setTextMode() {
//SET_MODE(SCREEN_WIDTH, SCREEN_HEIGHT);
_vm->_graphicsManager._lineNbr = SCREEN_WIDTH;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "STFONT.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "STFONT.SPR");
_vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police);
_vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.police_l = 8;
@ -328,8 +328,8 @@ static char _frenchText[] =
*/
void ComputerManager::loadMenu() {
char *ptr;
if (!_vm->_fileManager.fileExists(_vm->_globals.HOPLINK, "COMPUTAN.TXT")) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "COMPUTAN.TXT");
if (_vm->_fileManager.fileExists("LINK", "COMPUTAN.TXT")) {
_vm->_fileManager.constructFilename("LINK", "COMPUTAN.TXT");
ptr = (char *)_vm->_fileManager.loadFile(_vm->_globals._curFilename);
} else if (_vm->_globals._language == LANG_FR) {
ptr = (char *)_vm->_globals.allocMemory(sizeof(_frenchText));
@ -445,7 +445,7 @@ void ComputerManager::outText2(const Common::String &msg) {
*/
void ComputerManager::restoreFBIRoom() {
_vm->_globals.police = _vm->_globals.freeMemory(_vm->_globals.police);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "FONTE3.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "FONTE3.SPR");
_vm->_globals.police = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.police_l = 12;
@ -460,11 +460,11 @@ void ComputerManager::readText(int idx) {
_vm->_eventsManager._escKeyFl = false;
if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPKAN.TXT");
_vm->_fileManager.constructFilename("LINK", "THOPKAN.TXT");
else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPK.TXT");
_vm->_fileManager.constructFilename("LINK", "THOPK.TXT");
else if (_vm->_globals._language == LANG_SP)
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "THOPKES.TXT");
_vm->_fileManager.constructFilename("LINK", "THOPKES.TXT");
byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
uint16 fileSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename);
@ -528,7 +528,7 @@ void ComputerManager::displayGamesSubMenu() {
_vm->_soundManager.loadSample(1, "SOUND37.WAV");
_vm->_soundManager.loadSample(2, "SOUND38.WAV");
_vm->_soundManager.loadSample(3, "SOUND39.WAV");
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "CASSE.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "CASSE.SPR");
_breakoutSpr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
loadHiscore();
setModeVGA256();
@ -615,7 +615,7 @@ void ComputerManager::newLevel() {
while (!_vm->shouldQuit()) {
file = Common::String::format("TAB%d.TAB", _breakoutLevelNbr);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, file);
_vm->_fileManager.constructFilename("SYSTEM", file);
if (f.open(_vm->_globals._curFilename))
break;
@ -789,7 +789,7 @@ int ComputerManager::displayHiscores() {
_vm->_graphicsManager.RESET_SEGMENT_VESA();
loadHiscore();
_vm->_graphicsManager.loadVgaImage("HISCORE.PCX");
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "ALPHA.SPR");
byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
@ -841,7 +841,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);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "ALPHA.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "ALPHA.SPR");
byte *ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_graphicsManager.fadeInBreakout();
for (int strPos = 0; strPos <= 4; strPos++) {

View File

@ -60,11 +60,11 @@ void DialogsManager::showOptionsDialog() {
_vm->_eventsManager.changeMouseCursor(0);
_vm->_eventsManager.VBL();
if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIFR.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "OPTIFR.SPR");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "OPTIAN.SPR");
else if (_vm->_globals._language == LANG_SP)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIES.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "OPTIES.SPR");
_vm->_globals.OPTION_SPR = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals._optionDialogFl = true;
@ -229,8 +229,6 @@ void DialogsManager::showOptionsDialog() {
// Values are blocked, thus handling the zone is useless
//if (mousePos.x >= _vm->_graphicsManager.ofscroll + 348 && mousePos.y > 248 && mousePos.x <= _vm->_graphicsManager.ofscroll + 394 && mousePos.y <= 273)
// _vm->_globals._speed = 2;
//if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 221 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 246)
// _vm->_globals.SVGA = 2;
if (mousePos.x < _vm->_graphicsManager._scrollOffset + 165 || mousePos.x > _vm->_graphicsManager._scrollOffset + 496 || (uint)(mousePos.y - 107) > 211)
doneFlag = true;
@ -253,12 +251,7 @@ void DialogsManager::showOptionsDialog() {
_vm->_globals._menuSoundOff = !_vm->_soundManager._soundOffFl ? 7 : 8;
_vm->_globals._menuMusicOff = !_vm->_soundManager._musicOffFl ? 7 : 8;
if (_vm->_globals.SVGA == 1)
_vm->_globals._menuDisplayType = 10;
else if (_vm->_globals.SVGA == 2)
_vm->_globals._menuDisplayType = 9;
else if (_vm->_globals.SVGA == 3)
_vm->_globals._menuDisplayType = 11;
_vm->_globals._menuDisplayType = 9;
if (_vm->_graphicsManager._scrollSpeed == 1)
_vm->_globals._menuScrollSpeed = 12;
@ -320,13 +313,13 @@ LABEL_7:
switch (_vm->_globals._language) {
case LANG_EN:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "INVENTAN.SPR");
break;
case LANG_FR:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTFR.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "INVENTFR.SPR");
break;
case LANG_SP:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTES.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "INVENTES.SPR");
break;
}
@ -339,7 +332,7 @@ LABEL_7:
_vm->_fileManager.readStream(f, _vm->_dialogsManager._inventWin1, filesize);
f.close();
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENT2.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "INVENT2.SPR");
_inventBuf2 = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
int v19 = _inventX = _vm->_graphicsManager._scrollOffset + 152;
@ -618,18 +611,18 @@ void DialogsManager::showSaveLoad(int a1) {
switch (_vm->_globals._language) {
case LANG_EN:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "SAVEAN.SPR");
break;
case LANG_FR:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEFR.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "SAVEFR.SPR");
break;
case LANG_SP:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEES.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "SAVEES.SPR");
break;
}
_vm->_objectsManager.SL_SPR = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename);
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVE2.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "SAVE2.SPR");
_vm->_objectsManager.SL_SPR2 = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename);
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.SL_SPR, _vm->_eventsManager._startPos.x + 483, 360, 0);

View File

@ -72,8 +72,8 @@ void FileManager::initCensorship() {
_vm->_globals._censorshipFl = false;
// If file doesn't exist, fallback to uncensored
if (!fileExists(_vm->_globals.HOPSYSTEM, "BLOOD.DAT")) {
constructFilename(_vm->_globals.HOPSYSTEM, "BLOOD.DAT");
if (fileExists("SYSTEM", "BLOOD.DAT")) {
constructFilename("SYSTEM", "BLOOD.DAT");
char *data = (char *)loadFile(_vm->_globals._curFilename);
if ((data[6] == 'u' && data[7] == 'k') || (data[6] == 'U' && data[7] == 'K'))
@ -97,24 +97,8 @@ void FileManager::constructFilename(const Common::String &folder, const Common::
// check for animations that don't exist in the ANM folder, but rather in special
// sub-folders depending on the physical screen resolution being used.
if (folder == _vm->_globals.HOPANM) {
switch (_vm->_globals.SVGA) {
case 1:
if (fileExists(folderToUse, file))
folderToUse = _vm->_globals.HOPTSVGA;
break;
case 2:
if (fileExists(folderToUse, file))
folderToUse = _vm->_globals.HOPSVGA;
break;
case 3:
if (fileExists(folderToUse, file))
folderToUse = _vm->_globals.HOPVGA;
break;
default:
break;
}
}
if (folder == "ANM" && fileExists("SVGA", file))
folderToUse = "SVGA";
_vm->_globals._curFilename = Common::String::format("%s/%s", folderToUse.c_str(), file.c_str());
}
@ -122,9 +106,8 @@ void FileManager::constructFilename(const Common::String &folder, const Common::
/**
* Construct Linux filename
*/
Common::String FileManager::constructLinuxFilename(const Common::String &file) {
void FileManager::constructLinuxFilename(const Common::String &file) {
_vm->_globals._curFilename = file;
return file;
}
/**
@ -134,8 +117,7 @@ bool FileManager::fileExists(const Common::String &folder, const Common::String
Common::String filename = folder.empty() ? file :
Common::String::format("%s/%s", folder.c_str(), file.c_str());
Common::File f;
return !f.exists(filename);
return Common::File::exists(filename);
}
/**
@ -150,52 +132,52 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
switch (a2) {
case 1:
constructFilename(_vm->_globals.HOPLINK, "RES_INI.CAT");
constructFilename("LINK", "RES_INI.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
ptr = loadFile(_vm->_globals._curFilename);
constructFilename(_vm->_globals.HOPLINK, "RES_INI.RES");
constructFilename("LINK", "RES_INI.RES");
break;
case 2:
constructFilename(_vm->_globals.HOPLINK, "RES_REP.CAT");
constructFilename("LINK", "RES_REP.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
ptr = loadFile(_vm->_globals._curFilename);
constructFilename(_vm->_globals.HOPLINK, "RES_REP.RES");
constructFilename("LINK", "RES_REP.RES");
break;
case 3:
constructFilename(_vm->_globals.HOPLINK, "RES_LIN.CAT");
constructFilename("LINK", "RES_LIN.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
ptr = loadFile(_vm->_globals._curFilename);
constructFilename(_vm->_globals.HOPLINK, "RES_LIN.RES");
constructFilename("LINK", "RES_LIN.RES");
break;
case 4:
constructFilename(_vm->_globals.HOPANIM, "RES_ANI.CAT");
constructFilename("ANIM", "RES_ANI.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
ptr = loadFile(_vm->_globals._curFilename);
constructFilename(_vm->_globals.HOPANIM, "RES_ANI.RES");
constructFilename("ANIM", "RES_ANI.RES");
break;
case 5:
constructFilename(_vm->_globals.HOPANIM, "RES_PER.CAT");
constructFilename("ANIM", "RES_PER.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
ptr = loadFile(_vm->_globals._curFilename);
constructFilename(_vm->_globals.HOPANIM, "RES_PER.RES");
constructFilename("ANIM", "RES_PER.RES");
break;
case 6:
constructFilename(_vm->_globals.HOPIMAGE, "PIC.CAT");
constructFilename("BUFFER", "PIC.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
@ -203,7 +185,7 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
break;
case 7:
constructFilename(_vm->_globals.HOPANIM, "RES_SAN.CAT");
constructFilename("ANIM", "RES_SAN.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
@ -211,7 +193,7 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
break;
case 8:
constructFilename(_vm->_globals.HOPLINK, "RES_SLI.CAT");
constructFilename("LINK", "RES_SLI.CAT");
if (!f.exists(_vm->_globals._curFilename))
return g_PTRNUL;
@ -220,18 +202,18 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
case 9:
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
_vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES");
// Win95 and Linux versions uses another set of names
else {
switch (_vm->_globals._language) {
case LANG_EN:
constructFilename(_vm->_globals.HOPLINK, "RES_VAN.CAT");
constructFilename("LINK", "RES_VAN.CAT");
break;
case LANG_FR:
constructFilename(_vm->_globals.HOPLINK, "RES_VFR.CAT");
constructFilename("LINK", "RES_VFR.CAT");
break;
case LANG_SP:
constructFilename(_vm->_globals.HOPLINK, "RES_VES.CAT");
constructFilename("LINK", "RES_VES.CAT");
break;
}
}

View File

@ -46,7 +46,7 @@ public:
void constructFilename(const Common::String &folder, const Common::String &file);
byte *searchCat(const Common::String &file, int a2);
Common::String constructLinuxFilename(const Common::String &file);
void constructLinuxFilename(const Common::String &file);
uint32 fileSize(const Common::String &filename);
};

View File

@ -165,7 +165,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
_textSortArray[v62] = 0;
_text[idx]._textLoadedFl = true;
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
_vm->_fileManager.constructFilename("LINK", filename);
file = _vm->_globals._curFilename;
if (strncmp(file.c_str(), _oldName.c_str(), strlen(file.c_str())) != 0) {
@ -196,10 +196,8 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
Common::fill(&_tempText[0], &_tempText[2058], 0);
f.read(_tempText, 2048);
f.close();
_vm->_globals.texte_long = 2048;
} else {
v69 = 100;
_vm->_globals.texte_long = 100;
v9 = _vm->_globals.allocMemory(110);
Common::fill(&v9[0], &v9[110], 0);

View File

@ -115,7 +115,6 @@ Globals::Globals() {
// Initialise fields
_language = LANG_EN;
SVGA = 2;
_internetFl = true;
PUBEXIT = false;
@ -126,7 +125,6 @@ Globals::Globals() {
_lastDirection = 0;
police_l = police_h = 0;
TETE = NULL;
texte_long = 0;
_curObjectIndex = 0;
NUM_FICHIER_OBJ = 0;
nbrligne = 0;
@ -136,19 +134,16 @@ Globals::Globals() {
_helicopterFl = false;
_catalogPos = 0;
_catalogSize = 0;
_newObjectFl = false;
iRegul = 0;
_exitId = 0;
PLANX = PLANY = 0;
PLANI = 0;
PERSO = 0;
_screenId = 0;
NOSPRECRAN = false;
_prevScreenId = 0;
Max_Ligne_Long = 0;
_maxLineLength = 0;
Max_Perso_Y = 0;
Max_Propre = 0;
fmusic = 0;
NBBLOC = 0;
_menuScrollType = 0;
_menuScrollSpeed = 0;
@ -187,7 +182,6 @@ Globals::Globals() {
BUF_ZONE = NULL;
for (int idx = 0; idx < 6; ++idx)
CACHE_BANQUE[idx] = NULL;
texte_tmp = NULL;
SPRITE_ECRAN = NULL;
_saveData = NULL;
BUFFERTAPE = NULL;
@ -242,7 +236,6 @@ Globals::~Globals() {
freeMemory(BUF_ZONE);
for (int idx = 0; idx < 6; ++idx)
CACHE_BANQUE[idx] = freeMemory(CACHE_BANQUE[idx]);
freeMemory(texte_tmp);
freeMemory(SPRITE_ECRAN);
freeMemory((byte *)_saveData);
freeMemory(BUFFERTAPE);
@ -266,20 +259,6 @@ void Globals::setParent(HopkinsEngine *vm) {
}
void Globals::setConfig() {
HOPIMAGE = "BUFFER";
HOPANIM = "ANIM";
HOPLINK = "LINK";
HOPSAVE = "SAVE";
HOPSOUND = "SOUND";
HOPMUSIC = "MUSIC";
HOPVOICE = "VOICE";
HOPANM = "ANM";
HOPTSVGA = "TSVGA";
HOPSVGA = "SVGA";
HOPVGA = "VGA";
HOPSEQ = "SEQ";
HOPSYSTEM = "SYSTEM";
// CHECKME: Should be in Globals() but it doesn't work
// The Polish version is a translation of the English version. The filenames are the same.
switch (_vm->getLanguage()) {
@ -327,8 +306,6 @@ void Globals::clearAll() {
nbrligne = 80;
INIT_ANIM();
texte_tmp = g_PTRNUL;
texte_long = 0;
police = g_PTRNUL;
police_h = 0;
police_l = 0;
@ -377,8 +354,6 @@ void Globals::clearAll() {
CarreZone[idx].field0 = 0;
}
texte_long = 0;
texte_tmp = g_PTRNUL;
BUFFERTAPE = allocMemory(85000);
_saveData = (Sauvegarde *)malloc(sizeof(Sauvegarde));
@ -458,7 +433,7 @@ void Globals::CLEAR_VBOB() {
// Load Object
void Globals::loadObjects() {
_vm->_fileManager.constructFilename(HOPSYSTEM, "OBJET.DAT");
_vm->_fileManager.constructFilename("SYSTEM", "OBJET.DAT");
byte *data = _vm->_fileManager.loadFile(_curFilename);
byte *srcP = data;
@ -537,11 +512,11 @@ void Globals::loadCache(const Common::String &file) {
Common::File f;
resetCache();
_vm->_fileManager.constructFilename(HOPLINK, file);
_vm->_fileManager.constructFilename("LINK", file);
ptr = _vm->_fileManager.loadFile(_curFilename);
v16 = Common::String((const char *)ptr);
_vm->_fileManager.constructFilename(HOPLINK, v16);
_vm->_fileManager.constructFilename("LINK", v16);
if (!f.exists(_curFilename))
return;

View File

@ -329,24 +329,10 @@ public:
int _inventory[36];
SortItem _sortedDisplay[51];
Language _language;
int SVGA;
bool _internetFl;
bool PUBEXIT;
int PERSO_TYPE;
uint _speed;
Common::String HOPIMAGE;
Common::String HOPANIM;
Common::String HOPLINK;
Common::String HOPSAVE;
Common::String HOPSOUND;
Common::String HOPMUSIC;
Common::String HOPVOICE;
Common::String HOPANM;
Common::String HOPTSVGA;
Common::String HOPSVGA;
Common::String HOPVGA;
Common::String HOPSEQ;
Common::String HOPSYSTEM;
Common::String FICH_ZONE;
Common::String FICH_TEXTE;
Common::String _curFilename;
@ -360,8 +346,6 @@ public:
byte *TETE;
byte *ICONE;
byte *BUF_ZONE;
byte *texte_tmp;
int texte_long;
byte *SPRITE_ECRAN;
Sauvegarde *_saveData;
byte *BUFFERTAPE;
@ -386,7 +370,6 @@ public:
byte *ADR_FICHIER_OBJ;
byte *PERSO;
int _objectWidth, _objectHeight;
bool _newObjectFl;
bool _helicopterFl;
uint32 _catalogPos;
uint32 _catalogSize;
@ -394,12 +377,10 @@ public:
int _exitId;
int PLANX, PLANY;
int PLANI;
bool NOSPRECRAN;
int _screenId;
int _prevScreenId;
int fmusic;
int Max_Propre;
int Max_Ligne_Long;
int _maxLineLength;
int Max_Perso_Y;
bool _disableInventFl;
bool NOMARCHE;

View File

@ -163,7 +163,7 @@ void GraphicsManager::loadVgaImage(const Common::String &file) {
lockScreen();
clearScreen();
unlockScreen();
_vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file);
_vm->_fileManager.constructFilename("BUFFER", file);
A_PCX320(_vesaScreen, _vm->_globals._curFilename, _palette);
memcpy(_vesaBuffer, _vesaScreen, 64000);
SCANLINE(320);
@ -184,7 +184,7 @@ void GraphicsManager::loadScreen(const Common::String &file) {
bool flag = true;
if (_vm->_fileManager.searchCat(file, 6) == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file);
_vm->_fileManager.constructFilename("BUFFER", file);
if (!f.open(_vm->_globals._curFilename))
error("loadScreen - %s", file.c_str());
@ -301,16 +301,16 @@ void GraphicsManager::A_PCX640_480(byte *surface, const Common::String &file, by
if (typeFlag) {
// Load PCX from within the PIC resource
_vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, "PIC.RES");
_vm->_fileManager.constructFilename("BUFFER", "PIC.RES");
if (!f.open(_vm->_globals._curFilename))
error("(nom)Erreur en cours de lecture.");
error("Error opening PIC.RES.");
f.seek(_vm->_globals._catalogPos);
} else {
// Load stand alone PCX file
_vm->_fileManager.constructFilename(_vm->_globals.HOPIMAGE, file);
_vm->_fileManager.constructFilename("BUFFER", file);
if (!f.open(_vm->_globals._curFilename))
error("(nom)Erreur en cours de lecture.");
error("Error opening PCX %s.", file.c_str());
}
// Decode the PCX
@ -1753,32 +1753,32 @@ void GraphicsManager::displayFont(byte *surface, const byte *spriteData, int xp,
}
// Init Screen
void GraphicsManager::INI_ECRAN(const Common::String &file) {
OPTI_INI(file, 0);
void GraphicsManager::INI_ECRAN(const Common::String &file, bool initializeScreen) {
OPTI_INI(file, 0, initializeScreen);
}
// Init Screen 2
void GraphicsManager::INI_ECRAN2(const Common::String &file) {
OPTI_INI(file, 2);
void GraphicsManager::INI_ECRAN2(const Common::String &file, bool initializeScreen) {
OPTI_INI(file, 2, initializeScreen);
}
void GraphicsManager::OPTI_INI(const Common::String &file, int mode) {
void GraphicsManager::OPTI_INI(const Common::String &file, int mode, bool initializeScreen) {
Common::String filename = file + ".ini";
byte *ptr = _vm->_fileManager.searchCat(filename, 1);
if (ptr == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
_vm->_fileManager.constructFilename("LINK", filename);
ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (!mode) {
filename = file + ".spr";
_vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN);
if (!_vm->_globals.NOSPRECRAN) {
if (initializeScreen) {
_vm->_globals.SPRITE_ECRAN = _vm->_fileManager.searchCat(filename, 8);
if (_vm->_globals.SPRITE_ECRAN) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
_vm->_fileManager.constructFilename("LINK", filename);
} else {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES");
_vm->_fileManager.constructFilename("LINK", "RES_SLI.RES");
}
_vm->_globals.SPRITE_ECRAN = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
@ -1814,7 +1814,7 @@ void GraphicsManager::OPTI_INI(const Common::String &file, int mode) {
byte *dataP = _vm->_fileManager.searchCat(filename, 2);
_vm->_globals.COUCOU = dataP;
if (g_PTRNUL == dataP) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
_vm->_fileManager.constructFilename("LINK", filename);
dataP = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.COUCOU = dataP;
}

View File

@ -163,9 +163,9 @@ public:
void SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY);
void Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned int width, int height, byte *destSurface, int destX, int destY);
void displayFont(byte *surface, const byte *spriteData, int xp, int yp, int characterIndex, int colour);
void INI_ECRAN(const Common::String &file);
void INI_ECRAN2(const Common::String &file);
void OPTI_INI(const Common::String &file, int mode);
void INI_ECRAN(const Common::String &file, bool initializeScreen);
void INI_ECRAN2(const Common::String &file, bool initializeScreen);
void OPTI_INI(const Common::String &file, int mode, bool initializeScreen);
void NB_SCREEN(bool initPalette);
void SHOW_PALETTE();
void Copy_WinScan_Vbe(const byte *srcP, byte *destP);

File diff suppressed because it is too large Load Diff

View File

@ -471,7 +471,7 @@ void LinesManager::INIPARCOURS() {
} while (!v1);
_vm->_objectsManager._lastLine = v0;
v13 = _vm->_globals.Max_Ligne_Long;
v13 = _vm->_globals._maxLineLength;
v9 = _vm->_objectsManager._lastLine + 1;
for (int v8 = 1; v8 != 400; v8++) {
v11 = v8;

View File

@ -85,13 +85,13 @@ int MenuManager::menu() {
_vm->_graphicsManager.fadeInLong();
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENU.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "MENU.SPR");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "MENUAN.SPR");
else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUFR.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "MENUFR.SPR");
else if (_vm->_globals._language == LANG_SP)
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "MENUES.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "MENUES.SPR");
spriteData = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename);
_vm->_eventsManager.mouseOn();

View File

@ -55,7 +55,6 @@ ObjectsManager::ObjectsManager() {
_saveLoadFl = false;
SL_MODE = false;
_visibleFl = false;
_disableCursorFl = false;
BOBTOUS = false;
my_anim = 0;
NUMZONE = 0;
@ -102,7 +101,6 @@ void ObjectsManager::setParent(HopkinsEngine *vm) {
*/
void ObjectsManager::changeObject(int objIndex) {
_vm->_eventsManager._objectBuf = CAPTURE_OBJET(objIndex, 1);
_vm->_globals._newObjectFl = true;
_vm->_globals._curObjectIndex = objIndex;
}
@ -118,7 +116,7 @@ byte *ObjectsManager::CAPTURE_OBJET(int objIndex, int mode) {
if (_vm->_globals.ADR_FICHIER_OBJ != g_PTRNUL)
ObjectsManager::DEL_FICHIER_OBJ();
if (val1 == 1) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OBJET1.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "OBJET1.SPR");
_vm->_globals.ADR_FICHIER_OBJ = ObjectsManager::loadSprite(_vm->_globals._curFilename);
}
_vm->_globals.NUM_FICHIER_OBJ = val1;
@ -2077,7 +2075,7 @@ void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) {
_vm->_linesManager.RESET_OBSTACLE();
_vm->_linesManager._linesNumb = 0;
_lastLine = 0;
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file);
_vm->_fileManager.constructFilename("LINK", file);
ptr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
v4 = 0;
v5 = 0;
@ -2132,7 +2130,7 @@ void ObjectsManager::loadZone(const Common::String &file) {
_vm->_globals.ZONEP[i].field10 = 0;
}
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file);
_vm->_fileManager.constructFilename("LINK", file);
Common::File f;
if (!f.exists(_vm->_globals._curFilename))
@ -2262,9 +2260,8 @@ void ObjectsManager::PLAN_BETA() {
_vm->_dialogsManager._inventFl = false;
_vm->_eventsManager._gameKey = KEY_NONE;
_vm->_globals.Max_Propre = 1;
_vm->_globals.Max_Ligne_Long = 1;
_vm->_globals._maxLineLength = 1;
_vm->_globals.Max_Perso_Y = 440;
_vm->_globals.NOSPRECRAN = true;
_vm->_globals.PLAN_FLAG = true;
_vm->_graphicsManager._noFadingFl = false;
_vm->_globals.NOMARCHE = false;
@ -2277,11 +2274,11 @@ void ObjectsManager::PLAN_BETA() {
CHARGE_OBSTACLE("PLAN.OB2");
_vm->_globals.loadCache("PLAN.CA2");
loadZone("PLAN.ZO2");
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "VOITURE.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "VOITURE.SPR");
_spritePtr = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_animationManager.loadAnim("PLAN");
_vm->_graphicsManager.VISU_ALL();
_vm->_graphicsManager.INI_ECRAN2("PLAN");
_vm->_graphicsManager.INI_ECRAN2("PLAN", false);
for (int v2 = 0; v2 <= 15; v2++)
_vm->_globals.CACHE_OFF(v2);
_vm->_globals.CACHE_OFF(19);
@ -2358,7 +2355,6 @@ void ObjectsManager::PLAN_BETA() {
removeSprite(0);
_spritePtr = _vm->_globals.freeMemory(_spritePtr);
CLEAR_ECRAN();
_vm->_globals.NOSPRECRAN = false;
_vm->_globals.PLAN_FLAG = false;
}
@ -2696,7 +2692,6 @@ void ObjectsManager::CLEAR_ECRAN() {
_vm->_globals.GOACTION = false;
_forceZoneFl = true;
_changeVerbFl = false;
_vm->_globals.NOSPRECRAN = false;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
_vm->_globals.g_old_sens = -1;
my_anim = 1;
@ -2742,7 +2737,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
T_RECTIF = 0;
loc = &_vm->_globals._saveData->_realHopkins;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 0;
SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 34, 190);
@ -2768,7 +2763,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
_vm->_globals._saveData->data[svField357] = 0;
loc = &_vm->_globals._saveData->_samantha;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PSAMAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PSAMAN.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 2;
SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 20, 127);
@ -3747,7 +3742,7 @@ void ObjectsManager::OPTI_OBJET() {
file = "OBJET1.ini";
data = _vm->_fileManager.searchCat(file, 1);
if (data == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file);
_vm->_fileManager.constructFilename("LINK", file);
data = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
if (data == g_PTRNUL)
error("INI file %s not found", file.c_str());
@ -3970,7 +3965,7 @@ void ObjectsManager::ACTION_DOS(int idx) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 1;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "DOS.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "DOS.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -3999,7 +3994,7 @@ void ObjectsManager::ACTION_DROITE(int idx) {
if (_vm->_globals.GESTE_FLAG != 3) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 3;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PROFIL.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -4028,7 +4023,7 @@ void ObjectsManager::Q_DROITE(int idx) {
if (_vm->_globals.GESTE_FLAG != 4) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 4;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "3Q.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -4057,7 +4052,7 @@ void ObjectsManager::ACTION_FACE(int idx) {
if (_vm->_globals.GESTE_FLAG != 2) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 2;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "FACE.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "FACE.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -4074,7 +4069,7 @@ void ObjectsManager::Q_GAUCHE(int idx) {
if (_vm->_globals.GESTE_FLAG != 4) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 4;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "3Q.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "3Q.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -4103,7 +4098,7 @@ void ObjectsManager::ACTION_GAUCHE(int idx) {
if (_vm->_globals.GESTE_FLAG != 3) {
_vm->_globals.GESTE = _vm->_globals.freeMemory(_vm->_globals.GESTE);
_vm->_globals.GESTE_FLAG = 3;
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PROFIL.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PROFIL.SPR");
_vm->_globals.GESTE = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
}
if (idx == 1)
@ -4251,7 +4246,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
ptr = _vm->_fileManager.searchCat(filename, 3);
nbytes = _vm->_globals._catalogSize;
if (ptr == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
_vm->_fileManager.constructFilename("LINK", filename);
if (!f.open(_vm->_globals._curFilename))
error("Error opening file - %s", _vm->_globals._curFilename.c_str());
@ -4274,9 +4269,9 @@ void ObjectsManager::INILINK(const Common::String &file) {
_vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.searchCat(filename2, 8);
if (_vm->_globals.CACHE_BANQUE[1] || _vm->_globals.CACHE_BANQUE[1] == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename2);
_vm->_fileManager.constructFilename("LINK", filename2);
} else {
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, "RES_SLI.RES");
_vm->_fileManager.constructFilename("LINK", "RES_SLI.RES");
}
_vm->_globals.CACHE_BANQUE[1] = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
@ -4965,7 +4960,7 @@ void ObjectsManager::lockAnimX(int idx, int a2) {
}
void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Common::String &linkFile,
const Common::String &animFile, const Common::String &s4, int v) {
const Common::String &animFile, const Common::String &s4, int v, bool initializeScreen) {
int v5;
int v7;
int v8;
@ -4990,10 +4985,10 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo
_vm->_animationManager.loadAnim(animFile);
_vm->_graphicsManager.VISU_ALL();
if (!s4.empty()) {
if (!_vm->_globals.NOSPRECRAN)
_vm->_graphicsManager.INI_ECRAN(s4);
if (!s4.empty() && _vm->_globals.NOSPRECRAN)
_vm->_graphicsManager.INI_ECRAN2(s4);
if (initializeScreen)
_vm->_graphicsManager.INI_ECRAN(s4, initializeScreen);
if (!s4.empty() && !initializeScreen)
_vm->_graphicsManager.INI_ECRAN2(s4, initializeScreen);
}
_vm->_eventsManager.mouseOn();
if (_vm->_globals._screenId == 61) {
@ -5060,7 +5055,7 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo
}
void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Common::String &linkFile,
const Common::String &animFile, const Common::String &s4, int v) {
const Common::String &animFile, const Common::String &s4, int v, bool initializeScreen) {
int mouseButtons;
bool breakFlag;
int xp, yp;
@ -5087,10 +5082,10 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
_vm->_graphicsManager.VISU_ALL();
}
if (!s4.empty()) {
if (!_vm->_globals.NOSPRECRAN)
_vm->_graphicsManager.INI_ECRAN(s4);
if (initializeScreen)
_vm->_graphicsManager.INI_ECRAN(s4, initializeScreen);
else
_vm->_graphicsManager.INI_ECRAN2(s4);
_vm->_graphicsManager.INI_ECRAN2(s4, initializeScreen);
}
_vm->_eventsManager.mouseOn();
_vm->_eventsManager._mouseCursorId = 4;
@ -5100,20 +5095,20 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
if (_vm->_globals.PERSO_TYPE) {
if (!_vm->_globals._saveData->data[svField122] && !_vm->_globals._saveData->data[svField356]) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 0;
}
}
if (!_vm->_globals.PERSO_TYPE) {
if (_vm->_globals._saveData->data[svField122] == 1) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "HOPFEM.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "HOPFEM.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 1;
}
}
if (_vm->_globals.PERSO_TYPE != 2 && _vm->_globals._saveData->data[svField356] == 1) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PSAMAN.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PSAMAN.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 2;
}

View File

@ -80,7 +80,6 @@ public:
bool _saveLoadFl;
int SL_MODE;
bool _visibleFl;
bool _disableCursorFl;
bool BOBTOUS;
int my_anim;
int NUMZONE;
@ -240,13 +239,13 @@ public:
* Game scene control method
*/
void PERSONAGE(const Common::String &backgroundFile, const Common::String &linkFile,
const Common::String &animFile, const Common::String &s4, int v);
const Common::String &animFile, const Common::String &s4, int v, bool initializeScreen);
/**
* Game scene control method
*/
void PERSONAGE2(const Common::String &backgroundFile, const Common::String &linkFile,
const Common::String &animFile, const Common::String &s4, int v);
const Common::String &animFile, const Common::String &s4, int v, bool initializeScreen);
};
} // End of namespace Hopkins

View File

@ -918,7 +918,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 56:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "HOPFEM.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "HOPFEM.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 1;
_vm->_globals._saveData->data[svField122] = 1;
@ -929,7 +929,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
break;
case 57:
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "PERSO.SPR");
_vm->_fileManager.constructFilename("SYSTEM", "PERSO.SPR");
_vm->_globals.PERSO = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_vm->_globals.PERSO_TYPE = 0;
_vm->_globals._saveData->data[svField122] = 0;
@ -1352,10 +1352,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals.NOPARLE = true;
_vm->_talkManager.PARLER_PERSO("tourist1.pe2");
_vm->_globals.NOPARLE = false;
if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim2("T421.ANM", 100, 14, 500);
else if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim2("T421a.ANM", 100, 14, 500);
_vm->_animationManager.playAnim2("T421.ANM", 100, 14, 500);
_vm->_eventsManager.VBL();
_vm->_eventsManager.VBL();
_vm->_eventsManager.VBL();
@ -2278,17 +2275,14 @@ int ScriptManager::handleOpcode(byte *dataP) {
if (!_vm->_globals._internetFl) {
_vm->_graphicsManager.FADE_LINUX = 2;
_vm->_graphicsManager._fadeDefaultSpeed = 1;
if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim("BOMBE1A.ANM", 100, 18, 100);
else if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim("BOMBE1.ANM", 100, 18, 100);
_vm->_animationManager.playAnim("BOMBE1A.ANM", 100, 18, 100);
}
_vm->_graphicsManager.loadImage("BOMBEB");
_vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0);
_vm->_graphicsManager.OPTI_INI("BOMBE", 2);
_vm->_graphicsManager.OPTI_INI("BOMBE", 2, true);
_vm->_graphicsManager.fadeInShort();
break;
@ -2313,10 +2307,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager.OPTI_ONE(3, 0, 16, 4);
_vm->_soundManager.SPECIAL_SOUND = 199;
_vm->_graphicsManager.FADE_LINUX = 2;
if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim("BOMBE2.ANM", 50, 14, 500);
else if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_soundManager.SPECIAL_SOUND = 0;
memset(_vm->_graphicsManager._vesaBuffer, 0, 614400);
_vm->_graphicsManager._noFadingFl = true;
@ -2329,10 +2320,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals.NO_VISU = false;
_vm->_objectsManager.OPTI_ONE(1, 0, 16, 4);
_vm->_soundManager.SPECIAL_SOUND = 199;
if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim("BOMBE2.ANM", 50, 14, 500);
else if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_soundManager.SPECIAL_SOUND = 0;
_vm->_graphicsManager._noFadingFl = true;
memset(_vm->_graphicsManager._vesaBuffer, 0, 614400);
@ -2347,10 +2335,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_graphicsManager.fadeOutShort();
_vm->_soundManager.SPECIAL_SOUND = 199;
_vm->_graphicsManager.FADE_LINUX = 2;
if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim("BOMBE2.ANM", 50, 14, 500);
else if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_animationManager.playAnim("BOMBE2A.ANM", 50, 14, 500);
_vm->_soundManager.SPECIAL_SOUND = 0;
_vm->_graphicsManager._noFadingFl = true;
memset(_vm->_graphicsManager._vesaBuffer, 0, 614400);
@ -2363,10 +2348,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals.NO_VISU = false;
_vm->_objectsManager.OPTI_ONE(6, 0, 16, 4);
if ((_vm->getPlatform() != Common::kPlatformWindows) || !_vm->getIsDemo()) {
if (_vm->_globals.SVGA == 1)
_vm->_animationManager.playAnim("BOMBE3.ANM", 50, 14, 500);
else if (_vm->_globals.SVGA == 2)
_vm->_animationManager.playAnim("BOMBE3A.ANM", 50, 14, 500);
_vm->_animationManager.playAnim("BOMBE3A.ANM", 50, 14, 500);
memset(_vm->_graphicsManager._vesaBuffer, 0, 614400);
}
_vm->_globals._exitId = 6;

View File

@ -319,7 +319,7 @@ void SoundManager::playAnim_SOUND(int soundNumber) {
}
static const char *modSounds[] = {
"appart", "ville", "Rock", "police", "deep"
"appart", "ville", "Rock", "police", "deep",
"purgat", "riviere", "SUSPENS", "labo", "cadavre",
"cabane", "purgat2", "foret", "ile", "ile2",
"hopkins", "peur", "URAVOLGA", "BASE", "cadavre2",
@ -380,7 +380,7 @@ void SoundManager::PLAY_MOD(const Common::String &file) {
modFile += "2";
}
}
_vm->_fileManager.constructFilename(_vm->_globals.HOPMUSIC, modFile);
_vm->_fileManager.constructFilename("MUSIC", modFile);
if (MOD_FLAG) {
stopMusic();
delMusic();
@ -520,34 +520,34 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) {
if (!_vm->_fileManager.searchCat(filename + ".WAV", 9)) {
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
_vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES");
// Win95 and Linux versions uses another set of names
else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VFR.RES");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VAN.RES");
else if (_vm->_globals._language == LANG_SP)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VES.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VES.RES");
catPos = _vm->_globals._catalogPos;
catLen = _vm->_globals._catalogSize;
} else if (!_vm->_fileManager.searchCat(filename + ".APC", 9)) {
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
_vm->_fileManager.constructFilename("VOICE", "ENG_VOI.RES");
// Win95 and Linux versions uses another set of names
else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VFR.RES");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VAN.RES");
else if (_vm->_globals._language == LANG_SP)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VES.RES");
_vm->_fileManager.constructFilename("VOICE", "RES_VES.RES");
catPos = _vm->_globals._catalogPos;
catLen = _vm->_globals._catalogSize;
} else {
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".WAV");
_vm->_fileManager.constructFilename("VOICE", filename + ".WAV");
if (!f.exists(_vm->_globals._curFilename)) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, filename + ".APC");
_vm->_fileManager.constructFilename("VOICE", filename + ".APC");
if (!f.exists(_vm->_globals._curFilename))
return false;
}
@ -626,7 +626,7 @@ void SoundManager::MODSetMusicVolume(int volume) {
}
void SoundManager::loadSample(int wavIndex, const Common::String &file) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSOUND, file);
_vm->_fileManager.constructFilename("SOUND", file);
LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 0);
SOUND[wavIndex]._active = true;
}
@ -758,7 +758,7 @@ void SoundManager::LOAD_SAMPLE2_SDL(int wavIndex, const Common::String &filename
}
void SoundManager::LOAD_NWAV(const Common::String &file, int wavIndex) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPSOUND, file);
_vm->_fileManager.constructFilename("SOUND", file);
LOAD_SAMPLE2_SDL(wavIndex, _vm->_globals._curFilename, 1);
}

View File

@ -62,7 +62,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) {
_characterBuffer = _vm->_fileManager.searchCat(filename, 5);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);
_vm->_fileManager.constructFilename("ANIM", filename);
_characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename);
}
@ -81,9 +81,9 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) {
_paletteBufferIdx = 20 * (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) + 110;
_characterSprite = _vm->_fileManager.searchCat(spriteFilename, 7);
if (_characterSprite) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, spriteFilename);
_vm->_fileManager.constructFilename("ANIM", spriteFilename);
} else {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES");
_vm->_fileManager.constructFilename("ANIM", "RES_SAN.RES");
}
_characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename);
@ -156,14 +156,14 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) {
}
void TalkManager::PARLER_PERSO2(const Common::String &filename) {
_vm->_objectsManager._disableCursorFl = true;
// TODO: The original disables the mouse cursor here
STATI = 1;
bool v7 = _vm->_globals._disableInventFl;
_vm->_globals._disableInventFl = true;
_characterBuffer = _vm->_fileManager.searchCat(filename, 5);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, filename);
_vm->_fileManager.constructFilename("ANIM", filename);
_characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename);
}
@ -222,7 +222,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) {
_vm->_eventsManager.changeMouseCursor(v8);
_vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette);
_vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_objectsManager._disableCursorFl = false;
// TODO: The original reenables the mouse cursor here
_vm->_globals._disableInventFl = v7;
STATI = 0;
}
@ -576,7 +576,7 @@ int TalkManager::VERIF_BOITE(int idx, const Common::String &file, int a3) {
v18 = 0;
_vm->_globals.police_l = 11;
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, file);
_vm->_fileManager.constructFilename("LINK", file);
// Build up the filename
filename = dest = _vm->_globals._curFilename;
@ -1087,7 +1087,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_characterBuffer = _vm->_fileManager.searchCat(a2, 5);
_characterSize = _vm->_globals._catalogSize;
if (_characterBuffer == g_PTRNUL) {
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, a2);
_vm->_fileManager.constructFilename("ANIM", a2);
_characterBuffer = _vm->_fileManager.loadFile(_vm->_globals._curFilename);
_characterSize = _vm->_fileManager.fileSize(_vm->_globals._curFilename);
}
@ -1100,9 +1100,9 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_characterSprite = _vm->_fileManager.searchCat(v23, 7);
if (_characterSprite)
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, v23);
_vm->_fileManager.constructFilename("ANIM", v23);
else
_vm->_fileManager.constructFilename(_vm->_globals.HOPANIM, "RES_SAN.RES");
_vm->_fileManager.constructFilename("ANIM", "RES_SAN.RES");
_characterSprite = _vm->_objectsManager.loadSprite(_vm->_globals._curFilename);
@ -1130,7 +1130,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
initCharacterAnim();
VISU_PARLE();
dialogWait();
_vm->_graphicsManager.INI_ECRAN2(v22);
_vm->_graphicsManager.INI_ECRAN2(v22, true);
_vm->_globals.NOMARCHE = true;
_vm->_objectsManager._forceZoneFl = true;
_vm->_objectsManager.NUMZONE = -1;
@ -1164,7 +1164,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_vm->_globals.COUCOU = v11;
_vm->_objectsManager._disableFl = true;
_vm->_objectsManager.INILINK(v20);
_vm->_graphicsManager.INI_ECRAN2(v20);
_vm->_graphicsManager.INI_ECRAN2(v20, true);
_vm->_objectsManager._disableFl = false;
_vm->_globals.NOMARCHE = false;
if (_vm->_globals._exitId == 101)