FREESCAPE: refactor indicator loading for castle dos

This commit is contained in:
neuromancer 2024-08-24 19:04:32 +02:00
parent a9083ab9a1
commit b27fd58ca7
3 changed files with 28 additions and 25 deletions

View File

@ -425,6 +425,33 @@ void CastleEngine::executePrint(FCLInstruction &instruction) {
}
void CastleEngine::loadAssets() {
FreescapeEngine::loadAssets();
if (isDOS()) {
_menu = loadBundledImage("castle_menu");
assert(_menu);
_menu->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtBackgroundFrame = loadBundledImage("castle_strength_background");
_strenghtBackgroundFrame->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtBarFrame = loadBundledImage("castle_strength_bar");
_strenghtBarFrame->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_0"));
_strenghtWeightsFrames[0]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_1"));
_strenghtWeightsFrames[1]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_2"));
_strenghtWeightsFrames[2]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_3"));
_strenghtWeightsFrames[3]->convertToInPlace(_gfx->_texturePixelFormat);
}
}
void CastleEngine::loadRiddles(Common::SeekableReadStream *file, int offset, int number) {
file->seek(offset);
debugC(1, kFreescapeDebugParser, "Riddle table:");

View File

@ -34,6 +34,7 @@ public:
void endGame() override;
void drawInfoMenu() override;
void loadAssets() override;
void loadAssetsDOSFullGame() override;
void loadAssetsDOSDemo() override;
void loadAssetsAmigaDemo() override;

View File

@ -148,28 +148,6 @@ void CastleEngine::loadAssetsDOSFullGame() {
_areaMap[1]->addFloor();
_areaMap[2]->addFloor();
delete stream;
_menu = loadBundledImage("castle_menu");
assert(_menu);
_menu->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtBackgroundFrame = loadBundledImage("castle_strength_background");
_strenghtBackgroundFrame->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtBarFrame = loadBundledImage("castle_strength_bar");
_strenghtBarFrame->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_0"));
_strenghtWeightsFrames[0]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_1"));
_strenghtWeightsFrames[1]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_2"));
_strenghtWeightsFrames[2]->convertToInPlace(_gfx->_texturePixelFormat);
_strenghtWeightsFrames.push_back(loadBundledImage("castle_strength_weight_3"));
_strenghtWeightsFrames[3]->convertToInPlace(_gfx->_texturePixelFormat);
} else
error("Not implemented yet");
@ -226,9 +204,6 @@ void CastleEngine::loadAssetsDOSDemo() {
_areaMap[1]->addFloor();
_areaMap[2]->addFloor();
delete stream;
_menu = loadBundledImage("castle_menu");
assert(_menu);
_menu->convertToInPlace(_gfx->_texturePixelFormat);
} else
error("Not implemented yet");
}