mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
GOB: Add PreGob animation utility functions
This commit is contained in:
parent
aae8c60759
commit
412ae53854
@ -29,6 +29,7 @@
|
||||
#include "gob/palanim.h"
|
||||
#include "gob/draw.h"
|
||||
#include "gob/video.h"
|
||||
#include "gob/aniobject.h"
|
||||
|
||||
#include "gob/pregob/pregob.h"
|
||||
|
||||
@ -181,4 +182,24 @@ bool PreGob::hasInput() {
|
||||
return checkInput(mouseX, mouseY, mouseButtons) || (mouseButtons != kMouseButtonsNone);
|
||||
}
|
||||
|
||||
void PreGob::clearAnim(ANIObject &ani) {
|
||||
int16 left, top, right, bottom;
|
||||
|
||||
if (ani.clear(*_vm->_draw->_backSurface, left, top, right, bottom))
|
||||
_vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
|
||||
}
|
||||
|
||||
void PreGob::drawAnim(ANIObject &ani) {
|
||||
int16 left, top, right, bottom;
|
||||
|
||||
if (ani.draw(*_vm->_draw->_backSurface, left, top, right, bottom))
|
||||
_vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
|
||||
ani.advance();
|
||||
}
|
||||
|
||||
void PreGob::redrawAnim(ANIObject &ani) {
|
||||
clearAnim(ani);
|
||||
drawAnim(ani);
|
||||
}
|
||||
|
||||
} // End of namespace Gob
|
||||
|
@ -30,6 +30,8 @@ namespace Gob {
|
||||
class GobEngine;
|
||||
class Surface;
|
||||
|
||||
class ANIObject;
|
||||
|
||||
class PreGob {
|
||||
public:
|
||||
PreGob(GobEngine *vm);
|
||||
@ -71,6 +73,10 @@ protected:
|
||||
int16 waitInput();
|
||||
bool hasInput();
|
||||
|
||||
void clearAnim(ANIObject &ani);
|
||||
void drawAnim(ANIObject &ani);
|
||||
void redrawAnim(ANIObject &ani);
|
||||
|
||||
|
||||
GobEngine *_vm;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user