1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Added RenderHandler that acts as factory for images and animations

This commit is contained in:
Ivan Savenko
2023-09-04 18:01:44 +03:00
parent 3f921fa771
commit 1d0e696db6
38 changed files with 246 additions and 126 deletions

View File

@@ -30,6 +30,7 @@
#include "../widgets/TextControls.h"
#include "../adventureMap/AdventureMapInterface.h"
#include "../render/CAnimation.h"
#include "../render/IRenderHandler.h"
#include "../../CCallback.h"
@@ -169,15 +170,15 @@ CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _m
leftCorner = std::make_shared<CPicture>(ImagePath::builtin("SpelTrnL.bmp"), 97, 77);
rightCorner = std::make_shared<CPicture>(ImagePath::builtin("SpelTrnR.bmp"), 487, 72);
spellIcons = std::make_shared<CAnimation>(AnimationPath::builtin("Spells"));
spellIcons = GH.renderHandler().loadAnimation(AnimationPath::builtin("Spells"));
schoolTab = std::make_shared<CAnimImage>(AnimationPath::builtin("SpelTab"), selectedTab, 0, 524, 88);
schoolPicture = std::make_shared<CAnimImage>(AnimationPath::builtin("Schools"), 0, 0, 117, 74);
schoolBorders[0] = std::make_shared<CAnimation>(AnimationPath::builtin("SplevA.def"));
schoolBorders[1] = std::make_shared<CAnimation>(AnimationPath::builtin("SplevF.def"));
schoolBorders[2] = std::make_shared<CAnimation>(AnimationPath::builtin("SplevW.def"));
schoolBorders[3] = std::make_shared<CAnimation>(AnimationPath::builtin("SplevE.def"));
schoolBorders[0] = GH.renderHandler().loadAnimation(AnimationPath::builtin("SplevA.def"));
schoolBorders[1] = GH.renderHandler().loadAnimation(AnimationPath::builtin("SplevF.def"));
schoolBorders[2] = GH.renderHandler().loadAnimation(AnimationPath::builtin("SplevW.def"));
schoolBorders[3] = GH.renderHandler().loadAnimation(AnimationPath::builtin("SplevE.def"));
for(auto item : schoolBorders)
item->preload();