diff options
Diffstat (limited to 'engines/cruise/backgroundIncrust.cpp')
-rw-r--r-- | engines/cruise/backgroundIncrust.cpp | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp index a141818e9b..53a80424c2 100644 --- a/engines/cruise/backgroundIncrust.cpp +++ b/engines/cruise/backgroundIncrust.cpp @@ -180,115 +180,6 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx, return newElement; } -void saveIncrust(Common::OutSaveFile& currentSaveFile) { - int count = 0; - - backgroundIncrustStruct *pl = backgroundIncrustHead.next; - while (pl) { - count++; - pl = pl->next; - } - - currentSaveFile.writeSint16LE(count); - - pl = backgroundIncrustHead.next; - while (pl) { - char dummy[4] = {0, 0, 0, 0}; - currentSaveFile.write(dummy, 2); - currentSaveFile.write(dummy, 2); - - currentSaveFile.writeSint16LE(pl->objectIdx); - currentSaveFile.writeSint16LE(pl->type); - currentSaveFile.writeSint16LE(pl->overlayIdx); - currentSaveFile.writeSint16LE(pl->X); - currentSaveFile.writeSint16LE(pl->Y); - currentSaveFile.writeSint16LE(pl->field_E); - currentSaveFile.writeSint16LE(pl->scale); - currentSaveFile.writeSint16LE(pl->backgroundIdx); - currentSaveFile.writeSint16LE(pl->scriptNumber); - currentSaveFile.writeSint16LE(pl->scriptOverlayIdx); - currentSaveFile.write(dummy, 4); - currentSaveFile.writeSint16LE(pl->saveWidth / 2); - currentSaveFile.writeSint16LE(pl->saveHeight); - currentSaveFile.writeSint16LE(pl->saveSize); - currentSaveFile.writeSint16LE(pl->savedX); - currentSaveFile.writeSint16LE(pl->savedY); - currentSaveFile.write(pl->name, 13); - currentSaveFile.write(dummy, 1); - currentSaveFile.writeSint16LE(pl->spriteId); - currentSaveFile.write(dummy, 2); - - if (pl->saveSize) { - char* buffer = (char*)malloc(pl->saveSize); - memset(buffer, 0, pl->saveSize); - currentSaveFile.write(buffer, pl->saveSize); - free(buffer); - } - - pl = pl->next; - } -} - -void loadBackgroundIncrustFromSave(Common::InSaveFile& currentSaveFile) { - int16 numEntry; - int32 i; - - numEntry = currentSaveFile.readSint16LE(); - - backgroundIncrustStruct *pl = &backgroundIncrustHead; - backgroundIncrustStruct *pl1 = &backgroundIncrustHead; - - for (i = 0; i < numEntry; i++) { - backgroundIncrustStruct *pl2 = (backgroundIncrustStruct *)mallocAndZero(sizeof(backgroundIncrustStruct)); - - currentSaveFile.skip(2); - currentSaveFile.skip(2); - - pl2->objectIdx = currentSaveFile.readSint16LE(); - pl2->type = currentSaveFile.readSint16LE(); - pl2->overlayIdx = currentSaveFile.readSint16LE(); - pl2->X = currentSaveFile.readSint16LE(); - pl2->Y = currentSaveFile.readSint16LE(); - pl2->field_E = currentSaveFile.readSint16LE(); - pl2->scale = currentSaveFile.readSint16LE(); - pl2->backgroundIdx = currentSaveFile.readSint16LE(); - pl2->scriptNumber = currentSaveFile.readSint16LE(); - pl2->scriptOverlayIdx = currentSaveFile.readSint16LE(); - currentSaveFile.skip(4); - pl2->saveWidth = currentSaveFile.readSint16LE() * 2; - pl2->saveHeight = currentSaveFile.readSint16LE(); - pl2->saveSize = currentSaveFile.readUint16LE(); - pl2->savedX = currentSaveFile.readSint16LE(); - pl2->savedY = currentSaveFile.readSint16LE(); - currentSaveFile.read(pl2->name, 13); - currentSaveFile.skip(1); - pl2->spriteId = currentSaveFile.readSint16LE(); - currentSaveFile.skip(2); - - if (pl2->saveSize) { - /*pl2->ptr = (uint8 *) mallocAndZero(pl2->size); - currentSaveFile.read(pl2->ptr, pl2->size);*/ - - currentSaveFile.skip(pl2->saveSize); - - int width = pl2->saveWidth; - int height = pl2->saveHeight; - pl2->ptr = (uint8*)malloc(width * height); - memset(pl2->ptr, 0, width * height); - - // TODO: convert graphic format here - } - - pl2->next = NULL; - pl->next = pl2; - - pl2->prev = pl1->prev; - pl1->prev = pl2; - - pl = pl2; - } -} - void regenerateBackgroundIncrust(backgroundIncrustStruct *pHead) { lastAni[0] = 0; |