Refactored the docs directory

Adds 3rd party tools list
Refactored tester lib into testbed
Adds colored build result message to build.bat script
core_refactor
Joey Pollack 4 years ago
parent 285a53437e
commit 88199d1194

@ -120,7 +120,7 @@ add_subdirectory(external/freetype)
add_subdirectory(external/box2d) add_subdirectory(external/box2d)
# add run mode tester # add run mode tester
add_subdirectory(src/run_modes/tester) add_subdirectory(src/run_modes/testbed)
# add run mode editor # add run mode editor
add_subdirectory(src/run_modes/editor) add_subdirectory(src/run_modes/editor)
@ -155,7 +155,7 @@ target_link_directories(${PROJECT_NAME}
PRIVATE external/box2d/bin PRIVATE external/box2d/bin
) )
target_link_libraries(${PROJECT_NAME} box2d glfw glad glm gui dearimgui utils assets lua_static pugixml freetype tester game) target_link_libraries(${PROJECT_NAME} box2d glfw glad glm gui dearimgui utils assets lua_static pugixml freetype testbed game)
if (NOT NO_EDITOR) if (NOT NO_EDITOR)
target_link_libraries(${PROJECT_NAME} editor) target_link_libraries(${PROJECT_NAME} editor)

@ -0,0 +1,36 @@
## List of 3rd party tools and libraries
- GLFW
- [Git Repo](https://github.com/glfw/glfw)
- License: [zlib/libpng](https://www.glfw.org/license.html)
- Glad2
- [Git Repo](https://github.com/Dav1dde/glad/tree/glad2)
- License: [MIT](https://github.com/Dav1dde/glad/blob/glad2/LICENSE)
- GLM
- [Git Repo](https://github.com/g-truc/glm)
- License: [The Happy Bunny License or MIT](https://github.com/g-truc/glm/blob/master/copying.txt)
- Wren
- [Git Repo](https://github.com/wren-lang/wren)
- License: [MIT](https://github.com/wren-lang/wren/blob/main/LICENSE)
- Dear ImGui
- [Git Repo](https://github.com/ocornut/imgui/tree/docking)
- License: [MIT](https://github.com/ocornut/imgui/blob/docking/LICENSE.txt)
- stb_image headers
- [Git Repo](https://github.com/nothings/stb)
- License: [MIT OR Public Domain](https://github.com/nothings/stb/blob/master/LICENSE)
- OpenAL Soft
- [Git Repo](https://github.com/kcat/openal-soft)
- License: [GPL v2](https://github.com/kcat/openal-soft/blob/master/COPYING)
- FreeType
- [Git Repo](https://gitlab.freedesktop.org/freetype/freetype)
- License: [FreeType License OR GPL 2 (or later)](https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/LICENSE.TXT)
- Box2D
- [Git Repo](https://github.com/erincatto/box2d)
- License: [MIT](https://github.com/Dav1dde/glad/blob/glad2/LICENSE)
- json
- [Git Repo](https://github.com/nlohmann/json)
- License: [MIT](https://github.com/nlohmann/json/blob/develop/LICENSE.MIT)
- nativefiledialog-extended
- [Git Repo](https://github.com/btzy/nativefiledialog-extended)
- License: [ZLIB](https://github.com/btzy/nativefiledialog-extended/blob/master/LICENSE)

@ -4,15 +4,18 @@ Build System:
✔ Modify .sh scripts to recognize the noeditor flag @done (1/25/2022, 3:59:23 PM) ✔ Modify .sh scripts to recognize the noeditor flag @done (1/25/2022, 3:59:23 PM)
Core: Core:
☐ Replace XML with JSON (https://github.com/nlohmann/json) @high
☐ Move internal libs back into the core and refactor @high ☐ Move internal libs back into the core and refactor @high
☐ Replace the File Browser (imgui) class with the NFD library (https://github.com/btzy/nativefiledialog-extended) @high ☐ Replace the File Browser (imgui) class with the NFD library (https://github.com/btzy/nativefiledialog-extended) @high
☐ For scripting switch to Wren instead of LUA @high ☐ For scripting switch to Wren instead of LUA (https://github.com/wren-lang/wren) @high
☐ Remove SOL
☐ Add log settings to the state file ☐ Add log settings to the state file
✔ Add run modes (Editor, Game, Test) to state file @done (9/15/2021, 7:27:03 PM) ✔ Add run modes (Editor, Game, Test) to state file @done (9/15/2021, 7:27:03 PM)
✔ Add run mode interface class @done (9/15/2021, 8:22:35 PM) ✔ Add run mode interface class @done (9/15/2021, 8:22:35 PM)
✔ Read the window size and position on shutdown and write these to the state file @done (2/8/2022, 4:39:37 PM) ✔ Read the window size and position on shutdown and write these to the state file @done (2/8/2022, 4:39:37 PM)
Graphics: Graphics:
☐ Implement batch rendering
✔ Decide on a font/text rendering system @done (9/7/2021, 1:39:53 PM) ✔ Decide on a font/text rendering system @done (9/7/2021, 1:39:53 PM)
✔ Add FreeType to the project @done (9/7/2021, 2:23:13 PM) ✔ Add FreeType to the project @done (9/7/2021, 2:23:13 PM)
✔ Add a new class for font loading/management and text rendering @done (9/7/2021, 3:57:08 PM) ✔ Add a new class for font loading/management and text rendering @done (9/7/2021, 3:57:08 PM)

@ -46,6 +46,8 @@ Editor:
☐ Allow Tile Maps to be named ☐ Allow Tile Maps to be named
Tile Map Canvas: Tile Map Canvas:
☐ Implement a proper camera system and do not use panel scrolling @high
Implement drawing tiles: Implement drawing tiles:
✔ Connect Selected Tile Set to the Canvas @done (3/11/2022, 6:11:07 PM) ✔ Connect Selected Tile Set to the Canvas @done (3/11/2022, 6:11:07 PM)
✔ Handle mouse clicking in update @done (3/11/2022, 6:11:09 PM) ✔ Handle mouse clicking in update @done (3/11/2022, 6:11:09 PM)

@ -1,7 +1,12 @@
@echo off @echo off
SETLOCAL ENABLEDELAYEDEXPANSION
REM This script expects to be run from the parent directory REM This script expects to be run from the parent directory
REM ex. scripts/build.bat REM ex. scripts/build.bat
REM Sets the escape char. see for info:
REM https://stackoverflow.com/questions/55891318/how-to-echo-with-different-colors-in-the-windows-command-line-inside-a-for-loop
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
IF not exist build/ ( IF not exist build/ (
echo This script needs to be run from the directory above build/ echo This script needs to be run from the directory above build/
goto END goto END
@ -18,15 +23,33 @@ If "%~2" == "g" set "DELGUI=1"
IF defined RELEASE ( IF defined RELEASE (
cmake --build build/ --target ALL_BUILD --config Release cmake --build build/ --target ALL_BUILD --config Release
SET BUILD_ERRORLEVEL=!ERRORLEVEL!
IF NOT "!BUILD_ERRORLEVEL!"=="0" (
echo %ESC%[91mBUILD FAILED!%ESC%[0m %BUILD_ERRORLEVEL%
EXIT /B !BUILD_ERRORLEVEL!
)
xcopy /y test_data\engine_state.xml build\Release\ xcopy /y test_data\engine_state.xml build\Release\
) ELSE ( ) ELSE (
cmake --build build/ --target ALL_BUILD --config Debug cmake --build build/ --target ALL_BUILD --config Debug
SET BUILD_ERRORLEVEL=!ERRORLEVEL!
IF NOT "!BUILD_ERRORLEVEL!"=="0" (
echo %ESC%[91mBUILD FAILED!%ESC%[0m %BUILD_ERRORLEVEL%
EXIT /B !BUILD_ERRORLEVEL!
)
xcopy /y test_data\engine_state.xml build\Debug\ xcopy /y test_data\engine_state.xml build\Debug\
) )
echo %ESC%[92mBUILD SUCCEEDED!%ESC%[0m
IF defined DELGUI ( IF defined DELGUI (
del /s /q build\Debug\imgui.ini del /s /q build\Debug\imgui.ini
del /s /q build\Release\imgui.ini del /s /q build\Release\imgui.ini
) )
:END :END
ENDLOCAL

@ -15,7 +15,7 @@
#include <LunariumConfig.h> #include <LunariumConfig.h>
// Run modes // Run modes
#include <run_modes/tester/tester.h> #include <run_modes/testbed/testbed.h>
#include <run_modes/editor/editor.h> #include <run_modes/editor/editor.h>
// Sub Systems // Sub Systems
@ -232,7 +232,7 @@ namespace lunarium
Logger::Log(LogCategory::CORE, LogLevel::INFO, "Running in mode: %s", types[mState.Mode]); Logger::Log(LogCategory::CORE, LogLevel::INFO, "Running in mode: %s", types[mState.Mode]);
if (RunMode::MODE_TEST == mState.Mode) if (RunMode::MODE_TEST == mState.Mode)
{ {
mpRunMode = new Tester; mpRunMode = new TestBed;
} }
else if (RunMode::MODE_EDITOR == mState.Mode) else if (RunMode::MODE_EDITOR == mState.Mode)

@ -21,7 +21,7 @@ namespace lunarium
{ {
class Image; class Image;
class Tester; class TestBed;
class GUI; class GUI;
class IGraphics; class IGraphics;
class Window; class Window;
@ -93,7 +93,7 @@ namespace lunarium
Core& operator=(const Core&) = delete; Core& operator=(const Core&) = delete;
private: // RUN MODES private: // RUN MODES
Tester* mpTester; TestBed* mpTester;
}; };
} }

@ -1,6 +1,8 @@
add_library(tester tester.cpp scenes/baseScene.cpp scenes/simpleRenderScene.cpp scenes/physicsScene.cpp)
target_include_directories(tester
add_library(testbed testbed.cpp scenes/baseScene.cpp scenes/simpleRenderScene.cpp scenes/physicsScene.cpp)
target_include_directories(testbed
PUBLIC "${PROJECT_BINARY_DIR}" PUBLIC "${PROJECT_BINARY_DIR}"
PUBLIC ../../ PUBLIC ../../
PUBLIC ../../internal_libs PUBLIC ../../internal_libs
@ -10,4 +12,4 @@ target_include_directories(tester
PUBLIC ../../../external/box2d/include PUBLIC ../../../external/box2d/include
) )
target_link_libraries(tester box2d utils dearimgui) target_link_libraries(testbed box2d utils dearimgui)

@ -1,12 +1,12 @@
/****************************************************************************** /******************************************************************************
* File - tester.cpp * File - testbed.cpp
* Author - Joey Pollack * Author - Joey Pollack
* Date - 2021/09/15 (y/m/d) * Date - 2021/09/15 (y/m/d)
* Mod Date - 2021/09/15 (y/m/d) * Mod Date - 2021/09/15 (y/m/d)
* Description - Run a series of tests to verify engine functionality * Description - Run a series of tests to verify engine functionality
******************************************************************************/ ******************************************************************************/
#include "tester.h" #include "testbed.h"
#include "scenes/simpleRenderScene.h" #include "scenes/simpleRenderScene.h"
#include "scenes/physicsScene.h" #include "scenes/physicsScene.h"
@ -17,13 +17,13 @@
namespace lunarium namespace lunarium
{ {
Tester::Tester() TestBed::TestBed()
: mpScene(nullptr) : mpScene(nullptr)
{ {
} }
OpRes Tester::Initialize() OpRes TestBed::Initialize()
{ {
// return OpRes::Fail("Tester::Initialize not implemented"); // return OpRes::Fail("Tester::Initialize not implemented");
@ -43,14 +43,14 @@ namespace lunarium
return OpRes::OK(); return OpRes::OK();
} }
void Tester::Shutdown() void TestBed::Shutdown()
{ {
delete mpScene; delete mpScene;
mpScene = nullptr; mpScene = nullptr;
} }
void Tester::OnTick(double delta) void TestBed::OnTick(double delta)
{ {
if (Core::Input().IsKeyDown(KeyCode::NUM_1)) if (Core::Input().IsKeyDown(KeyCode::NUM_1))
{ {
@ -80,13 +80,13 @@ namespace lunarium
mpScene->OnTick(delta); mpScene->OnTick(delta);
} }
void Tester::OnRender(IGraphics* g) void TestBed::OnRender(IGraphics* g)
{ {
mpScene->OnRender(g); mpScene->OnRender(g);
} }
void Tester::OnKeyPress(InputManager::KeyPress kp) void TestBed::OnKeyPress(InputManager::KeyPress kp)
{ {
Logger::Log(mLogCat, LogLevel::INFO_VERBOSE, "Key Press Event: %s", kp.Key.Name.c_str()); Logger::Log(mLogCat, LogLevel::INFO_VERBOSE, "Key Press Event: %s", kp.Key.Name.c_str());
} }

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* File - tester.h * File - testbed.h
* Author - Joey Pollack * Author - Joey Pollack
* Date - 2021/09/15 (y/m/d) * Date - 2021/09/15 (y/m/d)
* Mod Date - 2021/09/15 (y/m/d) * Mod Date - 2021/09/15 (y/m/d)
@ -17,10 +17,10 @@ namespace lunarium
{ {
class Image; class Image;
class Tester : public iRunMode class TestBed : public iRunMode
{ {
public: public:
Tester(); TestBed();
OpRes Initialize(); OpRes Initialize();
void Shutdown(); void Shutdown();
void OnTick(double delta); void OnTick(double delta);
@ -31,8 +31,8 @@ namespace lunarium
private: private:
Tester(const Tester&) = delete; TestBed(const TestBed&) = delete;
const Tester& operator=(const Tester&) = delete; const TestBed& operator=(const TestBed&) = delete;
private: // Data private: // Data
uint32_t mLogCat; uint32_t mLogCat;
Loading…
Cancel
Save