mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
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
@ -231,6 +231,8 @@ void FileManager::readImage(int objNum, object_t *objPtr) {
|
||||
case CYCLE_BACKWARD:
|
||||
objPtr->currImagePtr = seqPtr;
|
||||
break;
|
||||
default:
|
||||
warning("Unexpected cycling: %d", objPtr->cycling);
|
||||
}
|
||||
|
||||
if (!_vm.isPacked())
|
||||
@ -791,13 +793,9 @@ void FileManager_v1d::readBackground(int screenIndex) {
|
||||
debugC(1, kDebugFile, "readBackground(%d)", screenIndex);
|
||||
|
||||
char *buf = (char *) malloc(2048 + 1); // Buffer for file access
|
||||
strcat(strcat(strcpy(buf, _vm._picDir), _vm._screenNames[screenIndex]), BKGEXT);
|
||||
if (!_sceneryArchive1.open(buf)) {
|
||||
warning("File %s not found, trying again with %s.ART", buf, _vm._screenNames[screenIndex]);
|
||||
strcat(strcpy(buf, _vm._screenNames[screenIndex]), ".ART");
|
||||
if (!_sceneryArchive1.open(buf))
|
||||
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
|
||||
readPCX(_sceneryArchive1, &seq, _vm.screen().getFrontBuffer(), true, _vm._screenNames[screenIndex]);
|
||||
|
||||
|
@ -258,7 +258,10 @@ Common::Error HugoEngine::run() {
|
||||
}
|
||||
|
||||
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
|
||||
if (_platform == Common::kPlatformWindows)
|
||||
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[0] = pos;
|
||||
in.read(res[0], entryLen);
|
||||
res[0] += DATAALIGNMENT;
|
||||
} else {
|
||||
in.read(pos, entryLen);
|
||||
}
|
||||
@ -1467,6 +1471,7 @@ char ***HugoEngine::loadTextsArray(Common::File &in) {
|
||||
res = (char **)malloc(sizeof(char *) * numTexts);
|
||||
res[0] = pos;
|
||||
in.read(res[0], entryLen);
|
||||
res[0] += DATAALIGNMENT;
|
||||
} else {
|
||||
in.read(pos, entryLen);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ enum GameType {
|
||||
kGameTypeHugo3
|
||||
};
|
||||
|
||||
enum HugoebugChannels {
|
||||
enum HugoDebugChannels {
|
||||
kDebugSchedule = 1 << 0,
|
||||
kDebugEngine = 1 << 1,
|
||||
kDebugDisplay = 1 << 2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user