mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-12 12:40:58 +00:00
AVALANCHE: Modify Graphics and Lucerna, so the engine saves the background and redraws it every time before a sprite is drawn.
This commit is contained in:
parent
b182fd814e
commit
a1f87fdaeb
@ -62,6 +62,7 @@ void Graphics::init() {
|
||||
|
||||
Graphics::~Graphics() {
|
||||
_surface.free();
|
||||
_background.free();
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +86,7 @@ void Graphics::drawBar(int16 x1, int16 y1, int16 x2, int16 y2, int16 color) {
|
||||
}
|
||||
|
||||
void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y) {
|
||||
drawPicture(_background, 0, 10);
|
||||
|
||||
/* First we make the pixels of the spirte blank. */
|
||||
for (byte qay = 0; qay < sprite.yl; qay++) {
|
||||
|
@ -57,7 +57,9 @@ public:
|
||||
static const int16 kScreenWidth = 640;
|
||||
static const int16 kScreenHeight = 200;
|
||||
|
||||
|
||||
::Graphics::Surface _background;
|
||||
|
||||
|
||||
|
||||
Graphics(AvalancheEngine *vm);
|
||||
|
||||
|
@ -245,11 +245,11 @@ void Lucerna::load(byte n) { /* Load2, actually */
|
||||
byte backgroundHeight = 8 * 12080 / _vm->_graphics->kScreenWidth; // With 640 width it's 151
|
||||
// The 8 = number of bits in a byte, and 12080 comes from the original code (see above)
|
||||
|
||||
::Graphics::Surface background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
|
||||
_vm->_graphics->_background = _vm->_graphics->loadPictureRow(f, backgroundWidht, backgroundHeight);
|
||||
|
||||
_vm->_graphics->drawPicture(background, 0, 10);
|
||||
_vm->_graphics->drawPicture(_vm->_graphics->_background, 0, 10);
|
||||
|
||||
background.free();
|
||||
_vm->_graphics->refreshScreen();
|
||||
|
||||
f.close();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user