aboutsummaryrefslogtreecommitdiff
path: root/source/EditorCorePrivate.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-30 17:03:20 -0700
committerrtk0c <[email protected]>2022-05-30 17:03:20 -0700
commite66286ebe30afc9acc4531fc2bea29b7fb924f93 (patch)
treefa6b76554c3eb88bc8f088fbab68e20c40118ca7 /source/EditorCorePrivate.hpp
parent366ef5a5450c6e0e680c924c3454943a9ae9814d (diff)
Changeset: 56 Buildsystem cleanup: change to layered structure for different targets
Diffstat (limited to 'source/EditorCorePrivate.hpp')
-rw-r--r--source/EditorCorePrivate.hpp130
1 files changed, 0 insertions, 130 deletions
diff --git a/source/EditorCorePrivate.hpp b/source/EditorCorePrivate.hpp
deleted file mode 100644
index 4fbfb72..0000000
--- a/source/EditorCorePrivate.hpp
+++ /dev/null
@@ -1,130 +0,0 @@
-#pragma once
-
-#include "EditorCore.hpp"
-
-#include "App.hpp"
-#include "EditorAttachment.hpp"
-#include "EditorCommandPalette.hpp"
-#include "EditorUtils.hpp"
-#include "GameObject.hpp"
-#include "Ires.hpp"
-#include "Level.hpp"
-#include "RcPtr.hpp"
-#include "Sprite.hpp"
-#include "World.hpp"
-
-#include <memory>
-#include <string>
-
-// TODO move inspector drawing to this class
-class EditorInspector final : public IEditorInspector {
-public:
- std::string renamingScratchBuffer;
- void* selectedItPtr = nullptr;
- TargetType selectedItt = ITT_None;
- bool renaming = false;
-
- void SelectTarget(TargetType type, void* object) override;
-};
-
-class EditorContentBrowser final : public IEditorContentBrowser {
-private:
- enum Pane {
- P_Settings,
- P_Ires,
- P_Level,
- };
-
- static constexpr float kSplitterThickness = 3.0f;
- static constexpr float kPadding = 4.0f;
-
- // <root>
- static constexpr float kLeftPaneMinWidth = 200.0f;
- static constexpr float kRightPaneMinWidth = 200.0f;
-
- EditorInspector* mInspector;
- Pane mPane = P_Settings;
- float mBrowserHeight = 0.5f;
- float mSplitterLeft = kLeftPaneMinWidth;
- float mSplitterRight = 0.0f;
- bool mDocked = true;
-
-public:
- EditorContentBrowser(EditorInspector* inspector);
- ~EditorContentBrowser() override;
-
- void Show(bool* open = nullptr);
-};
-
-struct GuizmoState {
- ImGuizmo::OPERATION currOperation = ImGuizmo::TRANSLATE;
- ImGuizmo::MODE currMode = ImGuizmo::LOCAL;
- glm::mat4 cubeMatrix;
- float snap[3] = { 1.f, 1.f, 1.f };
- float boundsSnap[3] = { 0.1f, 0.1f, 0.1f };
- bool useSnap = false;
- bool boundSizing = false;
- bool boundSizingSnap = false;
-};
-
-// TODO editor undo stack
-class EditorInstance : public IEditor {
-public:
- enum EditorCameraMode {
- // "Game mode": the camera views from the side, where the forward vector is perpendicular to the world plane
- ECM_2D,
- // "Editor mode": equivalent to Unity's 3D mode, the camera is completely free and controlled as a 3d camera
- ECM_Side3D,
- };
-
-private:
- App* mApp;
- GameObject* mPopupCurrent_GameObject = nullptr;
- Camera mEditorCamera;
- RcPtr<SpriteDefinition> mSpriteView_Instance;
- EditorCommandPalette mEdCommandPalette;
- EditorInspector mEdInspector;
- EditorContentBrowser mEdContentBrowser;
- GuizmoState mGuizmo;
- glm::vec3 mDragCam_CamInitial;
- ImVec2 mDragCam_CursorInitial;
- int mSpriteView_Frame;
- float mMoveCamScrollSpeed = 1.0f;
- float mMoveCamSlideSpeed = 0.1f;
- EditorCameraMode mEcm = ECM_2D;
- bool mSpriteView_OpenNextFrame = false;
- bool mWindowVisible_ImGuiDemo = false;
- bool mWindowVisible_CommandPalette = false;
- bool mWindowVisible_Inspector = true;
- bool mWindowVisible_ContentBrowser = true;
- bool mWindowVisible_WorldStructure = true;
- bool mWindowVisible_WorldProperties = true;
- bool mDragCam_Happening = false;
- bool mMoveCamKeyboard = false;
- bool mMoveCamScrollWheel = false;
-
-public:
- EditorInstance(App* app);
- ~EditorInstance() override;
-
- void OnGameStateChanged(bool running) override;
- void Show() override;
-
- EditorInspector& GetInspector() override { return mEdInspector; }
- EditorContentBrowser& GetContentBrowser() override { return mEdContentBrowser; }
-
- void OpenSpriteViewer(SpriteDefinition* sprite) override;
-
-private:
- bool IsCurrentCameraEditor() const {
- return !mApp->IsGameRunning();
- }
-
- void ShowWorldProperties();
-
- void ShowInspector(IresObject* ires);
- void ShowInspector(LevelManager::LoadableObject* ldObj);
- void ShowInspector(GameObject* object);
-
- void ShowSpriteViewer();
-};