summaryrefslogtreecommitdiffstats
path: root/src/emu/render.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-07-21 11:47:41 +1000
committer Vas Crabb <vas@vastheman.com>2017-07-21 11:47:41 +1000
commit05e84dccc04849857ebc4460084bdafc872d5815 (patch)
treef20a0a1f88d6ee1cedec9f8b2861b09acb6c0ada /src/emu/render.cpp
parent431879ef2b675540cc3987d90b4d069a49854897 (diff)
* Make XML file a class of its own managed with smart poitners
* Save/restore a little more of Cocoa debugger state
Diffstat (limited to 'src/emu/render.cpp')
-rw-r--r--src/emu/render.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 5b243306a9c..29fd2e42a63 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -1700,14 +1700,16 @@ bool render_target::load_layout_file(const char *dirname, const internal_layout
bool render_target::load_layout_file(const char *dirname, const char *filename)
{
- // if the first character of the "file" is an open brace, assume it is an XML string
- util::xml::data_node *rootnode;
+ util::xml::file::ptr rootnode;
if (filename[0] == '<')
- rootnode = util::xml::data_node::string_read(filename, nullptr);
-
- // otherwise, assume it is a file
+ {
+ // if the first character of the "file" is an open brace, assume it is an XML string
+ rootnode = util::xml::file::string_read(filename, nullptr);
+ }
else
{
+ // otherwise, assume it is a file
+
// build the path and optionally prepend the directory
std::string fname = std::string(filename).append(".lay");
if (dirname != nullptr)
@@ -1720,7 +1722,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename)
return false;
// read the file
- rootnode = util::xml::data_node::file_read(layoutfile, nullptr);
+ rootnode = util::xml::file::read(layoutfile, nullptr);
}
// if we didn't get a properly-formatted XML file, record a warning and exit
@@ -1751,7 +1753,6 @@ bool render_target::load_layout_file(const char *dirname, const char *filename)
emulator_info::layout_file_cb(*rootnode);
// free the root node
- rootnode->file_free();
return result;
}