refactor: rename zoom function
This commit is contained in:
@@ -54,7 +54,7 @@ public:
|
|||||||
void RenderVAO(const GL::VertexArray& vao);
|
void RenderVAO(const GL::VertexArray& vao);
|
||||||
void RenderModel(const Model& model);
|
void RenderModel(const Model& model);
|
||||||
|
|
||||||
void SetZoom(float zoom);
|
void AddZoom(float zoom);
|
||||||
void SetCamAngularMovement(const Vec2f& mov);
|
void SetCamAngularMovement(const Vec2f& mov);
|
||||||
void SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos);
|
void SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos);
|
||||||
void SetCamLook(const Vec2f& worldPos);
|
void SetCamLook(const Vec2f& worldPos);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void Renderer::Resize(int width, int height) {
|
|||||||
glViewport(0, 0, width, height);
|
glViewport(0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::SetZoom(float zoom) {
|
void Renderer::AddZoom(float zoom) {
|
||||||
m_Camera.CamPos.y = std::max(1.0f, m_Camera.CamPos.y - zoom);
|
m_Camera.CamPos.y = std::max(1.0f, m_Camera.CamPos.y - zoom);
|
||||||
m_Camera.CamDistance = std::max(1.0f, m_Camera.CamDistance - zoom);
|
m_Camera.CamDistance = std::max(1.0f, m_Camera.CamDistance - zoom);
|
||||||
SetCamLook(m_Camera.CamLook);
|
SetCamLook(m_Camera.CamLook);
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ void WorldRenderer::LoadModels() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WorldRenderer::WorldRenderer(game::World* world, client::ClientGame* client) : m_Client(client), m_Renderer(m_Client->GetRenderer()), m_World(world), m_Zoom(0.1) {
|
WorldRenderer::WorldRenderer(game::World* world, client::ClientGame* client) : m_Client(client), m_Renderer(m_Client->GetRenderer()), m_World(world), m_Zoom(0.1) {
|
||||||
m_Renderer->SetZoom(m_Zoom);
|
|
||||||
m_TowerPlacePopup = std::make_unique<gui::TowerPlacePopup>(m_Client->GetClient());
|
m_TowerPlacePopup = std::make_unique<gui::TowerPlacePopup>(m_Client->GetClient());
|
||||||
m_TowerUpgradePopup = std::make_unique<gui::TowerUpgradePopup>(m_Client->GetClient());
|
m_TowerUpgradePopup = std::make_unique<gui::TowerUpgradePopup>(m_Client->GetClient());
|
||||||
m_MobTooltip = std::make_unique<gui::MobTooltip>(m_Client->GetClient());
|
m_MobTooltip = std::make_unique<gui::MobTooltip>(m_Client->GetClient());
|
||||||
@@ -153,7 +152,7 @@ void WorldRenderer::ChangeZoom(float zoomStep) {
|
|||||||
if (m_WorldVao == nullptr)
|
if (m_WorldVao == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Renderer->SetZoom(zoomStep);
|
m_Renderer->AddZoom(zoomStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldRenderer::Click() {
|
void WorldRenderer::Click() {
|
||||||
|
|||||||
Reference in New Issue
Block a user