mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Gui cleanup4 (#446)
* use smart pointers for almost all widget fields * use SDL2 texture for cursor * a lot af small tweaks and formatting * removed CompImage class, it is actually useless as long as regular SDLImage support margins * CGuiHandler: use smart pointers for [push|pop]Int
This commit is contained in:
committed by
ArseniyShestakov
parent
7c8b74a806
commit
75f8c8b29a
@@ -396,7 +396,7 @@ void CVideoPlayer::close()
|
||||
}
|
||||
|
||||
// Plays a video. Only works for overlays.
|
||||
bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
|
||||
bool CVideoPlayer::playVideo(int x, int y, bool stopOnKey)
|
||||
{
|
||||
// Note: either the windows player or the linux player is
|
||||
// broken. Compensate here until the bug is found.
|
||||
@@ -407,11 +407,10 @@ bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
|
||||
|
||||
while(nextFrame())
|
||||
{
|
||||
|
||||
if(stopOnKey && keyDown())
|
||||
return false;
|
||||
|
||||
SDL_RenderCopy(mainRenderer, texture, NULL, &pos);
|
||||
SDL_RenderCopy(mainRenderer, texture, nullptr, &pos);
|
||||
SDL_RenderPresent(mainRenderer);
|
||||
|
||||
// Wait 3 frames
|
||||
@@ -423,10 +422,10 @@ bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CVideoPlayer::openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey, bool scale)
|
||||
bool CVideoPlayer::openAndPlayVideo(std::string name, int x, int y, bool stopOnKey, bool scale)
|
||||
{
|
||||
open(name, false, true, scale);
|
||||
bool ret = playVideo(x, y, dst, stopOnKey);
|
||||
bool ret = playVideo(x, y, stopOnKey);
|
||||
close();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user