Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/game-editor' into g…
Browse files Browse the repository at this point in the history
…ame-editor
  • Loading branch information
PharaEthan committed Jan 9, 2024
2 parents a737e14 + 64dbb9a commit 2e6b822
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Exodia/src/Layer/EditorLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ namespace Exodia {
// Constructor & Destructor //
//////////////////////////////

EditorLayer::EditorLayer() : Layer("Exodia Editor"), _EditorCamera(30.0f, 1.778f, 0.1f, 1000.0f), _ActiveScene(nullptr), _SceneState(SceneState::Edit), _ViewportSize{0.0f, 0.0f}, _ViewportHovered(false), _ShowCollisions(false)
{
EditorLayer::EditorLayer()
: Layer("Exodia Editor"), _EditorCamera(30.0f, 1.778f, 0.1f, 1000.0f), _ActiveScene(nullptr),
_SceneState(SceneState::Edit), _ViewportSize{0.0f, 0.0f}, _ViewportHovered(false), _ShowCollisions(false) {
_ViewportBounds[0] = {0.0f, 0.0f};
_ViewportBounds[1] = {0.0f, 0.0f};
}
Expand Down Expand Up @@ -130,7 +131,9 @@ namespace Exodia {
if (mouseX >= 0 && mouseY >= 0 && mouseX < (int)viewportSize.x && mouseY < (int)viewportSize.y) {
int pixelData = _Framebuffer->ReadPixel(1, mouseX, mouseY);

_HoveredEntity = (pixelData == -1) ? GameObject() : GameObject(_ActiveScene->GetWorld().GetEntityByID((uint64_t)pixelData), _ActiveScene.get());
_HoveredEntity = (pixelData == -1) ? GameObject()
: GameObject(_ActiveScene->GetWorld().GetEntityByID((uint64_t)pixelData),
_ActiveScene.get());
}

OnOverlayRender();
Expand Down
5 changes: 1 addition & 4 deletions Exodia/src/Panel/SceneHierarchy/SceneHierarchy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,5 @@ namespace Exodia {

void SceneHierarchy::SetSelectedEntity(Entity *entity) { _SelectedEntity = entity; }

GameObject SceneHierarchy::GetSelectedEntity() const
{
return { _SelectedEntity, _Context.get() };
};
GameObject SceneHierarchy::GetSelectedEntity() const { return {_SelectedEntity, _Context.get()}; };
}; // namespace Exodia

0 comments on commit 2e6b822

Please sign in to comment.