Skip to content

Commit

Permalink
FREESCAPE: added ankh indicator for eclipse in dos/cpc
Browse files Browse the repository at this point in the history
  • Loading branch information
neuromancer committed Feb 25, 2024
1 parent a0f4705 commit 66bc819
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified dists/engine-data/freescape.dat
Binary file not shown.
11 changes: 5 additions & 6 deletions engines/freescape/games/eclipse/cpc.cpp
Expand Up @@ -65,13 +65,11 @@ void EclipseEngine::loadAssetsCPCDemo() {
}
loadColorPalette();
swapPalette(1);
//_indicators.push_back(loadBundledImage("dark_fallen_indicator"));
//_indicators.push_back(loadBundledImage("dark_crouch_indicator"));
//_indicators.push_back(loadBundledImage("dark_walk_indicator"));
//_indicators.push_back(loadBundledImage("dark_jet_indicator"));

//for (auto &it : _indicators)
// it->convertToInPlace(_gfx->_texturePixelFormat);
_indicators.push_back(loadBundledImage("eclipse_ankh_indicator"));

for (auto &it : _indicators)
it->convertToInPlace(_gfx->_texturePixelFormat);
}

void EclipseEngine::drawCPCUI(Graphics::Surface *surface) {
Expand Down Expand Up @@ -111,6 +109,7 @@ void EclipseEngine::drawCPCUI(Graphics::Surface *surface) {
drawStringInSurface("<", 240, 135, back, front, surface, 'Z' - '$' + 1);
}
drawAnalogClock(surface, 90, 172, back, other, front);
drawIndicator(surface, 45, 4, 12);
}

} // End of namespace Freescape
7 changes: 7 additions & 0 deletions engines/freescape/games/eclipse/dos.cpp
Expand Up @@ -66,6 +66,12 @@ void EclipseEngine::loadAssetsDOSFullGame() {
}
_border = load8bitBinImage(&file, 0x210);
_border->setPalette((byte *)&kEGADefaultPalette, 0, 16);

_indicators.push_back(loadBundledImage("eclipse_ankh_indicator"));

for (auto &it : _indicators)
it->convertToInPlace(_gfx->_texturePixelFormat);

} else if (_renderMode == Common::kRenderCGA) {
file.open("SCN1C.DAT");
if (file.isOpen()) {
Expand Down Expand Up @@ -135,6 +141,7 @@ void EclipseEngine::drawDOSUI(Graphics::Surface *surface) {
Common::Rect jarWater(124, 192 - _gameStateVars[k8bitVariableEnergy], 148, 192);
surface->fillRect(jarWater, blue);

drawIndicator(surface, 41, 4, 16);
}

soundFx *EclipseEngine::load1bPCM(Common::SeekableReadStream *file, int offset) {
Expand Down
11 changes: 11 additions & 0 deletions engines/freescape/games/eclipse/eclipse.cpp
Expand Up @@ -335,6 +335,17 @@ void EclipseEngine::drawAnalogClockHand(Graphics::Surface *surface, int x, int y
surface->drawLine(x, y, x+(int)w, y+(int)h, color);
}

void EclipseEngine::drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition, int separation) {
if (_indicators.size() == 0)
return;

for (int i = 0; i < 5; i++) {
if (_gameStateVars[kVariableEclipseAnkhs] > i)
continue;
surface->copyRectToSurface(*_indicators[0], xPosition + separation * i, yPosition, Common::Rect(_indicators[0]->w, _indicators[0]->h));
}
}

void EclipseEngine::updateTimeVariables() {
if (_gameStateControl != kFreescapeGameStatePlaying)
return;
Expand Down
5 changes: 5 additions & 0 deletions engines/freescape/games/eclipse/eclipse.h
Expand Up @@ -30,6 +30,10 @@ enum EclipseReleaseFlags {
GF_ZX_DEMO_MICROHOBBY = (1 << 1),
};

enum {
kVariableEclipseAnkhs = 32,
};

class EclipseEngine : public FreescapeEngine {
public:
EclipseEngine(OSystem *syst, const ADGameDescription *gd);
Expand All @@ -39,6 +43,7 @@ class EclipseEngine : public FreescapeEngine {
void borderScreen() override;
void titleScreen() override;
void drawInfoMenu() override;
void drawIndicator(Graphics::Surface *surface, int xPosition, int yPosition, int separation);

void loadAssets() override;
void loadAssetsDOSFullGame() override;
Expand Down

0 comments on commit 66bc819

Please sign in to comment.