Skip to content

Commit 8fab9ad

Browse files
committed
Editor : Drawing + Mouse pos system & added dynamic grid size
1 parent cd5f77f commit 8fab9ad

File tree

7 files changed

+471
-302
lines changed

7 files changed

+471
-302
lines changed

.idea/misc.xml

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ For now the project in a prototyping phase, still mainly focused in making an ef
4949
- [x] Rendering steps visalizer
5050
- [ ] Map Editor including :
5151
- [x] Controls (zoom, move, ...)
52-
- [ ] Sector Editor
52+
- [ ] [IN_PROGRESS] Sector Editor
5353
- [x] Elevation editor
5454
- [x] Proper sectors rendering
5555
- [ ] Sector creation tool
@@ -58,9 +58,12 @@ For now the project in a prototyping phase, still mainly focused in making an ef
5858
- [ ] Vignet editor
5959
- [ ] Sprite editor
6060
- [ ] Texture Browser
61-
6261
*System*
6362
- [ ] Project instance cration : being able to create a project witch is using the engine and editor in one click
63+
- [ ] Simple assets serealization / deserialization system
64+
- [ ] standards containers (std::map, std::vector, std::string)
65+
- [ ] Map / Entities
66+
- [ ] Enable user to implement serialization for his own Asset types
6467
- [ ] Project shiping including :
6568
- [ ] Release Build
6669
- [ ] Assets bundle

src/Editor/RaycastingCameraViewport.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RaycastingCameraViewport
4646
// draw the view
4747
rlImGuiImageRenderTextureFit(&renderTexture, true);
4848

49-
if(IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
49+
if(ImGui::IsWindowFocused() && IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
5050
{
5151
ImVec2 viewportRecMin = ImGui::GetItemRectMin();
5252
ImVec2 viewportRecMax = ImGui::GetItemRectMax();
@@ -56,13 +56,13 @@ class RaycastingCameraViewport
5656
&& mousePos.y >= viewportRecMin.y && mousePos.y <= viewportRecMax.y
5757
)
5858
{
59-
focused = true;
59+
mouseFocused = true;
6060
}
6161
}
6262

6363
if(IsFocused() && IsKeyPressed(KEY_ESCAPE))
6464
{
65-
focused = false;
65+
mouseFocused = false;
6666
}
6767
}
6868
ImGui::End();
@@ -72,7 +72,7 @@ class RaycastingCameraViewport
7272

7373
bool IsFocused() const
7474
{
75-
return focused;
75+
return mouseFocused;
7676
}
7777

7878
const RenderTexture2D& GetRenderTexture() const { return renderTexture; }
@@ -116,7 +116,7 @@ class RaycastingCameraViewport
116116
RenderTexture2D renderTexture;
117117

118118
bool mouseLocked = false;
119-
bool focused = false;
119+
bool mouseFocused = false;
120120
bool autoResize = false;
121121

122122
ImGuiWindow* parentWindow = nullptr;

0 commit comments

Comments
 (0)