Skip to content

Commit

Permalink
KOTOR: Make the GUI hold its GFF3File Object
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Nov 7, 2017
1 parent 08e09fa commit 14245eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/engines/kotor/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ void GUI::load(const Common::UString &resref, float width, float height) {
_name = resref;

try {
Common::ScopedPtr<Aurora::GFF3File>
gff(new Aurora::GFF3File(resref, Aurora::kFileTypeGUI, MKTAG('G', 'U', 'I', ' ')));
_gff.reset(new Aurora::GFF3File(resref, Aurora::kFileTypeGUI, MKTAG('G', 'U', 'I', ' ')));

loadWidget(gff->getTopLevel(), 0, width, height);
loadWidget(_gff->getTopLevel(), 0, width, height);

} catch (Common::Exception &e) {
e.add("Can't load GUI \"%s\"", resref.c_str());
Expand Down
3 changes: 3 additions & 0 deletions src/engines/kotor/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "src/common/scopedptr.h"

#include "src/aurora/types.h"
#include "src/aurora/gff3file.h"

#include "src/graphics/aurora/types.h"
#include "src/graphics/aurora/highlightable.h"
Expand Down Expand Up @@ -115,6 +116,8 @@ class GUI : public Engines::GUI {

Common::ScopedPtr<GUIBackground> _background;

Common::ScopedPtr<Aurora::GFF3File> _gff;

Common::UString _name;

void loadWidget(const Aurora::GFF3Struct &strct, Widget *parent, float width, float height);
Expand Down

0 comments on commit 14245eb

Please sign in to comment.