1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

add api to enable|disable scaling (unimplemented)

This commit is contained in:
AlexVinS 2014-07-08 17:39:47 +04:00
parent c71237bba3
commit 61b31e5c60
3 changed files with 16 additions and 0 deletions

View File

@ -516,13 +516,20 @@ void CSpellWindow::deactivate()
void CSpellWindow::turnPageLeft()
{
if (settings["video"]["spellbookAnimation"].Bool())
{
CCS->videoh->setScaling(false);
CCS->videoh->openAndPlayVideo("PGTRNLFT.SMK", pos.x+13, pos.y+15, screen);
}
}
void CSpellWindow::turnPageRight()
{
if (settings["video"]["spellbookAnimation"].Bool())
{
CCS->videoh->setScaling(false);
CCS->videoh->openAndPlayVideo("PGTRNRGH.SMK", pos.x+13, pos.y+15, screen);
}
}
void CSpellWindow::keyPressed(const SDL_KeyboardEvent & key)

View File

@ -71,6 +71,8 @@ CVideoPlayer::CVideoPlayer()
// combination of av_register_input_format() /
// av_register_output_format() / av_register_protocol() instead.
av_register_all();
doScale = true;
}
bool CVideoPlayer::open(std::string fname)

View File

@ -14,6 +14,8 @@ public:
virtual bool wait()=0;
virtual int curFrame() const =0;
virtual int frameCount() const =0;
virtual void setScaling(bool enabled) =0;
};
@ -40,6 +42,7 @@ public:
virtual void close() {};
virtual bool wait() {return false;};
virtual bool open( std::string name ) {return false;};
void setScaling(bool enabled) override {};
};
@ -83,6 +86,8 @@ class CVideoPlayer : public IMainVideoPlayer
int refreshWait; // Wait several refresh before updating the image
int refreshCount;
bool doLoop; // loop through video
bool doScale;
bool playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey);
bool open(std::string fname, bool loop, bool useOverlay = false);
@ -108,6 +113,8 @@ public:
int curFrame() const {return -1;};
int frameCount() const {return -1;};
void setScaling(bool enabled) override {doScale = enabled;};
// public to allow access from ffmpeg IO functions
std::unique_ptr<CInputStream> data;
};