|
|
|
@ -20,7 +20,7 @@
|
|
|
|
namespace lunarium { namespace editor
|
|
|
|
namespace lunarium { namespace editor
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TileSetView::TileSetView(MapEditor* editor)
|
|
|
|
TileSetView::TileSetView(MapEditor* editor)
|
|
|
|
: Panel("Tile Set View", PanelDockZone::DDZ_RIGHT, true),
|
|
|
|
: Panel("Tile Set View", PanelDockZone::DDZ_RIGHT, true, ImGuiWindowFlags_HorizontalScrollbar),
|
|
|
|
mpEditor(editor), mpSelectedTileSet(nullptr), mpViewImage(nullptr), mFrameBuffer(-1),
|
|
|
|
mpEditor(editor), mpSelectedTileSet(nullptr), mpViewImage(nullptr), mFrameBuffer(-1),
|
|
|
|
mViewOffset({0, 0}), mViewZoom(1.0f), mMouseDown(false)
|
|
|
|
mViewOffset({0, 0}), mViewZoom(1.0f), mMouseDown(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -97,22 +97,16 @@ namespace lunarium { namespace editor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool TileSetView::DoFrame()
|
|
|
|
void TileSetView::PreBegin()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!mIsOpen)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f );
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f );
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f );
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f );
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) );
|
|
|
|
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) );
|
|
|
|
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_HorizontalScrollbar))
|
|
|
|
SetNumPushedStyles(3);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
ImGui::PopStyleVar(3);
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::PopStyleVar(3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TileSetView::DoFrame()
|
|
|
|
|
|
|
|
{
|
|
|
|
ImVec2 window_size = ImGui::GetWindowSize();
|
|
|
|
ImVec2 window_size = ImGui::GetWindowSize();
|
|
|
|
|
|
|
|
|
|
|
|
float child_height = ImGui::GetFrameHeight() * 2;
|
|
|
|
float child_height = ImGui::GetFrameHeight() * 2;
|
|
|
|
@ -159,9 +153,6 @@ namespace lunarium { namespace editor
|
|
|
|
ImGui::Image((ImTextureID)mpViewImage->GetGLTextureID64(),
|
|
|
|
ImGui::Image((ImTextureID)mpViewImage->GetGLTextureID64(),
|
|
|
|
ImVec2(mpViewImage->GetWidth(), mpViewImage->GetHeight()), ImVec2(0, 1), ImVec2(1, 0)); // the last 2 params are flipping the image on the y
|
|
|
|
ImVec2(mpViewImage->GetWidth(), mpViewImage->GetHeight()), ImVec2(0, 1), ImVec2(1, 0)); // the last 2 params are flipping the image on the y
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
return mIsOpen;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TileSetView::ClearTileSets()
|
|
|
|
void TileSetView::ClearTileSets()
|
|
|
|
|