support the allowSkipping extra parameter for playBink command.

actorid
scrawl 12 years ago
parent 35f4d09288
commit 282601d6e9

@ -305,7 +305,7 @@ namespace MWBase
/// \todo this does not belong here
virtual void playVideo(const std::string& name) = 0;
virtual void playVideo(const std::string& name, bool allowSkipping) = 0;
virtual void stopVideo() = 0;
};
}

@ -929,14 +929,14 @@ void RenderingManager::setupExternalRendering (MWRender::ExternalRendering& rend
rendering.setup (mRendering.getScene());
}
void RenderingManager::playVideo(const std::string& name)
void RenderingManager::playVideo(const std::string& name, bool allowSkipping)
{
mVideoPlayer->playVideo ("video/" + name);
mVideoPlayer->playVideo ("video/" + name, allowSkipping);
}
void RenderingManager::stopVideo()
{
mVideoPlayer->close ();
mVideoPlayer->stopVideo ();
}
} // namespace

@ -196,7 +196,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
void setupExternalRendering (MWRender::ExternalRendering& rendering);
void playVideo(const std::string& name);
void playVideo(const std::string& name, bool allowSkipping);
void stopVideo();
protected:

@ -1010,6 +1010,7 @@ VideoPlayer::VideoPlayer(Ogre::SceneManager* sceneMgr)
, mVideoMaterial(NULL)
, mRectangle(NULL)
, mNode(NULL)
, mAllowSkipping(false)
{
mVideoMaterial = Ogre::MaterialManager::getSingleton().getByName("VideoMaterial", "General");
if (mVideoMaterial.isNull ())
@ -1071,8 +1072,10 @@ VideoPlayer::~VideoPlayer()
delete mBackgroundRectangle;
}
void VideoPlayer::playVideo(const std::string &resourceName)
void VideoPlayer::playVideo(const std::string &resourceName, bool allowSkipping)
{
mAllowSkipping = allowSkipping;
if(mState)
close();
@ -1113,6 +1116,12 @@ void VideoPlayer::update ()
}
}
void VideoPlayer::stopVideo ()
{
if (mAllowSkipping)
close();
}
void VideoPlayer::close()
{
if(mState)

@ -20,11 +20,12 @@ namespace MWRender
VideoPlayer(Ogre::SceneManager* sceneMgr);
~VideoPlayer();
void playVideo (const std::string& resourceName);
void playVideo (const std::string& resourceName, bool allowSkipping);
void update();
void close();
void stopVideo();
bool isPlaying();
@ -34,6 +35,8 @@ namespace MWRender
private:
VideoState* mState;
bool mAllowSkipping;
Ogre::SceneManager* mSceneMgr;
Ogre::MaterialPtr mVideoMaterial;
Ogre::Rectangle2D* mRectangle;

@ -34,7 +34,10 @@ namespace MWScript
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWBase::Environment::get().getWorld ()->playVideo (name);
bool allowSkipping = runtime[0].mInteger;
runtime.pop();
MWBase::Environment::get().getWorld ()->playVideo (name, allowSkipping);
}
};
@ -465,7 +468,7 @@ namespace MWScript
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
extensions.registerInstruction ("wakeuppc", "", opcodeWakeUpPc);
extensions.registerInstruction ("playbink", "S", opcodePlayBink);
extensions.registerInstruction ("playbink", "Sl", opcodePlayBink);
extensions.registerFunction ("getlocked", 'l', "", opcodeGetLocked, opcodeGetLockedExplicit);
extensions.registerFunction ("geteffect", 'l', "l", opcodeGetEffect, opcodeGetEffectExplicit);
extensions.registerFunction ("getattacked", 'l', "", opcodeGetAttacked, opcodeGetAttackedExplicit);

@ -1287,9 +1287,9 @@ namespace MWWorld
}
void World::playVideo (const std::string &name)
void World::playVideo (const std::string &name, bool allowSkipping)
{
mRendering->playVideo(name);
mRendering->playVideo(name, allowSkipping);
}
void World::stopVideo ()

@ -334,7 +334,7 @@ namespace MWWorld
/// 3 - enemies are nearby (not implemented)
/// \todo this does not belong here
virtual void playVideo(const std::string& name);
virtual void playVideo(const std::string& name, bool allowSkipping);
virtual void stopVideo();
};
}

Loading…
Cancel
Save