ASYLUM: Change getSurface to return a mutable surface

This is to allow rendering TTF on the screen
This commit is contained in:
Vladimir Serbinenko 2023-02-27 22:04:57 +01:00
parent 4599ed2b30
commit 43b42b2912
4 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ bool PuzzleWritings::init(const AsylumEvent &) {
getText()->drawCentered(Common::Point(10, 375), 590, getText()->get(MAKE_RESOURCE(kResourcePackText, textId++)));
getText()->drawCentered(Common::Point(10, 405), 590, getText()->get(MAKE_RESOURCE(kResourcePackText, textId)));
_textSurface.copyFrom(getScreen()->getSurface());
_textSurface.copyFrom(*getScreen()->getSurface());
return false;
}

View File

@ -147,8 +147,8 @@ public:
void drawRect(const Common::Rect &rect, uint32 color = 0xFF);
void copyToBackBufferClipped(Graphics::Surface *surface, int16 x, int16 y);
// Used by Writings puzzle
const Graphics::Surface &getSurface() const { return _backBuffer; };
// Used by Writings puzzle and Chinese renderer
Graphics::Surface *getSurface() { return &_backBuffer; };
private:
AsylumEngine *_vm;

View File

@ -465,7 +465,7 @@ bool Scene::action(AsylumAction a) {
break;
if (!_vm->checkGameVersion("Demo")) {
_savedScreen.copyFrom(getScreen()->getSurface());
_savedScreen.copyFrom(*getScreen()->getSurface());
memcpy(_savedPalette, getScreen()->getPalette(), sizeof(_savedPalette));
_vm->switchEventHandler(_vm->menu());
}

View File

@ -109,7 +109,7 @@ bool VideoPlayer::handleEvent(const AsylumEvent &evt) {
getText()->draw(0, 99, kTextCenter, Common::Point(10, y), 20, 620, text);
if (_vm->checkGameVersion("Steam")) {
Graphics::Surface *st = getScreen()->getSurface().convertTo(g_system->getScreenFormat(), _subtitlePalette);
Graphics::Surface *st = getScreen()->getSurface()->convertTo(g_system->getScreenFormat(), _subtitlePalette);
g_system->copyRectToScreen((const byte *)st->getBasePtr(0, 400), st->pitch, 0, 400, 640, 80);
st->free();
delete st;