mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Merge pull request #3998 from IvanSavenko/refactor_sdl_media
[1.6] Reorganize SDL sound/music/video handling
This commit is contained in:
@@ -19,9 +19,7 @@
|
||||
#include "../CGameInfo.h"
|
||||
#include "../CServerHandler.h"
|
||||
#include "../Client.h"
|
||||
#include "../CMusicHandler.h"
|
||||
#include "../CPlayerInterface.h"
|
||||
#include "../CVideoHandler.h"
|
||||
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/CursorHandler.h"
|
||||
@@ -36,6 +34,7 @@
|
||||
#include "../widgets/Slider.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/ObjectLists.h"
|
||||
#include "../widgets/VideoWidget.h"
|
||||
|
||||
#include "../render/Canvas.h"
|
||||
#include "../render/CAnimation.h"
|
||||
@@ -58,6 +57,7 @@
|
||||
#include "../lib/GameSettings.h"
|
||||
#include "../lib/CondSh.h"
|
||||
#include "../lib/CSkillHandler.h"
|
||||
#include "../lib/CSoundBase.h"
|
||||
#include "../lib/filesystem/Filesystem.h"
|
||||
#include "../lib/TextOperations.h"
|
||||
|
||||
@@ -515,11 +515,11 @@ CTavernWindow::CTavernWindow(const CGObjectInstance * TavernObj, const std::func
|
||||
recruit->block(true);
|
||||
}
|
||||
if(LOCPLINT->castleInt)
|
||||
CCS->videoh->open(LOCPLINT->castleInt->town->town->clientInfo.tavernVideo);
|
||||
videoPlayer = std::make_shared<VideoWidget>(Point(70, 56), LOCPLINT->castleInt->town->town->clientInfo.tavernVideo, false);
|
||||
else if(const auto * townObj = dynamic_cast<const CGTownInstance *>(TavernObj))
|
||||
CCS->videoh->open(townObj->town->clientInfo.tavernVideo);
|
||||
videoPlayer = std::make_shared<VideoWidget>(Point(70, 56), townObj->town->clientInfo.tavernVideo, false);
|
||||
else
|
||||
CCS->videoh->open(VideoPath::builtin("TAVERN.BIK"));
|
||||
videoPlayer = std::make_shared<VideoWidget>(Point(70, 56), VideoPath::builtin("TAVERN.BIK"), false);
|
||||
|
||||
addInvite();
|
||||
}
|
||||
@@ -572,11 +572,6 @@ void CTavernWindow::close()
|
||||
CStatusbarWindow::close();
|
||||
}
|
||||
|
||||
CTavernWindow::~CTavernWindow()
|
||||
{
|
||||
CCS->videoh->close();
|
||||
}
|
||||
|
||||
void CTavernWindow::show(Canvas & to)
|
||||
{
|
||||
CWindowObject::show(to);
|
||||
@@ -600,8 +595,6 @@ void CTavernWindow::show(Canvas & to)
|
||||
|
||||
to.drawBorder(Rect::createAround(sel->pos, 2), Colors::BRIGHT_YELLOW, 2);
|
||||
}
|
||||
|
||||
CCS->videoh->update(pos.x+70, pos.y+56, to.getInternalSurface(), true, false);
|
||||
}
|
||||
|
||||
void CTavernWindow::HeroPortrait::clickPressed(const Point & cursorPosition)
|
||||
|
||||
Reference in New Issue
Block a user