HUGO: Fix H1 DOS initialization
Fix a bug in hugo.dat loading and initialize properly Hugo1 DOS svn-id: r52755
This commit is contained in:
parent
16557884b6
commit
c7b38c4510
3 changed files with 12 additions and 9 deletions
|
@ -231,6 +231,8 @@ void FileManager::readImage(int objNum, object_t *objPtr) {
|
||||||
case CYCLE_BACKWARD:
|
case CYCLE_BACKWARD:
|
||||||
objPtr->currImagePtr = seqPtr;
|
objPtr->currImagePtr = seqPtr;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
warning("Unexpected cycling: %d", objPtr->cycling);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_vm.isPacked())
|
if (!_vm.isPacked())
|
||||||
|
@ -791,13 +793,9 @@ void FileManager_v1d::readBackground(int screenIndex) {
|
||||||
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
|
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
|
||||||
|
|
||||||
char *buf = (char *) malloc(2048 + 1); // Buffer for file access
|
char *buf = (char *) malloc(2048 + 1); // Buffer for file access
|
||||||
strcat(strcat(strcpy(buf, _vm._picDir), _vm._screenNames[screenIndex]), BKGEXT);
|
strcat(strcpy(buf, _vm._screenNames[screenIndex]), ".ART");
|
||||||
if (!_sceneryArchive1.open(buf)) {
|
if (!_sceneryArchive1.open(buf))
|
||||||
warning("File %s not found, trying again with %s.ART", buf, _vm._screenNames[screenIndex]);
|
Utils::Error(FILE_ERR, "%s", buf);
|
||||||
strcat(strcpy(buf, _vm._screenNames[screenIndex]), ".ART");
|
|
||||||
if (!_sceneryArchive1.open(buf))
|
|
||||||
Utils::Error(FILE_ERR, "%s", buf);
|
|
||||||
}
|
|
||||||
// Read the image into dummy seq and static dib_a
|
// Read the image into dummy seq and static dib_a
|
||||||
readPCX(_sceneryArchive1, &seq, _vm.screen().getFrontBuffer(), true, _vm._screenNames[screenIndex]);
|
readPCX(_sceneryArchive1, &seq, _vm.screen().getFrontBuffer(), true, _vm._screenNames[screenIndex]);
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,10 @@ Common::Error HugoEngine::run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HugoEngine::initMachine() {
|
void HugoEngine::initMachine() {
|
||||||
file().readBackground(_numScreens - 1); // Splash screen
|
if (_gameVariant == 3)
|
||||||
|
readScreenFiles(0);
|
||||||
|
else
|
||||||
|
file().readBackground(_numScreens - 1); // Splash screen
|
||||||
readObjectImages(); // Read all object images
|
readObjectImages(); // Read all object images
|
||||||
if (_platform == Common::kPlatformWindows)
|
if (_platform == Common::kPlatformWindows)
|
||||||
readUIFImages(); // Read all uif images (only in Win versions)
|
readUIFImages(); // Read all uif images (only in Win versions)
|
||||||
|
@ -1397,6 +1400,7 @@ char **HugoEngine::loadTextsVariante(Common::File &in, uint16 *arraySize) {
|
||||||
res = (char **)malloc(sizeof(char *) * numTexts);
|
res = (char **)malloc(sizeof(char *) * numTexts);
|
||||||
res[0] = pos;
|
res[0] = pos;
|
||||||
in.read(res[0], entryLen);
|
in.read(res[0], entryLen);
|
||||||
|
res[0] += DATAALIGNMENT;
|
||||||
} else {
|
} else {
|
||||||
in.read(pos, entryLen);
|
in.read(pos, entryLen);
|
||||||
}
|
}
|
||||||
|
@ -1467,6 +1471,7 @@ char ***HugoEngine::loadTextsArray(Common::File &in) {
|
||||||
res = (char **)malloc(sizeof(char *) * numTexts);
|
res = (char **)malloc(sizeof(char *) * numTexts);
|
||||||
res[0] = pos;
|
res[0] = pos;
|
||||||
in.read(res[0], entryLen);
|
in.read(res[0], entryLen);
|
||||||
|
res[0] += DATAALIGNMENT;
|
||||||
} else {
|
} else {
|
||||||
in.read(pos, entryLen);
|
in.read(pos, entryLen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ enum GameType {
|
||||||
kGameTypeHugo3
|
kGameTypeHugo3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum HugoebugChannels {
|
enum HugoDebugChannels {
|
||||||
kDebugSchedule = 1 << 0,
|
kDebugSchedule = 1 << 0,
|
||||||
kDebugEngine = 1 << 1,
|
kDebugEngine = 1 << 1,
|
||||||
kDebugDisplay = 1 << 2,
|
kDebugDisplay = 1 << 2,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue