STARK: Don't show the cursor during FMVs

This commit is contained in:
Bastien Bouclet 2018-04-08 19:56:24 +02:00
parent ce355587ba
commit f15f8b3996
7 changed files with 12 additions and 15 deletions

View File

@ -70,8 +70,9 @@ void AnimSoundTrigger::onGameLoop() {
if (_subType == kAnimTriggerSound) {
Location *location = StarkGlobal->getCurrent()->getLocation();
Sound *sound = location->findStockSound(_soundStockType);
if (sound) {
if (sound && !StarkGlobal->isFastForward()) {
// TODO: If the location has a 3D layer set the source position of the sound to the item position
sound->stop();
sound->play();
}
} else {

View File

@ -171,8 +171,10 @@ void UserInterface::render() {
_currentScreen->render();
// The cursor depends on the UI being done.
if (_currentScreen->getName() != Screen::kScreenFMV) {
_cursor->render();
}
}
bool UserInterface::isInteractive() const {
return _interactive;

View File

@ -43,7 +43,7 @@ Cursor::Cursor(Gfx::Driver *gfx) :
_gfx(gfx),
_cursorImage(nullptr),
_mouseText(nullptr),
_currentCursorType(kNone),
_currentCursorType(kImage),
_fading(false),
_fadeLevelIncreasing(true),
_fadeLevel(0) {
@ -55,24 +55,19 @@ Cursor::~Cursor() {
}
void Cursor::setCursorType(CursorType type) {
assert(type != kImage);
if (type == _currentCursorType) {
return;
}
_currentCursorType = type;
if (type == kNone) {
_cursorImage = nullptr;
return;
}
_cursorImage = StarkStaticProvider->getCursorImage(_currentCursorType);
}
void Cursor::setCursorImage(VisualImageXMG *image) {
_currentCursorType = kNone;
_currentCursorType = kImage;
_cursorImage = image;
}
void Cursor::setMousePosition(const Common::Point &pos) {
_mousePos = pos;
}
@ -100,7 +95,6 @@ void Cursor::updateFadeLevel() {
void Cursor::render() {
updateFadeLevel();
if (!_gfx->isPosInScreenBounds(_mousePos)) {
setCursorType(Cursor::kPassive);
}

View File

@ -55,7 +55,7 @@ public:
Common::Point getMousePosition(bool unscaled = false) const;
enum CursorType {
kNone = -1,
kImage = -1,
kDefault = 0,
kActive = 3,
kPassive = 9,

View File

@ -40,7 +40,7 @@ FMVScreen::FMVScreen(Gfx::Driver *gfx, Cursor *cursor) :
_visible = true;
_decoder = new Video::BinkDecoder();
_decoder->setDefaultHighColorFormat(_gfx->getRGBAPixelFormat());
_decoder->setDefaultHighColorFormat(Gfx::Driver::getRGBAPixelFormat());
_decoder->setSoundType(Audio::Mixer::kSFXSoundType);
_texture = _gfx->createTexture();

View File

@ -37,7 +37,7 @@ VisualEffect::VisualEffect(VisualType type, const Common::Point &size, Gfx::Driv
_timeBetweenTwoUpdates(3 * 33), // ms (frames @ 30 fps)
_timeRemainingUntilNextUpdate(0) {
_surface = new Graphics::Surface();
_surface->create(size.x, size.y, _gfx->getRGBAPixelFormat());
_surface->create(size.x, size.y, Gfx::Driver::getRGBAPixelFormat());
_texture = _gfx->createTexture(_surface);

View File

@ -113,7 +113,7 @@ void VisualText::createTexture() {
// Create a surface to render to
Graphics::Surface surface;
surface.create(scaledRect.width(), scaledRect.height(), _gfx->getRGBAPixelFormat());
surface.create(scaledRect.width(), scaledRect.height(), Gfx::Driver::getRGBAPixelFormat());
surface.fillRect(scaledRect, _backgroundColor);
// Render the lines to the surface