Index: source/tools/atlas/AtlasObject/AtlasObject.h =================================================================== --- source/tools/atlas/AtlasObject/AtlasObject.h +++ source/tools/atlas/AtlasObject/AtlasObject.h @@ -123,7 +123,7 @@ // Private implementation. (But not 'private:', because it's a waste of time // adding loads of friend functions) - AtSmartPtr p; + AtSmartPtr m_P; }; @@ -131,7 +131,7 @@ { public: AtObj() {} - AtObj(const AtObj& r) : p(r.p) {} + AtObj(const AtObj& r) : m_P(r.m_P) {} // Return an iterator to the children matching 'key' const AtIter operator[] (const char* key) const; @@ -146,7 +146,7 @@ int getInt() const; // Check whether the object contains anything (even if those things are empty) - bool defined() const { return (bool)p; } + bool defined() const { return static_cast(m_P); } // Check recursively whether there's actually any non-empty data in the object bool hasContent() const; @@ -169,7 +169,7 @@ void setString(const wchar_t* value); void addOverlay(AtObj& data); - AtSmartPtr p; + AtSmartPtr m_P; }; Index: source/tools/atlas/AtlasObject/AtlasObjectImpl.h =================================================================== --- source/tools/atlas/AtlasObject/AtlasObjectImpl.h +++ source/tools/atlas/AtlasObject/AtlasObjectImpl.h @@ -41,7 +41,7 @@ AtNode() : refcount(0) {} explicit AtNode(const AtNode* n) { *this = *n; refcount = 0; } - explicit AtNode(const wchar_t* text) : refcount(0), value(text) {} + explicit AtNode(const wchar_t* text) : refcount(0), m_Value(text) {} // Create a new AtNode (since AtNodes are immutable, so it's not possible // to just change this one), with the relevant alterations to its content. @@ -57,12 +57,12 @@ //private: // (but not actually private, since I'm still too lazy to waste // time with dozens of friends) - std::wstring value; + std::wstring m_Value; typedef std::multimap child_maptype; typedef std::pair child_pairtype; - child_maptype children; + child_maptype m_Children; private: mutable unsigned int refcount; Index: source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp =================================================================== --- source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp +++ source/tools/atlas/AtlasObject/AtlasObjectImpl.cpp @@ -20,6 +20,7 @@ #include #include +#include #include @@ -47,16 +48,16 @@ const AtIter AtIter::operator [] (const char* key) const { - if (p) - return p->iter->second->getChild(key); + if (m_P) + return m_P->iter->second->getChild(key); else return AtIter(); } AtIter::operator const wchar_t* () const { - if (p) - return p->iter->second->value.c_str(); + if (m_P) + return m_P->iter->second->m_Value.c_str(); else return L""; } @@ -64,10 +65,10 @@ //AtIter::operator const AtObj () const const AtObj AtIter::operator * () const { - if (p) + if (m_P) { AtObj ret; - ret.p = p->iter->second; + ret.m_P = m_P->iter->second; return ret; } else @@ -77,46 +78,46 @@ AtIter& AtIter::operator ++ () { - assert(p); + assert(m_P); // Increment the internal iterator, and stop if we've run out children // to iterate over. - if (p && ++p->iter == p->iter_upperbound) - p = NULL; + if (m_P && ++m_P->iter == m_P->iter_upperbound) + m_P = nullptr; return *this; } bool AtIter::defined() const { - return (bool)p; + return static_cast(m_P); } bool AtIter::hasContent() const { - if (!p) + if (!m_P) return false; - if (! p->iter->second) + if (!m_P->iter->second) return false; - return p->iter->second->hasContent(); + return m_P->iter->second->hasContent(); } size_t AtIter::count() const { - if (!p) + if (!m_P) return 0; - return std::distance(p->iter, p->iter_upperbound); + return std::distance(m_P->iter, m_P->iter_upperbound); } ////////////////////////////////////////////////////////////////////////// const AtIter AtObj::operator [] (const char* key) const { - if (p) - return p->getChild(key); + if (m_P) + return m_P->getChild(key); else // This object doesn't exist, so return another object that doesn't exist return AtIter(); @@ -124,8 +125,8 @@ AtObj::operator const wchar_t* () const { - if (p) - return p->value.c_str(); + if (m_P) + return m_P->m_Value.c_str(); else return L""; } @@ -133,10 +134,10 @@ double AtObj::getDouble() const { double val = 0; - if (p) + if (m_P) { std::wstringstream s; - s << p->value; + s << m_P->m_Value; s >> val; } return val; @@ -145,10 +146,10 @@ int AtObj::getInt() const { int val = 0; - if (p) + if (m_P) { std::wstringstream s; - s << p->value; + s << m_P->m_Value; s >> val; } return val; @@ -156,10 +157,10 @@ void AtObj::add(const char* key, AtObj& data) { - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->addChild(key, data.p); + m_P = m_P->addChild(key, data.m_P); } void AtObj::add(const char* key, const wxString& value) @@ -171,18 +172,18 @@ { const AtNode* o = new AtNode(value); - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->addChild(key, AtNode::Ptr(o)); + m_P = m_P->addChild(key, AtNode::Ptr(o)); } void AtObj::set(const char* key, AtObj& data) { - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setChild(key, data.p); + m_P = m_P->setChild(key, data.m_P); } void AtObj::set(const char* key, const wxString& value) @@ -194,21 +195,21 @@ { const AtNode* o = new AtNode(value); - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setChild(key, AtNode::Ptr(o)); + m_P = m_P->setChild(key, AtNode::Ptr(o)); } void AtObj::setBool(const char* key, bool value) { AtNode* o = new AtNode(value ? L"true" : L"false"); - o->children.insert(AtNode::child_pairtype("@boolean", AtNode::Ptr(new AtNode()))); + o->m_Children.insert(AtNode::child_pairtype("@boolean", AtNode::Ptr(new AtNode()))); - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setChild(key, AtNode::Ptr(o)); + m_P = m_P->setChild(key, AtNode::Ptr(o)); } void AtObj::setDouble(const char* key, double value) @@ -216,12 +217,12 @@ std::wstringstream str; str << value; AtNode* o = new AtNode(str.str().c_str()); - o->children.insert(AtNode::child_pairtype("@number", AtNode::Ptr(new AtNode()))); + o->m_Children.insert(AtNode::child_pairtype("@number", AtNode::Ptr(new AtNode()))); - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setChild(key, AtNode::Ptr(o)); + m_P = m_P->setChild(key, AtNode::Ptr(o)); } void AtObj::setInt(const char* key, int value) @@ -229,36 +230,36 @@ std::wstringstream str; str << value; AtNode* o = new AtNode(str.str().c_str()); - o->children.insert(AtNode::child_pairtype("@number", AtNode::Ptr(new AtNode()))); + o->m_Children.insert(AtNode::child_pairtype("@number", AtNode::Ptr(new AtNode()))); - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setChild(key, AtNode::Ptr(o)); + m_P = m_P->setChild(key, AtNode::Ptr(o)); } void AtObj::setString(const wchar_t* value) { - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->setValue(value); + m_P = m_P->setValue(value); } void AtObj::addOverlay(AtObj& data) { - if (!p) - p = new AtNode(); + if (!m_P) + m_P = new AtNode(); - p = p->addOverlay(data.p); + m_P = m_P->addOverlay(data.m_P); } bool AtObj::hasContent() const { - if (!p) + if (!m_P) return false; - return p->hasContent(); + return m_P->hasContent(); } ////////////////////////////////////////////////////////////////////////// @@ -266,24 +267,24 @@ const AtIter AtNode::getChild(const char* key) const { // Find the range of matching children - AtNode::child_maptype::const_iterator it = children.lower_bound(key); - AtNode::child_maptype::const_iterator it_upper = children.upper_bound(key); + AtNode::child_maptype::const_iterator it = m_Children.lower_bound(key); + AtNode::child_maptype::const_iterator it_upper = m_Children.upper_bound(key); if (it == it_upper) // No match found return AtIter(); AtIter obj; - obj.p = new AtIterImpl(it, it_upper); + obj.m_P = new AtIterImpl(it, it_upper); return obj; } bool AtNode::hasContent() const { - if (value.length()) + if (m_Value.length()) return true; - for (child_maptype::const_iterator it = children.begin(); it != children.end(); ++it) - if (it->second && it->second->hasContent()) + for(const child_maptype::value_type child : m_Children) + if (child.second && child.second->hasContent()) return true; return false; @@ -292,23 +293,23 @@ const AtNode::Ptr AtNode::setValue(const wchar_t* value) const { AtNode* newNode = new AtNode(); - newNode->children = children; - newNode->value = value; + newNode->m_Children = m_Children; + newNode->m_Value = value; return AtNode::Ptr(newNode); } const AtNode::Ptr AtNode::setChild(const char* key, const AtNode::Ptr &data) const { AtNode* newNode = new AtNode(this); - newNode->children.erase(key); - newNode->children.insert(AtNode::child_pairtype(key, data)); + newNode->m_Children.erase(key); + newNode->m_Children.insert(AtNode::child_pairtype(key, data)); return AtNode::Ptr(newNode); } const AtNode::Ptr AtNode::addChild(const char* key, const AtNode::Ptr &data) const { AtNode* newNode = new AtNode(this); - newNode->children.insert(AtNode::child_pairtype(key, data)); + newNode->m_Children.insert(AtNode::child_pairtype(key, data)); return AtNode::Ptr(newNode); } @@ -317,12 +318,12 @@ AtNode* newNode = new AtNode(this); // Delete old childs that are also in the overlay - for (AtNode::child_maptype::const_iterator it = data->children.begin(); it != data->children.end(); ++it) - newNode->children.erase(it->first); + for (AtNode::child_maptype::const_iterator it = data->m_Children.begin(); it != data->m_Children.end(); ++it) + newNode->m_Children.erase(it->first); // Add the overlay childs back in - for (AtNode::child_maptype::const_iterator it = data->children.begin(); it != data->children.end(); ++it) - newNode->children.insert(*it); + for (AtNode::child_maptype::const_iterator it = data->m_Children.begin(); it != data->m_Children.end(); ++it) + newNode->m_Children.insert(*it); return AtNode::Ptr(newNode); } @@ -332,13 +333,13 @@ { AtObj ret; - for (AtNode::child_maptype::const_iterator it = obj.p->children.begin(); - it != obj.p->children.end(); ++it) + for (AtNode::child_maptype::const_iterator it = obj.m_P->m_Children.begin(); + it != obj.m_P->m_Children.end(); ++it) { if (it->second && it->second->hasContent()) { AtObj node; - node.p = it->second; + node.m_P = it->second; ret.add(it->first.c_str(), node); } } Index: source/tools/atlas/AtlasObject/AtlasObjectJS.cpp =================================================================== --- source/tools/atlas/AtlasObject/AtlasObjectJS.cpp +++ source/tools/atlas/AtlasObject/AtlasObjectJS.cpp @@ -36,7 +36,7 @@ json_spirit::read_string(json, rootnode); AtObj obj; - obj.p = ConvertNode(rootnode); + obj.m_P = ConvertNode(rootnode); return obj; } @@ -47,7 +47,7 @@ if (node.type() == json_spirit::str_type) { - obj->value = std::wstring(node.get_str().begin(),node.get_str().end()); + obj->m_Value = std::wstring(node.get_str().begin(),node.get_str().end()); } else if (node.type() == json_spirit::int_type || node.type() == json_spirit::real_type) { @@ -57,25 +57,25 @@ if (node.type() == json_spirit::real_type) stream << node.get_real(); - obj->value = stream.str().c_str(); - obj->children.insert(AtNode::child_pairtype( + obj->m_Value = stream.str().c_str(); + obj->m_Children.insert(AtNode::child_pairtype( "@number", AtSmartPtr(new AtNode()) )); } else if (node.type() == json_spirit::bool_type) { if (node.get_bool()) - obj->value = L"true"; + obj->m_Value = L"true"; else - obj->value = L"false"; + obj->m_Value = L"false"; - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( "@boolean", AtSmartPtr(new AtNode()) )); } else if (node.type() == json_spirit::array_type) { - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( "@array", AtSmartPtr(new AtNode()) )); @@ -84,7 +84,7 @@ for (; itr != nodeChildren.end(); ++itr) { - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( "item", ConvertNode(*itr) )); } @@ -95,7 +95,7 @@ json_spirit::Object::iterator itr = objectProperties.begin(); for (; itr != objectProperties.end(); ++itr) { - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( itr->name_, ConvertNode(itr->value_) )); } @@ -122,21 +122,21 @@ } // Special case for numbers/booleans to allow round-tripping - if (p->children.count("@number")) + if (p->m_Children.count("@number")) { // Convert to double std::wstringstream str; - str << p->value; + str << p->m_Value; double val = 0; str >> val; json_spirit::Value rval(val); return rval; } - else if (p->children.count("@boolean")) + else if (p->m_Children.count("@boolean")) { bool val = false; - if (p->value == L"true") + if (p->m_Value == L"true") val = true; json_spirit::Value rval(val); @@ -144,19 +144,19 @@ } // If no children, then use the value string instead - if (p->children.empty()) + if (p->m_Children.empty()) { - json_spirit::Value rval(std::string(p->value.begin(), p->value.end())); + json_spirit::Value rval(std::string(p->m_Value.begin(), p->m_Value.end())); return rval; } - if (p->children.find("@array") != p->children.end()) + if (p->m_Children.find("@array") != p->m_Children.end()) { json_spirit::Array rval; // Find the children - AtNode::child_maptype::const_iterator lower = p->children.lower_bound("item"); - AtNode::child_maptype::const_iterator upper = p->children.upper_bound("item"); + AtNode::child_maptype::const_iterator lower = p->m_Children.lower_bound("item"); + AtNode::child_maptype::const_iterator upper = p->m_Children.upper_bound("item"); unsigned int idx = 0; for (AtNode::child_maptype::const_iterator it = lower; it != upper; ++it) @@ -173,7 +173,7 @@ { json_spirit::Object rval; - for (AtNode::child_maptype::const_iterator it = p->children.begin(); it != p->children.end(); ++it) + for (AtNode::child_maptype::const_iterator it = p->m_Children.begin(); it != p->m_Children.end(); ++it) { json_spirit::Value child = BuildJSONNode(it->second); // We don't serialize childs with null value. @@ -189,7 +189,7 @@ std::string AtlasObject::SaveToJSON(AtObj& obj) { - json_spirit::Value root = BuildJSONNode(obj.p); + json_spirit::Value root = BuildJSONNode(obj.m_P); std::string ret = json_spirit::write_string(root, 0); return ret; } Index: source/tools/atlas/AtlasObject/AtlasObjectText.cpp =================================================================== --- source/tools/atlas/AtlasObject/AtlasObjectText.cpp +++ source/tools/atlas/AtlasObject/AtlasObjectText.cpp @@ -32,13 +32,13 @@ std::wstring result; - bool has_value = (obj->value.length() != 0); - bool has_children = (obj->children.size() != 0); + bool has_value = (obj->m_Value.length() != 0); + bool has_children = (obj->m_Children.size() != 0); if (has_value && has_children) - result = obj->value + L" "; + result = obj->m_Value + L" "; else if (has_value) - result = obj->value; + result = obj->m_Value; // else no value; result = L"" if (has_children) @@ -48,8 +48,8 @@ bool first_child = true; // so we can add ", " in appropriate places - for (AtNode::child_maptype::const_iterator it = obj->children.begin(); - it != obj->children.end(); + for (AtNode::child_maptype::const_iterator it = obj->m_Children.begin(); + it != obj->m_Children.end(); ++it) { if (! first_child) @@ -69,5 +69,5 @@ std::wstring AtlasObject::ConvertToString(const AtObj& obj) { - return ConvertRecursive(obj.p, false); + return ConvertRecursive(obj.m_P, false); } Index: source/tools/atlas/AtlasObject/AtlasObjectXML.cpp =================================================================== --- source/tools/atlas/AtlasObject/AtlasObjectXML.cpp +++ source/tools/atlas/AtlasObject/AtlasObjectXML.cpp @@ -124,7 +124,7 @@ xmlNodePtr root = xmlDocGetRootElement(doc); AtObj obj; - obj.p = ConvertNode(root); + obj.m_P = ConvertNode(root); AtObj rootObj; rootObj.set((const char*)root->name, obj); @@ -149,7 +149,7 @@ xmlFree(content); AtNode* newNode = new AtNode(value.c_str()); - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( name.c_str(), AtNode::Ptr(newNode) )); } @@ -159,7 +159,7 @@ { if (cur_node->type == XML_ELEMENT_NODE) { - obj->children.insert(AtNode::child_pairtype( + obj->m_Children.insert(AtNode::child_pairtype( (const char*)cur_node->name, ConvertNode(cur_node) )); } @@ -168,19 +168,19 @@ xmlChar* content = xmlNodeGetContent(cur_node); std::wstring value (fromXmlChar(content)); xmlFree(content); - obj->value += value; + obj->m_Value += value; } } // Trim whitespace surrounding the string value const std::wstring whitespace = L" \t\r\n"; - size_t first = obj->value.find_first_not_of(whitespace); + size_t first = obj->m_Value.find_first_not_of(whitespace); if (first == std::wstring::npos) - obj->value = L""; + obj->m_Value = L""; else { - size_t last = obj->value.find_last_not_of(whitespace); - obj->value = obj->value.substr(first, 1+last-first); + size_t last = obj->m_Value.find_last_not_of(whitespace); + obj->m_Value = obj->m_Value.substr(first, 1+last-first); } return obj; @@ -191,17 +191,17 @@ { if (p) { - if (p->value.length()) - xmlNodeAddContent(node, toXmlChar(p->value)); + if (p->m_Value.length()) + xmlNodeAddContent(node, toXmlChar(p->m_Value)); - for (AtNode::child_maptype::const_iterator it = p->children.begin(); it != p->children.end(); ++it) + for (AtNode::child_maptype::const_iterator it = p->m_Children.begin(); it != p->m_Children.end(); ++it) { // Test for attribute nodes (whose names start with @) if (it->first.length() && it->first[0] == '@') { assert(it->second); assert(it->second->children.empty()); - xmlNewProp(node, (const xmlChar*)it->first.c_str()+1, toXmlChar(it->second->value)); + xmlNewProp(node, (const xmlChar*)it->first.c_str()+1, toXmlChar(it->second->m_Value)); } else { @@ -223,16 +223,16 @@ std::string AtlasObject::SaveToXML(AtObj& obj) { - if (!obj.p || obj.p->children.size() != 1) + if (!obj.m_P || obj.m_P->m_Children.size() != 1) { assert(! "SaveToXML: root must only have one child"); return ""; } - AtNode::Ptr firstChild (obj.p->children.begin()->second); + AtNode::Ptr firstChild (obj.m_P->m_Children.begin()->second); xmlDocPtr doc = xmlNewDoc((const xmlChar*)"1.0"); - BuildDOMNode(doc, NULL, obj.p); + BuildDOMNode(doc, NULL, obj.m_P); xmlChar* buf; int size; Index: source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp =================================================================== --- source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp +++ source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2019 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -166,13 +166,13 @@ else { wxString filePath = GetSelectedFilePath(); - AtlasMessage::qVFSFileExists qry(filePath.wc_str()); - qry.Post(); - if (!filePath.IsEmpty() && qry.exists) + AtlasMessage::qVFSFileExists fileExistsQuery(filePath.wc_str()); + fileExistsQuery.Post(); + if (!filePath.IsEmpty() && fileExistsQuery.exists) { - AtlasMessage::qVFSFileRealPath qry(filePath.wc_str()); - qry.Post(); - wxDynamicCast(FindWindow(ID_MapDialogFilename), wxTextCtrl)->ChangeValue(*qry.realPath); + AtlasMessage::qVFSFileRealPath pathQuery(filePath.wc_str()); + pathQuery.Post(); + wxDynamicCast(FindWindow(ID_MapDialogFilename), wxTextCtrl)->ChangeValue(*pathQuery.realPath); } } Index: source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp +++ source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp @@ -739,8 +739,8 @@ SetOpenFilename(name); { // Wait for it to load, while the wxBusyInfo is telling the user that we're doing that - qPing qry; - qry.Post(); + qPing pingQuery; + pingQuery.Post(); } NotifyOnMapReload(); Index: source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h +++ source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h @@ -37,7 +37,7 @@ void OnSelectFilter(wxCommandEvent& evt); void OnSelectObject(wxCommandEvent& evt); - ObjectSidebarImpl* p; + ObjectSidebarImpl* m_P; DECLARE_EVENT_TABLE(); }; Index: source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp +++ source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp @@ -127,7 +127,7 @@ wxWindow* bottomBarContainer ) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), - p(new ObjectSidebarImpl(scenarioEditor)) + m_P(new ObjectSidebarImpl(scenarioEditor)) { wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); @@ -159,8 +159,8 @@ // ------------------------------------------------------------------------------------------ - p->m_ObjectListBox = new wxListBox(scrolledWindow, ID_SelectObject, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_HSCROLL); - scrollSizer->Add(p->m_ObjectListBox, wxSizerFlags().Proportion(1).Expand()); + m_P->m_ObjectListBox = new wxListBox(scrolledWindow, ID_SelectObject, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_HSCROLL); + scrollSizer->Add(m_P->m_ObjectListBox, wxSizerFlags().Proportion(1).Expand()); scrollSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ @@ -173,32 +173,32 @@ bottomBarContainer, scenarioEditor.GetObjectSettings(), scenarioEditor.GetMapSettings(), - p + m_P ); - p->m_ToolConn = scenarioEditor.GetToolManager().GetCurrentTool().RegisterObserver(0, &ObjectSidebar::OnToolChange, this); + m_P->m_ToolConn = scenarioEditor.GetToolManager().GetCurrentTool().RegisterObserver(0, &ObjectSidebar::OnToolChange, this); } ObjectSidebar::~ObjectSidebar() { - delete p; + delete m_P; } void ObjectSidebar::OnToolChange(ITool* tool) { if (wxString(tool->GetClassInfo()->GetClassName()) == _T("ActorViewerTool")) { - p->m_ActorViewerActive = true; - p->ActorViewerPostToGame(); + m_P->m_ActorViewerActive = true; + m_P->ActorViewerPostToGame(); wxDynamicCast(FindWindow(ID_ToggleViewer), wxButton)->SetLabel(_("Return to game view")); } else { - p->m_ActorViewerActive = false; + m_P->m_ActorViewerActive = false; wxDynamicCast(FindWindow(ID_ToggleViewer), wxButton)->SetLabel(_("Switch to Actor Viewer")); } - static_cast(m_BottomBar)->ShowActorViewer(p->m_ActorViewerActive); + static_cast(m_BottomBar)->ShowActorViewer(m_P->m_ActorViewerActive); } void ObjectSidebar::OnFirstDisplay() @@ -210,7 +210,7 @@ // Get the list of objects from the game AtlasMessage::qGetObjectsList qry; qry.Post(); - p->m_Objects = *qry.objects; + m_P->m_Objects = *qry.objects; // Display first group of objects FilterObjects(); } @@ -220,9 +220,9 @@ int filterType = wxDynamicCast(FindWindow(ID_ObjectType), wxChoice)->GetSelection(); wxString filterName = wxDynamicCast(FindWindow(ID_ObjectFilter), wxTextCtrl)->GetValue(); - p->m_ObjectListBox->Freeze(); - p->m_ObjectListBox->Clear(); - for (std::vector::iterator it = p->m_Objects.begin(); it != p->m_Objects.end(); ++it) + m_P->m_ObjectListBox->Freeze(); + m_P->m_ObjectListBox->Clear(); + for (std::vector::iterator it = m_P->m_Objects.begin(); it != m_P->m_Objects.end(); ++it) { if (it->type == filterType) { @@ -231,16 +231,16 @@ if (name.Lower().Find(filterName.Lower()) != wxNOT_FOUND) { - p->m_ObjectListBox->Append(name, new wxStringClientData(id)); + m_P->m_ObjectListBox->Append(name, new wxStringClientData(id)); } } } - p->m_ObjectListBox->Thaw(); + m_P->m_ObjectListBox->Thaw(); } void ObjectSidebar::OnToggleViewer(wxCommandEvent& WXUNUSED(evt)) { - if (p->m_ActorViewerActive) + if (m_P->m_ActorViewerActive) { m_ScenarioEditor.GetToolManager().SetCurrentTool(_T(""), NULL); } @@ -264,11 +264,11 @@ // Always update the actor viewer's state even if it's inactive, // so it will be correct when first enabled - p->m_ActorViewerEntity = id; + m_P->m_ActorViewerEntity = id; - if (p->m_ActorViewerActive) + if (m_P->m_ActorViewerActive) { - p->ActorViewerPostToGame(); + m_P->ActorViewerPostToGame(); } else { @@ -544,9 +544,9 @@ qryPlayers.Post(); AtObj playerData = AtlasObject::LoadFromJSON(*qryPlayers.defaults); AtObj playerDefs = *playerData["PlayerData"]; - for (AtIter p = playerDefs["item"]; p.defined(); ++p) + for (AtIter m_P = playerDefs["item"]; m_P.defined(); ++m_P) { - players.Add(wxString(p["Name"])); + players.Add(wxString(m_P["Name"])); } wxDynamicCast(FindWindow(ID_PlayerSelect), PlayerComboBox)->SetPlayers(players);