• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Small footprint UI library for hardware accelerated games & applications


Commit MetaInfo

Revision1430affe88eafca84d971a0c065bdd0e91ee0414 (tree)
Zeit2016-12-22 05:29:38
AutorEmil Segerås <emilsegers@gmai...>
CommiterEmil Segerås

Log Message

TBSkin::Load should be callable multiple times.

Ändern Zusammenfassung

Diff

--- a/src/tb/tb_skin.cpp
+++ b/src/tb/tb_skin.cpp
@@ -128,6 +128,12 @@ TBSkin::TBSkin()
128128
129129 bool TBSkin::Load(const char *skin_file, const char *override_skin_file)
130130 {
131+ // Clear and previously loaded data.
132+ UnloadBitmaps();
133+ m_elements.DeleteAll();
134+ m_shape_nodes.Clear();
135+
136+ // Load
131137 if (!LoadInternal(skin_file))
132138 return false;
133139 if (override_skin_file && !LoadInternal(override_skin_file))
--- a/src/tb/tb_skin.h
+++ b/src/tb/tb_skin.h
@@ -303,6 +303,8 @@ public:
303303 If the skin use font glyphs, the font engine and used font has to be initialized
304304 already. Otherwise the correct font won't be used.
305305
306+ May be called multiple times to reload skin.
307+
306308 Returns true on success, and all bitmaps referred to also loaded successfully. */
307309 bool Load(const char *skin_file, const char *override_skin_file = nullptr);
308310