From 855da86feae1a5cc14dc2d486ccf115f484dbc2e Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 25 Apr 2022 20:22:07 -0700 Subject: Changeset: 16 Initial work on rendering sprites to screen --- source/Ires.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source/Ires.cpp') diff --git a/source/Ires.cpp b/source/Ires.cpp index f60fcb7..346e6e6 100644 --- a/source/Ires.cpp +++ b/source/Ires.cpp @@ -74,7 +74,15 @@ void IresObject::SetName(std::string name) { } } -void IresObject::ShowNullName(EditorInstance& editor, Kind kind) { +void IresObject::ShowNameSafe(IresObject* ires) { + if (ires) { + ires->ShowName(); + } else { + ShowNameNull(); + } +} + +void IresObject::ShowNameNull() { ImGui::Text(""); } @@ -86,15 +94,15 @@ void IresObject::ShowName() const { } } -void IresObject::ShowFullName() const { - if (IsAnnoymous()) { - ImGui::Text(" (%lx-%lx)", (void*)this, mUid.upper, mUid.lower); +void IresObject::ShowReferenceSafe(EditorInstance& editor, IresObject* ires) { + if (ires) { + ires->ShowReference(editor); } else { - ImGui::Text("%s (%lx-%lx)", mName.c_str(), mUid.upper, mUid.lower); + ShowReferenceNull(editor); } } -void IresObject::ShowNullReference(EditorInstance& editor, Kind kind) { +void IresObject::ShowReferenceNull(EditorInstance& editor) { ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_ButtonHovered]); ImGui::Text(""); ImGui::PopStyleColor(); -- cgit v1.2.3-70-g09d2