From ccb96dd4480a7af2e18cc9d5d909b3f01ad7905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Sami=20G=C3=BCrp=C4=B1nar?= Date: Mon, 8 Apr 2024 18:15:51 +0300 Subject: [PATCH] refactor(core): renamed --- CMakeLists.txt | 2 +- src/core/engine.cpp | 14 +++++++------- src/core/engine.h | 6 +++--- src/main.cpp | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fe12e1..2d5010b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.23.0) -project(voxen VERSION 0.1.0) +project(cae VERSION 0.1.0) set(CMAKE_CXX_STANDARD 20) diff --git a/src/core/engine.cpp b/src/core/engine.cpp index cb06ac2..0a277aa 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -11,10 +11,10 @@ #include "../world/world.h" #include "../world/skybox.h" -CellularAutomatonEngine::CellularAutomatonEngine() = default; -CellularAutomatonEngine::~CellularAutomatonEngine() = default; +CAEngine::CAEngine() = default; +CAEngine::~CAEngine() = default; -void CellularAutomatonEngine::init() { +void CAEngine::init() { mWindow = std::make_unique(); mWindow->init("Voxel Engine"); @@ -44,7 +44,7 @@ void CellularAutomatonEngine::init() { mIsRunning = true; } -void CellularAutomatonEngine::run(World& world, Skybox& skybox) { +void CAEngine::run(World& world, Skybox& skybox) { while (mIsRunning) { processInput(); update(world); @@ -52,11 +52,11 @@ void CellularAutomatonEngine::run(World& world, Skybox& skybox) { } } -void CellularAutomatonEngine::processInput() { +void CAEngine::processInput() { mInput->process(*mCamera, mWindow->nativeHandle(), mDeltaTime, mIsRunning); } -void CellularAutomatonEngine::update(World& world) { +void CAEngine::update(World& world) { mDeltaTime = (SDL_GetTicks() - mMillisecsPreviousFrame) / 1000.0f; mMillisecsPreviousFrame = SDL_GetTicks(); #ifdef DEBUG @@ -68,7 +68,7 @@ void CellularAutomatonEngine::update(World& world) { mCamera->update(); } -void CellularAutomatonEngine::render(World& world, Skybox& skybox) { +void CAEngine::render(World& world, Skybox& skybox) { mWindow->clear(0.2f, 0.3f, 0.3f, 1.0f); glm::mat4 view = mCamera->getViewMatrix(); diff --git a/src/core/engine.h b/src/core/engine.h index cb6dff0..93333bf 100644 --- a/src/core/engine.h +++ b/src/core/engine.h @@ -8,11 +8,11 @@ class Camera; class Window; class Input; class Gui; -class CellularAutomatonEngine { +class CAEngine { public: - CellularAutomatonEngine(); + CAEngine(); - ~CellularAutomatonEngine(); + ~CAEngine(); void init(); diff --git a/src/main.cpp b/src/main.cpp index fe73ae2..4a0e849 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,11 +3,11 @@ #include "world/skybox.h" int main() { - CellularAutomatonEngine cae; + CAEngine cae; cae.init(); - World world; - Skybox skyBox; + World world{}; + Skybox skyBox{}; cae.run(world, skyBox);