mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
add api to enable|disable scaling (unimplemented)
This commit is contained in:
@ -516,13 +516,20 @@ void CSpellWindow::deactivate()
|
|||||||
void CSpellWindow::turnPageLeft()
|
void CSpellWindow::turnPageLeft()
|
||||||
{
|
{
|
||||||
if (settings["video"]["spellbookAnimation"].Bool())
|
if (settings["video"]["spellbookAnimation"].Bool())
|
||||||
|
{
|
||||||
|
CCS->videoh->setScaling(false);
|
||||||
CCS->videoh->openAndPlayVideo("PGTRNLFT.SMK", pos.x+13, pos.y+15, screen);
|
CCS->videoh->openAndPlayVideo("PGTRNLFT.SMK", pos.x+13, pos.y+15, screen);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpellWindow::turnPageRight()
|
void CSpellWindow::turnPageRight()
|
||||||
{
|
{
|
||||||
if (settings["video"]["spellbookAnimation"].Bool())
|
if (settings["video"]["spellbookAnimation"].Bool())
|
||||||
|
{
|
||||||
|
CCS->videoh->setScaling(false);
|
||||||
CCS->videoh->openAndPlayVideo("PGTRNRGH.SMK", pos.x+13, pos.y+15, screen);
|
CCS->videoh->openAndPlayVideo("PGTRNRGH.SMK", pos.x+13, pos.y+15, screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpellWindow::keyPressed(const SDL_KeyboardEvent & key)
|
void CSpellWindow::keyPressed(const SDL_KeyboardEvent & key)
|
||||||
|
@ -71,6 +71,8 @@ CVideoPlayer::CVideoPlayer()
|
|||||||
// combination of av_register_input_format() /
|
// combination of av_register_input_format() /
|
||||||
// av_register_output_format() / av_register_protocol() instead.
|
// av_register_output_format() / av_register_protocol() instead.
|
||||||
av_register_all();
|
av_register_all();
|
||||||
|
|
||||||
|
doScale = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVideoPlayer::open(std::string fname)
|
bool CVideoPlayer::open(std::string fname)
|
||||||
|
@ -14,6 +14,8 @@ public:
|
|||||||
virtual bool wait()=0;
|
virtual bool wait()=0;
|
||||||
virtual int curFrame() const =0;
|
virtual int curFrame() const =0;
|
||||||
virtual int frameCount() const =0;
|
virtual int frameCount() const =0;
|
||||||
|
|
||||||
|
virtual void setScaling(bool enabled) =0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -40,6 +42,7 @@ public:
|
|||||||
virtual void close() {};
|
virtual void close() {};
|
||||||
virtual bool wait() {return false;};
|
virtual bool wait() {return false;};
|
||||||
virtual bool open( std::string name ) {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 refreshWait; // Wait several refresh before updating the image
|
||||||
int refreshCount;
|
int refreshCount;
|
||||||
bool doLoop; // loop through video
|
bool doLoop; // loop through video
|
||||||
|
|
||||||
|
bool doScale;
|
||||||
|
|
||||||
bool playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey);
|
bool playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey);
|
||||||
bool open(std::string fname, bool loop, bool useOverlay = false);
|
bool open(std::string fname, bool loop, bool useOverlay = false);
|
||||||
@ -108,6 +113,8 @@ public:
|
|||||||
int curFrame() const {return -1;};
|
int curFrame() const {return -1;};
|
||||||
int frameCount() const {return -1;};
|
int frameCount() const {return -1;};
|
||||||
|
|
||||||
|
void setScaling(bool enabled) override {doScale = enabled;};
|
||||||
|
|
||||||
// public to allow access from ffmpeg IO functions
|
// public to allow access from ffmpeg IO functions
|
||||||
std::unique_ptr<CInputStream> data;
|
std::unique_ptr<CInputStream> data;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user