From 9c4f2a5eff5a772a8494a6ca637e56a7e0a49031 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Mon, 16 May 2016 22:51:47 +0300 Subject: [PATCH] Fix having no last loaded filename for surfaces if no xml file found Previously the mesh was copied every time `BaseSurface::getMesh()` was called. --- src/Application/SettingsLoader.cpp | 4 ++++ src/Application/SettingsLoader.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp index 4466a52..cd84684 100644 --- a/src/Application/SettingsLoader.cpp +++ b/src/Application/SettingsLoader.cpp @@ -12,6 +12,10 @@ SettingsLoader * SettingsLoader::instance(){ return _instance; } +SettingsLoader::SettingsLoader(){ + _lastLoadedFilename = "surfaces.xml"; +} + bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, string fileName){ ofxXmlSettings * xmlSettings = new ofxXmlSettings(); diff --git a/src/Application/SettingsLoader.h b/src/Application/SettingsLoader.h index a39e087..0e60ed3 100644 --- a/src/Application/SettingsLoader.h +++ b/src/Application/SettingsLoader.h @@ -21,6 +21,8 @@ class SettingsLoader { private: static SettingsLoader * _instance; + + SettingsLoader(); BaseSurface * getTriangleSurface(ofxXmlSettings * xmlSettings); BaseSurface * getQuadSurface(ofxXmlSettings * xmlSettings);