[nostalgia] Rename common package to geo

This commit is contained in:
2022-02-13 04:03:10 -06:00
parent 0aa71f1dbb
commit 320df614a9
26 changed files with 131 additions and 130 deletions

View File

@@ -6,8 +6,8 @@
#include <imgui.h>
#include <nostalgia/common/point.hpp>
#include <nostalgia/core/media.hpp>
#include <nostalgia/geo/point.hpp>
#include "tilesheeteditor-imgui.hpp"
@@ -45,7 +45,7 @@ void TileSheetEditorImGui::paste() {
void TileSheetEditorImGui::draw(core::Context*) noexcept {
const auto paneSize = ImGui::GetContentRegionAvail();
const auto tileSheetParentSize = ImVec2(paneSize.x - m_palViewWidth, paneSize.y);
const auto fbSize = common::Vec2(tileSheetParentSize.x - 16, tileSheetParentSize.y - 16);
const auto fbSize = geo::Vec2(tileSheetParentSize.x - 16, tileSheetParentSize.y - 16);
ImGui::BeginChild("child1", ImVec2(tileSheetParentSize.x, tileSheetParentSize.y), true);
drawTileSheet(fbSize);
ImGui::EndChild();
@@ -59,8 +59,8 @@ void TileSheetEditorImGui::draw(core::Context*) noexcept {
void TileSheetEditorImGui::saveItem() {
}
void TileSheetEditorImGui::drawTileSheet(const common::Vec2 &fbSize) noexcept {
const auto fbSizei = common::Size(static_cast<int>(fbSize.x), static_cast<int>(fbSize.y));
void TileSheetEditorImGui::drawTileSheet(const geo::Vec2 &fbSize) noexcept {
const auto fbSizei = geo::Size(static_cast<int>(fbSize.x), static_cast<int>(fbSize.y));
if (m_framebuffer.width != fbSizei.width || m_framebuffer.height != fbSizei.height) {
m_framebuffer = glutils::generateFrameBuffer(fbSizei.width, fbSizei.height);
m_tileSheetEditor.resize(fbSize);
@@ -87,7 +87,7 @@ void TileSheetEditorImGui::drawTileSheet(const common::Vec2 &fbSize) noexcept {
m_tileSheetEditor.scrollH(fbSize, wheelh);
}
if (io.MouseDown[0]) {
auto clickPos = common::Vec2(io.MousePos);
auto clickPos = geo::Vec2(io.MousePos);
const auto &winPos = ImGui::GetWindowPos();
clickPos.x -= winPos.x + 10;
clickPos.y -= winPos.y + 10;