mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
GOB: fix a black screen after the paint game in some Adibou2 versions
Related to a weird video mode ("0x18"), in which some surfaces must not be reset when re-calling the initScreen() opcode.
This commit is contained in:
parent
e79da632b6
commit
0ad57d3c09
@ -312,6 +312,8 @@ class Draw_v7 : public Draw_Playtoons {
|
||||
public:
|
||||
Draw_v7(GobEngine *vm);
|
||||
~Draw_v7() override;
|
||||
|
||||
void initScreen() override;
|
||||
void animateCursor(int16 cursor) override;
|
||||
|
||||
|
||||
|
@ -106,6 +106,32 @@ bool Draw_v7::loadCursorFromFile(int cursorIndex) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Draw_v7::initScreen()
|
||||
{
|
||||
_vm->_game->_preventScroll = false;
|
||||
|
||||
_scrollOffsetX = 0;
|
||||
_scrollOffsetY = 0;
|
||||
|
||||
if (!_spritesArray[kBackSurface] || _vm->_global->_videoMode != 0x18) {
|
||||
initSpriteSurf(kBackSurface, _vm->_video->_surfWidth, _vm->_video->_surfHeight, 0);
|
||||
_backSurface = _spritesArray[kBackSurface];
|
||||
_backSurface->clear();
|
||||
}
|
||||
|
||||
if (!_spritesArray[kCursorSurface]) {
|
||||
initSpriteSurf(kCursorSurface, 32, 16, 2);
|
||||
_cursorSpritesBack = _spritesArray[kCursorSurface];
|
||||
_cursorSprites = _cursorSpritesBack;
|
||||
_scummvmCursor = _vm->_video->initSurfDesc(16, 16, SCUMMVM_CURSOR);
|
||||
}
|
||||
|
||||
_spritesArray[kFrontSurface] = _frontSurface;
|
||||
_spritesArray[kBackSurface ] = _backSurface;
|
||||
|
||||
_vm->_video->dirtyRectsAll();
|
||||
}
|
||||
|
||||
void Draw_v7::animateCursor(int16 cursor) {
|
||||
if (!_cursorSprites)
|
||||
return;
|
||||
|
@ -485,7 +485,8 @@ void Inter_v7::o7_initScreen() {
|
||||
if (videoMode == 0)
|
||||
videoMode = 0x14;
|
||||
|
||||
_vm->_video->clearScreen();
|
||||
if (videoMode != 0x18)
|
||||
_vm->_video->clearScreen();
|
||||
|
||||
if (videoMode == 0x13) {
|
||||
|
||||
@ -540,25 +541,30 @@ void Inter_v7::o7_initScreen() {
|
||||
_vm->_global->_mouseMaxY = (_vm->_video->_surfHeight + _vm->_video->_screenDeltaY) - offY - 1;
|
||||
_vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
|
||||
|
||||
_vm->_draw->closeScreen();
|
||||
_vm->_util->clearPalette();
|
||||
memset(_vm->_global->_redPalette, 0, 256);
|
||||
memset(_vm->_global->_greenPalette, 0, 256);
|
||||
memset(_vm->_global->_bluePalette, 0, 256);
|
||||
|
||||
_vm->_video->_splitSurf.reset();
|
||||
_vm->_draw->_spritesArray[24].reset();
|
||||
_vm->_draw->_spritesArray[25].reset();
|
||||
if (videoMode != 0x18)
|
||||
{
|
||||
_vm->_draw->closeScreen();
|
||||
_vm->_util->clearPalette();
|
||||
memset(_vm->_global->_redPalette, 0, 256);
|
||||
memset(_vm->_global->_greenPalette, 0, 256);
|
||||
memset(_vm->_global->_bluePalette, 0, 256);
|
||||
_vm->_video->_splitSurf.reset();
|
||||
_vm->_draw->_spritesArray[24].reset();
|
||||
_vm->_draw->_spritesArray[25].reset();
|
||||
}
|
||||
|
||||
_vm->_global->_videoMode = videoMode;
|
||||
_vm->_video->initPrimary(videoMode);
|
||||
if (videoMode != 0x18)
|
||||
_vm->_video->initPrimary(videoMode);
|
||||
WRITE_VAR(15, _vm->_global->_fakeVideoMode);
|
||||
|
||||
_vm->_global->_setAllPalette = true;
|
||||
|
||||
_vm->_util->setMousePos(_vm->_global->_inter_mouseX,
|
||||
_vm->_global->_inter_mouseY);
|
||||
_vm->_util->clearPalette();
|
||||
|
||||
if (videoMode != 0x18)
|
||||
_vm->_util->clearPalette();
|
||||
|
||||
_vm->_draw->initScreen();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user