Added Box2D to the project (not tested)

Gui_Panel_Refactor
Joeyrp 4 years ago
parent a42dc3c71a
commit aff4d9939c

3
.gitmodules vendored

@ -13,3 +13,6 @@
[submodule "external/freetype"] [submodule "external/freetype"]
path = external/freetype path = external/freetype
url = https://gitlab.freedesktop.org/freetype/freetype.git url = https://gitlab.freedesktop.org/freetype/freetype.git
[submodule "external/box2d"]
path = external/box2d
url = https://github.com/erincatto/box2d

@ -63,23 +63,27 @@ endif()
# CHECK THAT ALL SUBMODULES EXIST # CHECK THAT ALL SUBMODULES EXIST
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/glfw/CMakeLists.txt") if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/glfw/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "GLFW submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/glm/CMakeLists.txt") if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/glm/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "GLM submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/lua/CMakeLists.txt") if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/lua/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "LUA submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/pugixml/CMakeLists.txt") if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/pugixml/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "PUGIXML submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/freetype/CMakeLists.txt") if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/freetype/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.") message(FATAL_ERROR "FREETYPE submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/box2d/CMakeLists.txt")
message(FATAL_ERROR "BOX2D submodule was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
endif() endif()
# add GLFW # add GLFW
@ -109,6 +113,9 @@ add_subdirectory(external/pugixml)
# add freetype # add freetype
add_subdirectory(external/freetype) add_subdirectory(external/freetype)
# add box2d
add_subdirectory(external/box2d)
# add run mode tester # add run mode tester
add_subdirectory(src/run_modes/tester) add_subdirectory(src/run_modes/tester)
@ -124,6 +131,7 @@ target_include_directories(${PROJECT_NAME}
PUBLIC external/pugixml/src PUBLIC external/pugixml/src
PUBLIC external/glad/include PUBLIC external/glad/include
PUBLIC external/freetype/include PUBLIC external/freetype/include
PUBLIC external/box2d/include
) )
target_link_directories(${PROJECT_NAME} target_link_directories(${PROJECT_NAME}
@ -135,9 +143,10 @@ target_link_directories(${PROJECT_NAME}
PRIVATE src/run_modes/tester PRIVATE src/run_modes/tester
PRIVATE external/glad/src PRIVATE external/glad/src
PRIVATE external/freetype/src PRIVATE external/freetype/src
PRIVATE external/box2d/src
) )
target_link_libraries(${PROJECT_NAME} glfw glad glm dearimgui utils assets lua_static pugixml freetype tester) target_link_libraries(${PROJECT_NAME} glfw glad glm dearimgui utils assets lua_static pugixml freetype box2d tester)
if(WIN32) if(WIN32)
target_link_libraries(${PROJECT_NAME} opengl32.lib) target_link_libraries(${PROJECT_NAME} opengl32.lib)

@ -31,8 +31,8 @@ Core:
✔ Add the InputManager to the core @done (9/9/2021, 2:57:06 PM) ✔ Add the InputManager to the core @done (9/9/2021, 2:57:06 PM)
Physics: Physics:
☐ Research Box2D as a possibly physics library ✔ Research Box2D as a possible physics library @done (10/27/2021, 7:40:44 PM)
☐ Add Box2D to the project as an external library ✔ Add Box2D to the project as an external library @done (10/27/2021, 7:40:46 PM)
☐ Add a scene to the tester to test Box2D usage ☐ Add a scene to the tester to test Box2D usage
Audio: Audio:
@ -49,78 +49,12 @@ Utils:
✔ Make Logger fully static (no need to ever GetInstance) @done (10/26/2021, 4:43:55 PM) ✔ Make Logger fully static (no need to ever GetInstance) @done (10/26/2021, 4:43:55 PM)
✔ Need to add a static initialize method @done (10/26/2021, 4:43:57 PM) ✔ Need to add a static initialize method @done (10/26/2021, 4:43:57 PM)
Game:
☐ Implement Run Mode interface class
☐ Load game project data
☐ Manage list of scenes
☐ Manage global scripts
☐ Handle Events from the core
Scene:
☐ Manage scene scripts
☐ Manage game objects in scene
Manage list of Regions:
☐ Track which regions should be loaded
Region:
☐ List of renderable images for each layer
Game Object:
☐ List of components
Components:
☐ Transform
☐ Image
☐ Animation Controller
☐ Collider (maybe via Box2D?)
☐ Script
☐ RigidBody (via Box2D)
Animations:
☐ Animated Sprite class
Editor: @high
✔ Come up with project directory structure @done (9/17/2021, 6:46:44 PM)
☐ Make the editor a separate module @high
☐ Implement Run Mode interface class @high
☐ Reference raw asset files in a "content" folder@high
☐ Platform independant file browsing
☐ Scan script files to make sure they don't overwrite globals
Raw Asset Importers:
- Need classes to import raw resource files for the editor
☐ Raw Resource importer interface class
☐ Raw Image importer class
☐ Raw Sound importer class
☐ Raw font file importer class
GUI Panels:
Project Overview (Tree view):
Game Viewport:
Scene View:
Tile Map Editor:
☐ Tile map canvas
☐ Tile map pallete
☐ Hideable grid
☐ Stamp creater
Asset Viewer:
Properties:
Assets: Assets:
Types: Types:
- Classes that represent each resource Types - Classes that represent each resource Types
✔ Image class @done (9/16/2021, 2:46:34 PM) ✔ Image class @done (9/16/2021, 2:46:34 PM)
☐ Decouple Image class from OGLRenderer @high ✔ Decouple Image class from OGLRenderer @high @done (10/27/2021, 7:41:50 PM)
- Give the renderer a register image method that will take an Image and finish setting it up
☐ Font class ☐ Font class
☐ Sound class ☐ Sound class
☐ Script class ☐ Script class

@ -0,0 +1,35 @@
Editor: @high
✔ Come up with project directory structure @done (9/17/2021, 6:46:44 PM)
☐ Make the editor a separate module @high
☐ Implement Run Mode interface class @high
☐ Reference raw asset files in a "content" folder@high
☐ Platform independant file browsing
☐ Scan script files to make sure they don't overwrite globals
Raw Asset Importers:
- Need classes to import raw resource files for the editor
☐ Raw Resource importer interface class
☐ Raw Image importer class
☐ Raw Sound importer class
☐ Raw font file importer class
GUI Panels:
Project Overview (Tree view):
Game Viewport:
Scene View:
Scene Hierarchy (Tree View):
Tile Map Editor:
☐ Tile map canvas
☐ Tile map pallete
☐ Hideable grid
☐ Stamp creater
☐ Flood Fill
Asset Viewer:
Properties:

@ -0,0 +1,32 @@
Game:
☐ Implement Run Mode interface class
☐ Load game project data
☐ Manage list of scenes
☐ Manage global scripts
☐ Handle Events from the core
Scene:
☐ Manage scene scripts
☐ Manage game objects in scene
Manage list of Regions:
☐ Track which regions should be loaded
Region:
☐ List of renderable images for each layer
Game Object:
☐ List of components
Components:
☐ Transform
☐ Image
☐ Animation Controller
☐ Collider (maybe via Box2D?)
☐ Script
☐ RigidBody (via Box2D)
Animations:
☐ Animated Sprite clas

1
external/box2d vendored

@ -0,0 +1 @@
Subproject commit cd2c28dba83e4f359d08aeb7b70afd9e35e39eda

@ -5,8 +5,8 @@ REM ex. scripts/cmconfig.bat
IF "%~1" == "noedit" ( IF "%~1" == "noedit" (
echo "no editor build" echo "no editor build"
cmake -Wno-dev -DNO_EDITOR=ON -DGLFW_BUILD_DOCS=OFF -B build/ -S . -G "Visual Studio 16 2019" -A x64 cmake -Wno-dev -DNO_EDITOR=ON -DGLFW_BUILD_DOCS=OFF -DBOX2D_BUILD_TESTBED=OFF -B build/ -S . -G "Visual Studio 16 2019" -A x64
) ELSE ( ) ELSE (
echo "WITH EDITOR" echo "WITH EDITOR"
cmake -Wno-dev -DNO_EDITOR=OFF -DGLFW_BUILD_DOCS=OFF -B build/ -S . -G "Visual Studio 16 2019" -A x64 cmake -Wno-dev -DNO_EDITOR=OFF -DGLFW_BUILD_DOCS=OFF -DBOX2D_BUILD_TESTBED=OFF -B build/ -S . -G "Visual Studio 16 2019" -A x64
) )

@ -2,4 +2,4 @@
# This script expects to be run from the parent directory # This script expects to be run from the parent directory
# ex. scripts/cmconfig.sh # ex. scripts/cmconfig.sh
cmake -DGLFW_BUILD_DOCS=OFF -S . -B build/ cmake -Wno-dev -DNO_EDITOR=OFF -DGLFW_BUILD_DOCS=OFF -DBOX2D_BUILD_TESTBED=OFF -S . -B build/
Loading…
Cancel
Save