mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-07 00:58:39 +02:00
Merge pull request #3416 from Laserlicht/video_campaign_fix
video position for campaigns
This commit is contained in:
@ -615,6 +615,14 @@ std::pair<std::unique_ptr<ui8 []>, si64> CVideoPlayer::getAudio(const VideoPath
|
|||||||
return dat;
|
return dat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point CVideoPlayer::size()
|
||||||
|
{
|
||||||
|
if(frame)
|
||||||
|
return Point(frame->width, frame->height);
|
||||||
|
else
|
||||||
|
return Point(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Plays a video. Only works for overlays.
|
// Plays a video. Only works for overlays.
|
||||||
bool CVideoPlayer::playVideo(int x, int y, bool stopOnKey)
|
bool CVideoPlayer::playVideo(int x, int y, bool stopOnKey)
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
virtual std::pair<std::unique_ptr<ui8 []>, si64> getAudio(const VideoPath & videoToOpen) { return std::make_pair(nullptr, 0); };
|
virtual std::pair<std::unique_ptr<ui8 []>, si64> getAudio(const VideoPath & videoToOpen) { return std::make_pair(nullptr, 0); };
|
||||||
|
virtual Point size() { return Point(0, 0); };
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEmptyVideoPlayer final : public IMainVideoPlayer
|
class CEmptyVideoPlayer final : public IMainVideoPlayer
|
||||||
@ -109,6 +110,8 @@ public:
|
|||||||
|
|
||||||
std::pair<std::unique_ptr<ui8 []>, si64> getAudio(const VideoPath & videoToOpen) override;
|
std::pair<std::unique_ptr<ui8 []>, si64> getAudio(const VideoPath & videoToOpen) override;
|
||||||
|
|
||||||
|
Point size() override;
|
||||||
|
|
||||||
//TODO:
|
//TODO:
|
||||||
bool wait() override {return false;};
|
bool wait() override {return false;};
|
||||||
int curFrame() const override {return -1;};
|
int curFrame() const override {return -1;};
|
||||||
|
@ -45,10 +45,8 @@ CPrologEpilogVideo::CPrologEpilogVideo(CampaignScenarioPrologEpilog _spe, std::f
|
|||||||
void CPrologEpilogVideo::show(Canvas & to)
|
void CPrologEpilogVideo::show(Canvas & to)
|
||||||
{
|
{
|
||||||
to.drawColor(pos, Colors::BLACK);
|
to.drawColor(pos, Colors::BLACK);
|
||||||
//BUG: some videos are 800x600 in size while some are 800x400
|
//some videos are 800x600 in size while some are 800x400
|
||||||
//VCMI should center them in the middle of the screen. Possible but needs modification
|
CCS->videoh->update(pos.x, pos.y + (CCS->videoh->size().y == 400 ? 100 : 0), to.getInternalSurface(), true, false);
|
||||||
//of video player API which I'd like to avoid until we'll get rid of Windows-specific player
|
|
||||||
CCS->videoh->update(pos.x, pos.y, to.getInternalSurface(), true, false);
|
|
||||||
|
|
||||||
//move text every 5 calls/frames; seems to be good enough
|
//move text every 5 calls/frames; seems to be good enough
|
||||||
++positionCounter;
|
++positionCounter;
|
||||||
|
Reference in New Issue
Block a user