mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 23:33:41 +00:00
Compare commits
No commits in common. "92283e41ba59ad9315488ad36d4ce0853256588f" and "d10afe1e074ee6acf27fbe7e0dcc1faaa3947764" have entirely different histories.
92283e41ba
...
d10afe1e07
24
.github/workflows/doxygen.yaml
vendored
24
.github/workflows/doxygen.yaml
vendored
@ -1,24 +0,0 @@
|
|||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: 'true' # might need recursive, tbd
|
|
||||||
- name: Doxygen Action
|
|
||||||
uses: mattnotmitt/doxygen-action@v1.1.0
|
|
||||||
with:
|
|
||||||
doxyfile-path: 'docs/Doxyfile'
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./docs/html
|
|
||||||
22
.gitignore
vendored
22
.gitignore
vendored
@ -24,6 +24,7 @@ build/
|
|||||||
*.app
|
*.app
|
||||||
|
|
||||||
# Generated by Visual Studio
|
# Generated by Visual Studio
|
||||||
|
.vscode/
|
||||||
.vs/
|
.vs/
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
@ -55,22 +56,7 @@ build/
|
|||||||
|
|
||||||
# Sublime Text
|
# Sublime Text
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
*.sublime-project
|
||||||
# Created by https://www.gitignore.io/api/visualstudiocode
|
|
||||||
# Edit at https://www.gitignore.io/?templates=visualstudiocode
|
|
||||||
|
|
||||||
### VisualStudioCode ###
|
|
||||||
.vscode/* # Maybe .vscode/**/* instead - see comments
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
|
|
||||||
### VisualStudioCode Patch ###
|
|
||||||
# Ignore all local history of files
|
|
||||||
**/.history
|
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/visualstudiocode
|
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@ -89,7 +75,3 @@ Desktop.ini
|
|||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
|
||||||
*.puml
|
*.puml
|
||||||
|
|
||||||
docs/latex/
|
|
||||||
docs/html/
|
|
||||||
docs/diagrams/
|
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -14,6 +14,3 @@
|
|||||||
path = extern/SDL_ttf
|
path = extern/SDL_ttf
|
||||||
url = https://github.com/libsdl-org/SDL_ttf.git
|
url = https://github.com/libsdl-org/SDL_ttf.git
|
||||||
branch = release-2.22.x
|
branch = release-2.22.x
|
||||||
[submodule "docs/doxygen-awesome-css"]
|
|
||||||
path = docs/doxygen-awesome-css
|
|
||||||
url = https://github.com/jothepro/doxygen-awesome-css.git
|
|
||||||
|
|||||||
17
.vscode/launch.json
vendored
17
.vscode/launch.json
vendored
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "debug",
|
|
||||||
"type": "cppdbg",
|
|
||||||
"miDebuggerPath": "c:\\mingw64\\bin\\gdb.exe",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${workspaceFolder}/build/SDL_Minigame.exe",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"preLaunchTask": "build-debug"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"cmake.configureOnOpen": true,
|
|
||||||
"editor.tabSize": 4,
|
|
||||||
"editor.insertSpaces": true,
|
|
||||||
}
|
|
||||||
67
.vscode/tasks.json
vendored
67
.vscode/tasks.json
vendored
@ -1,67 +0,0 @@
|
|||||||
{
|
|
||||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
||||||
// for the documentation about the tasks.json format
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"label": "build-engine-debug",
|
|
||||||
"command": "cd build; cmake -DCMAKE_BUILD_TYPE=Debug; cmake --build .",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"group": "build"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"label": "build-engine",
|
|
||||||
"command": "cd build; cmake -DCMAKE_BUILD_TYPE=Release; cmake --build .",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "docker-build",
|
|
||||||
"label": "build-doxygen",
|
|
||||||
"dockerBuild": {
|
|
||||||
"context": "${workspaceRoot}/docs/docker",
|
|
||||||
"tag": "vego_doxygen-docker",
|
|
||||||
},
|
|
||||||
"problemMatcher": [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "docker-run",
|
|
||||||
"label": "gen-doxygen",
|
|
||||||
"dockerRun": {
|
|
||||||
"image": "vego_doxygen-docker",
|
|
||||||
"remove": true,
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"localPath": "${workspaceFolder}",
|
|
||||||
"containerPath": "/source"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"localPath": "${workspaceFolder}/docs",
|
|
||||||
"containerPath": "/output"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"localPath": "${workspaceFolder}/docs/Doxyfile",
|
|
||||||
"containerPath": "/Doxyfile"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"problemMatcher": [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "process",
|
|
||||||
"label": "open-doxygen",
|
|
||||||
"command": "explorer",
|
|
||||||
"windows": {
|
|
||||||
"command": "explorer.exe"
|
|
||||||
},
|
|
||||||
"args": ["${workspaceFolder}\\docs\\html\\index.html"],
|
|
||||||
"problemMatcher": [],
|
|
||||||
"dependsOn": "gen-doxygen",
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -34,8 +34,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") # -fsanitize=address -fno-omit-frame-pointer")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer")
|
||||||
#target_link_libraries(${PROJECT_NAME} PRIVATE "-fsanitize=address")
|
target_link_libraries(${PROJECT_NAME} PRIVATE "-fsanitize=address")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -42,13 +42,13 @@ DOXYFILE_ENCODING = UTF-8
|
|||||||
# title of most generated pages and in a few other places.
|
# title of most generated pages and in a few other places.
|
||||||
# The default value is: My Project.
|
# The default value is: My Project.
|
||||||
|
|
||||||
PROJECT_NAME = "VEGO-Engine"
|
PROJECT_NAME = "My Project"
|
||||||
|
|
||||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.1
|
PROJECT_NUMBER =
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
@ -67,14 +67,14 @@ PROJECT_LOGO =
|
|||||||
# when the HTML document is shown. Doxygen will copy the logo to the output
|
# when the HTML document is shown. Doxygen will copy the logo to the output
|
||||||
# directory.
|
# directory.
|
||||||
|
|
||||||
PROJECT_ICON = assets/chicken_neutral_knight.png
|
PROJECT_ICON =
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
||||||
# into which the generated documentation will be written. If a relative path is
|
# into which the generated documentation will be written. If a relative path is
|
||||||
# entered, it will be relative to the location where doxygen was started. If
|
# entered, it will be relative to the location where doxygen was started. If
|
||||||
# left blank the current directory will be used.
|
# left blank the current directory will be used.
|
||||||
|
|
||||||
OUTPUT_DIRECTORY = docs
|
OUTPUT_DIRECTORY =
|
||||||
|
|
||||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
|
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
|
||||||
# sub-directories (in 2 levels) under the output directory of each output format
|
# sub-directories (in 2 levels) under the output directory of each output format
|
||||||
@ -396,7 +396,7 @@ AUTOLINK_SUPPORT = YES
|
|||||||
# diagrams that involve STL classes more complete and accurate.
|
# diagrams that involve STL classes more complete and accurate.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
BUILTIN_STL_SUPPORT = YES
|
BUILTIN_STL_SUPPORT = NO
|
||||||
|
|
||||||
# If you use Microsoft's C++/CLI language, you should set this option to YES to
|
# If you use Microsoft's C++/CLI language, you should set this option to YES to
|
||||||
# enable parsing support.
|
# enable parsing support.
|
||||||
@ -842,7 +842,7 @@ CITE_BIB_FILES =
|
|||||||
# messages are off.
|
# messages are off.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
QUIET = YES
|
QUIET = NO
|
||||||
|
|
||||||
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
||||||
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
|
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
|
||||||
@ -949,7 +949,7 @@ WARN_LOGFILE =
|
|||||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||||
# Note: If this tag is empty the current directory is searched.
|
# Note: If this tag is empty the current directory is searched.
|
||||||
|
|
||||||
INPUT = ./include ./src
|
INPUT =
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||||
@ -989,15 +989,63 @@ INPUT_FILE_ENCODING =
|
|||||||
# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
|
# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
|
||||||
# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
|
# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
|
||||||
|
|
||||||
FILE_PATTERNS = *.cpp \
|
FILE_PATTERNS = *.c \
|
||||||
|
*.cc \
|
||||||
|
*.cxx \
|
||||||
|
*.cxxm \
|
||||||
|
*.cpp \
|
||||||
|
*.cppm \
|
||||||
|
*.ccm \
|
||||||
|
*.c++ \
|
||||||
|
*.c++m \
|
||||||
|
*.java \
|
||||||
|
*.ii \
|
||||||
|
*.ixx \
|
||||||
|
*.ipp \
|
||||||
|
*.i++ \
|
||||||
|
*.inl \
|
||||||
|
*.idl \
|
||||||
|
*.ddl \
|
||||||
|
*.odl \
|
||||||
*.h \
|
*.h \
|
||||||
*.hpp
|
*.hh \
|
||||||
|
*.hxx \
|
||||||
|
*.hpp \
|
||||||
|
*.h++ \
|
||||||
|
*.ixx \
|
||||||
|
*.l \
|
||||||
|
*.cs \
|
||||||
|
*.d \
|
||||||
|
*.php \
|
||||||
|
*.php4 \
|
||||||
|
*.php5 \
|
||||||
|
*.phtml \
|
||||||
|
*.inc \
|
||||||
|
*.m \
|
||||||
|
*.markdown \
|
||||||
|
*.md \
|
||||||
|
*.mm \
|
||||||
|
*.dox \
|
||||||
|
*.py \
|
||||||
|
*.pyw \
|
||||||
|
*.f90 \
|
||||||
|
*.f95 \
|
||||||
|
*.f03 \
|
||||||
|
*.f08 \
|
||||||
|
*.f18 \
|
||||||
|
*.f \
|
||||||
|
*.for \
|
||||||
|
*.vhd \
|
||||||
|
*.vhdl \
|
||||||
|
*.ucf \
|
||||||
|
*.qsf \
|
||||||
|
*.ice
|
||||||
|
|
||||||
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
||||||
# be searched for input files as well.
|
# be searched for input files as well.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
RECURSIVE = YES
|
RECURSIVE = NO
|
||||||
|
|
||||||
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
||||||
# excluded from the INPUT source files. This way you can easily exclude a
|
# excluded from the INPUT source files. This way you can easily exclude a
|
||||||
@ -1036,17 +1084,14 @@ EXCLUDE_SYMBOLS =
|
|||||||
# that contain example code fragments that are included (see the \include
|
# that contain example code fragments that are included (see the \include
|
||||||
# command).
|
# command).
|
||||||
|
|
||||||
EXAMPLE_PATH = ./include \
|
EXAMPLE_PATH =
|
||||||
./src
|
|
||||||
|
|
||||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
||||||
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
||||||
# *.h) to filter out the source-files in the directories. If left blank all
|
# *.h) to filter out the source-files in the directories. If left blank all
|
||||||
# files are included.
|
# files are included.
|
||||||
|
|
||||||
EXAMPLE_PATTERNS = *.cpp \
|
EXAMPLE_PATTERNS = *
|
||||||
*.h \
|
|
||||||
*.hpp
|
|
||||||
|
|
||||||
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
|
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
|
||||||
# searched for input files to be used with the \include or \dontinclude commands
|
# searched for input files to be used with the \include or \dontinclude commands
|
||||||
@ -1280,7 +1325,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
# of the possible markers and block names see the documentation.
|
# of the possible markers and block names see the documentation.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_HEADER = docs/header.html
|
HTML_HEADER =
|
||||||
|
|
||||||
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
||||||
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
||||||
@ -1320,10 +1365,7 @@ HTML_STYLESHEET =
|
|||||||
# documentation.
|
# documentation.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css \
|
HTML_EXTRA_STYLESHEET =
|
||||||
docs/doxygen-awesome-css/doxygen-awesome-sidebar-only.css \
|
|
||||||
docs/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css \
|
|
||||||
docs/custom.css
|
|
||||||
|
|
||||||
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
||||||
# other source files which should be copied to the HTML output directory. Note
|
# other source files which should be copied to the HTML output directory. Note
|
||||||
@ -1333,10 +1375,7 @@ HTML_EXTRA_STYLESHEET = docs/doxygen-awesome-css/doxygen-awesome.css \
|
|||||||
# files will be copied as-is; there are no commands or markers available.
|
# files will be copied as-is; there are no commands or markers available.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_EXTRA_FILES = docs/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \
|
HTML_EXTRA_FILES =
|
||||||
docs/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \
|
|
||||||
docs/doxygen-awesome-css/doxygen-awesome-paragraph-link.js \
|
|
||||||
docs/doxygen-awesome-css/doxygen-awesome-interactive-toc.js
|
|
||||||
|
|
||||||
# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
|
# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
|
||||||
# should be rendered with a dark or light theme.
|
# should be rendered with a dark or light theme.
|
||||||
@ -1349,7 +1388,7 @@ HTML_EXTRA_FILES = docs/doxygen-awesome-css/doxygen-awesome-darkmode-toggl
|
|||||||
# The default value is: AUTO_LIGHT.
|
# The default value is: AUTO_LIGHT.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_COLORSTYLE = LIGHT
|
HTML_COLORSTYLE = AUTO_LIGHT
|
||||||
|
|
||||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
||||||
# will adjust the colors in the style sheet and background images according to
|
# will adjust the colors in the style sheet and background images according to
|
||||||
@ -1677,7 +1716,7 @@ DISABLE_INDEX = NO
|
|||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
GENERATE_TREEVIEW = YES
|
GENERATE_TREEVIEW = NO
|
||||||
|
|
||||||
# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
|
# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
|
||||||
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
|
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
|
||||||
@ -2463,7 +2502,7 @@ HIDE_UNDOC_RELATIONS = YES
|
|||||||
# set to NO
|
# set to NO
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
HAVE_DOT = YES
|
HAVE_DOT = NO
|
||||||
|
|
||||||
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
|
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
|
||||||
# to run in parallel. When set to 0 doxygen will base this on the number of
|
# to run in parallel. When set to 0 doxygen will base this on the number of
|
||||||
@ -2600,7 +2639,7 @@ DOT_WRAP_THRESHOLD = 17
|
|||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
TEMPLATE_RELATIONS = YES
|
TEMPLATE_RELATIONS = NO
|
||||||
|
|
||||||
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
|
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
|
||||||
# YES then doxygen will generate a graph for each documented file showing the
|
# YES then doxygen will generate a graph for each documented file showing the
|
||||||
@ -2688,7 +2727,7 @@ DIR_GRAPH_MAX_DEPTH = 1
|
|||||||
# The default value is: png.
|
# The default value is: png.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
DOT_IMAGE_FORMAT = SVG
|
DOT_IMAGE_FORMAT = png
|
||||||
|
|
||||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||||
# enable generation of interactive SVG images that allow zooming and panning.
|
# enable generation of interactive SVG images that allow zooming and panning.
|
||||||
@ -2700,13 +2739,13 @@ DOT_IMAGE_FORMAT = SVG
|
|||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
INTERACTIVE_SVG = YES
|
INTERACTIVE_SVG = NO
|
||||||
|
|
||||||
# The DOT_PATH tag can be used to specify the path where the dot tool can be
|
# The DOT_PATH tag can be used to specify the path where the dot tool can be
|
||||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
DOT_PATH = /usr/bin/dot
|
DOT_PATH =
|
||||||
|
|
||||||
# The DOTFILE_DIRS tag can be used to specify one or more directories that
|
# The DOTFILE_DIRS tag can be used to specify one or more directories that
|
||||||
# contain dot files that are included in the documentation (see the \dotfile
|
# contain dot files that are included in the documentation (see the \dotfile
|
||||||
@ -1,63 +0,0 @@
|
|||||||
# Doxyfile
|
|
||||||
|
|
||||||
# Project information
|
|
||||||
PROJECT_NAME = "SDL Minigame"
|
|
||||||
PROJECT_NUMBER = "1.0"
|
|
||||||
PROJECT_ICON = assets/chicken_neutral_knight.png
|
|
||||||
OUTPUT_DIRECTORY = docs
|
|
||||||
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
|
||||||
EXTRACT_ALL = NO
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
|
||||||
|
|
||||||
CLASS_DIAGRAMS = YES
|
|
||||||
|
|
||||||
HIDE_UNDOC_RELATIONS = YES
|
|
||||||
HAVE_DOT = YES
|
|
||||||
DOT_PATH = /usr/bin/dot
|
|
||||||
|
|
||||||
CLASS_GRAPH = YES
|
|
||||||
COLLABORATION_GRAPH = YES
|
|
||||||
UML_LOOK = YES
|
|
||||||
UML_LIMIT_NUM_FIELDS = 50
|
|
||||||
TEMPLATE_RELATIONS = YES
|
|
||||||
DOT_TRANSPARENT = YES
|
|
||||||
|
|
||||||
# Source files
|
|
||||||
INPUT = ./include ./src
|
|
||||||
FILE_PATTERNS = *.cpp *.h *.hpp
|
|
||||||
EXAMPLE_PATH = ./include ./src
|
|
||||||
EXAMPLE_PATTERNS = *.cpp *.h *.hpp
|
|
||||||
|
|
||||||
# Output formats
|
|
||||||
GENERATE_XML = YES
|
|
||||||
GENERATE_HTML = YES
|
|
||||||
DOT_IMAGE_FORMAT = SVG
|
|
||||||
COLLABORATION_GRAPH = YES
|
|
||||||
GENERATE_LATEX = NO
|
|
||||||
|
|
||||||
# Extra settings
|
|
||||||
USE_MATHJAX = YES
|
|
||||||
CALL_GRAPH = YES
|
|
||||||
CALLER_GRAPH = YES
|
|
||||||
EXTRACT_PRIVATE = YES
|
|
||||||
EXTRACT_STATIC = YES
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
|
||||||
EXTRACT_LOCAL_METHODS = YES
|
|
||||||
EXTRACT_ANON_NSPACES = YES
|
|
||||||
SHOW_FILES = YES
|
|
||||||
SHOW_INCLUDE_FILES = YES
|
|
||||||
SHOW_USED_FILES = YES
|
|
||||||
RECURSIVE = YES
|
|
||||||
|
|
||||||
# Class diagram options
|
|
||||||
INCLUDE_GRAPH = YES
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
|
||||||
GRAPHICAL_HIERARCHY = YES
|
|
||||||
DIRECTORY_GRAPH = YES
|
|
||||||
DISABLE_INDEX = YES
|
|
||||||
GENERATE_TREEVIEW = YES
|
|
||||||
HTML_COLLABORATION = YES
|
|
||||||
|
|
||||||
# idk everything else
|
|
||||||
TAB_SIZE = 4
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
html {
|
|
||||||
/* primary theme color. This will affect the entire websites color scheme: links, arrows, labels, ... */
|
|
||||||
--primary-color: #bd93f9;
|
|
||||||
--primary-dark-color: #9270e4;
|
|
||||||
--primary-light-color: #9270e4;
|
|
||||||
|
|
||||||
/* page base colors */
|
|
||||||
--page-background-color: #ffffff;
|
|
||||||
--page-foreground-color: #2f4153;
|
|
||||||
--page-secondary-foreground-color: #6f7e8e;
|
|
||||||
|
|
||||||
/* color for all separators on the website: hr, borders, ... */
|
|
||||||
--separator-color: #bd93f965;
|
|
||||||
|
|
||||||
/* border radius for all rounded components. Will affect many components, like dropdowns, memitems, codeblocks, ... */
|
|
||||||
--border-radius-large: 22px;
|
|
||||||
--border-radius-small: 9px;
|
|
||||||
--border-radius-medium: 14px;
|
|
||||||
|
|
||||||
/* default spacings. Most components reference these values for spacing, to provide uniform spacing on the page. */
|
|
||||||
--spacing-small: 8px;
|
|
||||||
--spacing-medium: 14px;
|
|
||||||
--spacing-large: 19px;
|
|
||||||
|
|
||||||
--top-height: 125px;
|
|
||||||
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
html.dark-mode {
|
|
||||||
color-scheme: dark;
|
|
||||||
|
|
||||||
--primary-color: #bd93f9;
|
|
||||||
--primary-dark-color: #9270e4;
|
|
||||||
--primary-light-color: #9270e4;
|
|
||||||
--primary-lighter-color: #191e21;
|
|
||||||
--primary-lightest-color: #191a1c;
|
|
||||||
|
|
||||||
--page-background-color: #21222c;
|
|
||||||
--page-foreground-color: #d2dbde;
|
|
||||||
--page-secondary-foreground-color: #859399;
|
|
||||||
--separator-color: #3a3246;
|
|
||||||
--side-nav-background: #282a36;
|
|
||||||
--side-nav-foreground: #f8f8f2;
|
|
||||||
--toc-background: #282A36;
|
|
||||||
--searchbar-background: var(--page-background-color);
|
|
||||||
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
.paramname em {
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--primary-dark-color);
|
|
||||||
}
|
|
||||||
62
docs/diagrams/.clang-uml
Normal file
62
docs/diagrams/.clang-uml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
compilation_database_dir: ../..
|
||||||
|
output_directory: .
|
||||||
|
diagrams:
|
||||||
|
|
||||||
|
includes:
|
||||||
|
type: include
|
||||||
|
relative_to: ../..
|
||||||
|
glob:
|
||||||
|
- src/*.cpp
|
||||||
|
- include/*.h
|
||||||
|
generate_system_headers: true
|
||||||
|
include:
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
- include
|
||||||
|
plantuml:
|
||||||
|
before:
|
||||||
|
- 'skinparam linetype ortho'
|
||||||
|
|
||||||
|
includes_no_external:
|
||||||
|
type: include
|
||||||
|
relative_to: ../..
|
||||||
|
glob:
|
||||||
|
- src/*.cpp
|
||||||
|
- include/*.h
|
||||||
|
include:
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
- include
|
||||||
|
plantuml:
|
||||||
|
before:
|
||||||
|
- 'skinparam linetype ortho'
|
||||||
|
|
||||||
|
classes:
|
||||||
|
type: class
|
||||||
|
relative_to: ../..
|
||||||
|
glob:
|
||||||
|
- src/*.cpp
|
||||||
|
- include/*.h
|
||||||
|
include:
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
- include
|
||||||
|
plantuml:
|
||||||
|
before:
|
||||||
|
- 'skinparam linetype ortho'
|
||||||
|
|
||||||
|
load_map_example_sequence:
|
||||||
|
type: sequence
|
||||||
|
relative_to: ../..
|
||||||
|
glob:
|
||||||
|
- src/*.cpp
|
||||||
|
- include/*.h
|
||||||
|
include:
|
||||||
|
paths:
|
||||||
|
- src
|
||||||
|
- include
|
||||||
|
start_from:
|
||||||
|
- function: "Map::loadMap(const char *,int,int)"
|
||||||
|
plantuml:
|
||||||
|
before:
|
||||||
|
- 'skinparam linetype ortho'
|
||||||
1
docs/diagrams/classes.svg
Normal file
1
docs/diagrams/classes.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 149 KiB |
12
docs/diagrams/howto.md
Normal file
12
docs/diagrams/howto.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Need [clang-uml](https://clang-uml.github.io/index.html)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
clang-uml
|
||||||
|
clang-uml --add-compile-flag -I/usr/lib/clang/16/include # might need additional flags, example for my machine
|
||||||
|
clang-uml --print-from -n load_map_example_sequence # to get availabel commands for sequence diagram
|
||||||
|
```
|
||||||
|
|
||||||
|
then use plant uml to generate an actual `.svg` vector graphic
|
||||||
|
```sh
|
||||||
|
plantuml -tsvg *.puml
|
||||||
|
```
|
||||||
1
docs/diagrams/includes.svg
Normal file
1
docs/diagrams/includes.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 183 KiB |
1
docs/diagrams/includes_no_external.svg
Normal file
1
docs/diagrams/includes_no_external.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 119 KiB |
1
docs/diagrams/load_map_example_sequence.svg
Normal file
1
docs/diagrams/load_map_example_sequence.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 257 KiB |
1
docs/diagrams/sequence.svg
Normal file
1
docs/diagrams/sequence.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.3 MiB |
@ -1,13 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
RUN apk --update --no-cache add doxygen graphviz git
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
WORKDIR /source
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
|
|
||||||
CMD ["doxygen", "/Doxyfile_copy"]
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cp /Doxyfile /Doxyfile_copy
|
|
||||||
echo "OUTPUT_DIRECTORY = /output" >> /Doxyfile_copy
|
|
||||||
|
|
||||||
exec "$@"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Subproject commit df88fe4fdd97714fadfd3ef17de0b4401f804052
|
|
||||||
110
docs/header.html
110
docs/header.html
@ -1,110 +0,0 @@
|
|||||||
<!-- HTML header for doxygen 1.10.0-->
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=11" />
|
|
||||||
<meta name="generator" content="Doxygen $doxygenversion" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<!--BEGIN PROJECT_NAME-->
|
|
||||||
<title>$projectname: $title</title>
|
|
||||||
<!--END PROJECT_NAME-->
|
|
||||||
<!--BEGIN !PROJECT_NAME-->
|
|
||||||
<title>$title</title>
|
|
||||||
<!--END !PROJECT_NAME-->
|
|
||||||
<!--BEGIN PROJECT_ICON-->
|
|
||||||
<link rel="icon" href="$relpath^$projecticon" type="image/x-icon" />
|
|
||||||
<!--END PROJECT_ICON-->
|
|
||||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css" />
|
|
||||||
<!--BEGIN DISABLE_INDEX-->
|
|
||||||
<!--BEGIN FULL_SIDEBAR-->
|
|
||||||
<script type="text/javascript">
|
|
||||||
var page_layout = 1;
|
|
||||||
</script>
|
|
||||||
<!--END FULL_SIDEBAR-->
|
|
||||||
<!--END DISABLE_INDEX-->
|
|
||||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
||||||
<!--BEGIN COPY_CLIPBOARD-->
|
|
||||||
<script type="text/javascript" src="$relpath^clipboard.js"></script>
|
|
||||||
<!--END COPY_CLIPBOARD-->
|
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
DoxygenAwesomeDarkModeToggle.init()
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
DoxygenAwesomeFragmentCopyButton.init()
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
DoxygenAwesomeParagraphLink.init()
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
DoxygenAwesomeInteractiveToc.init()
|
|
||||||
</script>
|
|
||||||
$treeview
|
|
||||||
$search
|
|
||||||
$mathjax
|
|
||||||
$darkmode
|
|
||||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
||||||
$extrastylesheet
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<!--BEGIN DISABLE_INDEX-->
|
|
||||||
<!--BEGIN FULL_SIDEBAR-->
|
|
||||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
||||||
<!-- do not remove this div, it is closed by doxygen! -->
|
|
||||||
<!--END FULL_SIDEBAR-->
|
|
||||||
<!--END DISABLE_INDEX-->
|
|
||||||
<div id="top">
|
|
||||||
<!-- do not remove this div, it is closed by doxygen! -->
|
|
||||||
<!--BEGIN TITLEAREA-->
|
|
||||||
<div id="titlearea">
|
|
||||||
<table cellspacing="0" cellpadding="0">
|
|
||||||
<tbody>
|
|
||||||
<tr id="projectrow">
|
|
||||||
<!--BEGIN PROJECT_LOGO-->
|
|
||||||
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo" $logosize /></td>
|
|
||||||
<!--END PROJECT_LOGO-->
|
|
||||||
<!--BEGIN PROJECT_NAME-->
|
|
||||||
<td id="projectalign">
|
|
||||||
<div id="projectname">$projectname
|
|
||||||
<!--BEGIN PROJECT_NUMBER--><span id="projectnumber"> $projectnumber</span>
|
|
||||||
<!--END PROJECT_NUMBER-->
|
|
||||||
</div>
|
|
||||||
<!--BEGIN PROJECT_BRIEF-->
|
|
||||||
<div id="projectbrief">$projectbrief</div>
|
|
||||||
<!--END PROJECT_BRIEF-->
|
|
||||||
</td>
|
|
||||||
<!--END PROJECT_NAME-->
|
|
||||||
<!--BEGIN !PROJECT_NAME-->
|
|
||||||
<!--BEGIN PROJECT_BRIEF-->
|
|
||||||
<td>
|
|
||||||
<div id="projectbrief">$projectbrief</div>
|
|
||||||
</td>
|
|
||||||
<!--END PROJECT_BRIEF-->
|
|
||||||
<!--END !PROJECT_NAME-->
|
|
||||||
<!--BEGIN DISABLE_INDEX-->
|
|
||||||
<!--BEGIN SEARCHENGINE-->
|
|
||||||
<!--BEGIN !FULL_SIDEBAR-->
|
|
||||||
<td>$searchbox</td>
|
|
||||||
<!--END !FULL_SIDEBAR-->
|
|
||||||
<!--END SEARCHENGINE-->
|
|
||||||
<!--END DISABLE_INDEX-->
|
|
||||||
</tr>
|
|
||||||
<!--BEGIN SEARCHENGINE-->
|
|
||||||
<!--BEGIN FULL_SIDEBAR-->
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">$searchbox</td>
|
|
||||||
</tr>
|
|
||||||
<!--END FULL_SIDEBAR-->
|
|
||||||
<!--END SEARCHENGINE-->
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!--END TITLEAREA-->
|
|
||||||
<!-- end header part -->
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"folders":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"path": "."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"settings":
|
|
||||||
{
|
|
||||||
"tab_size": 4
|
|
||||||
},
|
|
||||||
"build_systems": [
|
|
||||||
{
|
|
||||||
"name": "Build engine",
|
|
||||||
"shell_cmd": "cmake --build build",
|
|
||||||
"working_dir": "$project_path",
|
|
||||||
"variants": [
|
|
||||||
{
|
|
||||||
"name": "Debug",
|
|
||||||
"shell_cmd": "cmake -DCMAKE_BUILD_TYPE=Debug build && cmake --build build",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Release",
|
|
||||||
"shell_cmd": "cmake -DCMAKE_BUILD_TYPE=Release build && cmake --build build",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Generate CMake",
|
|
||||||
"shell_cmd": "cmake -S . -B build",
|
|
||||||
"working_dir": "$project_path",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Doxygen",
|
|
||||||
"shell_cmd": "xdg-open $project_path/docs/html/index.html",
|
|
||||||
"working_dir": "$project_path",
|
|
||||||
"variants": [
|
|
||||||
{
|
|
||||||
"name": "Build image",
|
|
||||||
"shell_cmd": "docker build -t vego_engine-docker $project_path/docs/docker",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Generate documentation",
|
|
||||||
"shell_cmd": "docker run --rm -v \"$project_path:/source\" -v \"$project_path/docs:/output\" -v \"$project_path/docs/Doxyfile:/Doxyfile\" vego_engine-docker",
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,9 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//! \file CollisionHandler.h
|
|
||||||
//! \file CollisionHandler.cpp
|
|
||||||
//! \file TransformComponent.cpp
|
|
||||||
|
|
||||||
#include "ColliderComponent.h"
|
#include "ColliderComponent.h"
|
||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
@ -21,11 +17,9 @@
|
|||||||
class ColliderComponent;
|
class ColliderComponent;
|
||||||
class Entity;
|
class Entity;
|
||||||
|
|
||||||
// [IntersectionBitSet]
|
|
||||||
constexpr uint8_t DIRECTION_C = 4;
|
constexpr uint8_t DIRECTION_C = 4;
|
||||||
|
|
||||||
using IntersectionBitSet = std::bitset<DIRECTION_C>;
|
using IntersectionBitSet = std::bitset<DIRECTION_C>;
|
||||||
// [IntersectionBitSet]
|
|
||||||
|
|
||||||
class CollisionHandler
|
class CollisionHandler
|
||||||
{
|
{
|
||||||
@ -53,20 +47,6 @@ public:
|
|||||||
std::initializer_list<Entity::TeamLabel> const& teamLabels = {},
|
std::initializer_list<Entity::TeamLabel> const& teamLabels = {},
|
||||||
bool negateTeam = false);
|
bool negateTeam = false);
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \brief Tests entity against all entities with the specified labels for a collision
|
|
||||||
* \details Tests the given entity against every other entity with the specified labels for intersections between their collison boxes.
|
|
||||||
* If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped
|
|
||||||
* if they don't have a ColliderComponent
|
|
||||||
* \param entity The primary entity to check against. Return values will be relative to this entity
|
|
||||||
* \param posMod Modifier to apply toposition before checking collisions.
|
|
||||||
* \param groupLabels Entities need to have at least one listed GroupLabels to get checked against
|
|
||||||
* \param teamLabels Entities need to have one of the specified TeamLabels to get checked against
|
|
||||||
* \param negateTeam If set to true, entities will only be checked against if they **don't** have one of the specified TeamLabels
|
|
||||||
* \see ColliderComponent
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T getAnyIntersection(
|
T getAnyIntersection(
|
||||||
Entity* entity,
|
Entity* entity,
|
||||||
|
|||||||
@ -16,61 +16,36 @@ using ComponentBitSet = std::bitset<MAX_COMPONENTS>;
|
|||||||
using GroupBitSet = std::bitset<MAX_GROUPS>;
|
using GroupBitSet = std::bitset<MAX_GROUPS>;
|
||||||
using ComponentArray = std::array<Component*, MAX_COMPONENTS>;
|
using ComponentArray = std::array<Component*, MAX_COMPONENTS>;
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \brief Main class for any object in game, stores associations, labeling and components
|
|
||||||
* \details The entity class is the primary class each object in the game needs to use. Add components to assign functionality.
|
|
||||||
*
|
|
||||||
* \todo More detailed description
|
|
||||||
* \todo Some functions in entity class are only supposed to be called in specific context, which might be valid uses for `friend` keyword. Example: Entity() should only be called from Manager::addEntity(). Verify each functions intended use/scope.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Entity
|
class Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/*!
|
/*! TODO */
|
||||||
* \brief Used for rendering order (last is highest) or retrieving entities of group
|
|
||||||
* \todo Label used in singular entity shouldn't use plural
|
|
||||||
* \todo HEARTS are rendered above POWERUPS, missleading order
|
|
||||||
* \todo PROJECTILE are rendered above POWERUPS, missleading order
|
|
||||||
* \todo Generalize HEARTS as UI or similar
|
|
||||||
*/
|
|
||||||
enum class GroupLabel
|
enum class GroupLabel
|
||||||
{
|
{
|
||||||
MAPTILES, //!< Entity using TileComponent
|
MAPTILES,
|
||||||
PLAYERS, //!< Primary entity in player controll
|
PLAYERS,
|
||||||
ENEMIES, //!< \deprecated All players now grouped as Entity::PLAYERS
|
ENEMIES,
|
||||||
COLLIDERS, //!< Fixed collider entity, e.g. a wall
|
COLLIDERS,
|
||||||
PROJECTILE, //!< \todo Document
|
PROJECTILE,
|
||||||
HEARTS, //!< \todo Document
|
HEARTS,
|
||||||
POWERUPS //!< \todo Document
|
POWERUPS
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Allows grouping entities by team association for hits, win conditions, etc.
|
|
||||||
*/
|
|
||||||
enum class TeamLabel
|
enum class TeamLabel
|
||||||
{
|
{
|
||||||
NONE, //!< No team, should be skipped in any checks
|
NONE, //!< No team
|
||||||
BLUE, //!< Team blue
|
BLUE, //!< Team blue
|
||||||
RED //!< Team red
|
RED //!< Team red
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
|
||||||
* \todo Document
|
|
||||||
*/
|
|
||||||
explicit Entity(Manager& mManager) :
|
explicit Entity(Manager& mManager) :
|
||||||
manager(mManager) { };
|
manager(mManager) { };
|
||||||
|
|
||||||
void update() const; //!< Call each frame to update all components
|
void update() const;
|
||||||
//! Call after update to render components.
|
|
||||||
//! \sa SpriteComponent::draw()
|
|
||||||
void draw() const;
|
void draw() const;
|
||||||
|
|
||||||
bool isActive() const { return this->active; } //!< \sa destroy()
|
bool isActive() const { return this->active; }
|
||||||
//! Mark for destruction for Manager::refresh() and disables collision
|
|
||||||
//! \sa ColliderComponent
|
|
||||||
void destroy() {
|
void destroy() {
|
||||||
this->active = false;
|
this->active = false;
|
||||||
if (this->hasComponent<ColliderComponent>()) {
|
if (this->hasComponent<ColliderComponent>()) {
|
||||||
@ -78,26 +53,21 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasGroup(Group mGroup); //!< \sa GroupLabel
|
bool hasGroup(Group mGroup);
|
||||||
void addGroup(Group mGroup); //!< \sa GroupLabel
|
void addGroup(Group mGroup);
|
||||||
void delGroup(Group mGroup); //!< \sa GroupLabel
|
void delGroup(Group mGroup);
|
||||||
//! \returns bitset with true on position GroupLabel if the entity belongs to group
|
|
||||||
//! \sa GroupLabel
|
|
||||||
std::bitset<MAX_GROUPS> getGroupBitSet();
|
std::bitset<MAX_GROUPS> getGroupBitSet();
|
||||||
|
|
||||||
void setTeam(TeamLabel teamLabel); //!< \sa TeamLabel
|
void setTeam(TeamLabel teamLabel);
|
||||||
TeamLabel getTeam(); //!< \sa TeamLabel
|
TeamLabel getTeam();
|
||||||
|
|
||||||
//! \sa Manager
|
|
||||||
Manager& getManager() { return manager; };
|
Manager& getManager() { return manager; };
|
||||||
|
|
||||||
template <typename T> bool hasComponent() const //! \sa Component
|
template <typename T> bool hasComponent() const
|
||||||
{
|
{
|
||||||
return componentBitSet[getComponentTypeID<T>()];
|
return componentBitSet[getComponentTypeID<T>()];
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \brief Adds specified type as component and calls Component::init()
|
|
||||||
//! \param mArgs Constructor arguments of component
|
|
||||||
template <typename T, typename...TArgs> T& addComponent(TArgs&&...mArgs)
|
template <typename T, typename...TArgs> T& addComponent(TArgs&&...mArgs)
|
||||||
{
|
{
|
||||||
T* c(new T(std::forward<TArgs>(mArgs)...));
|
T* c(new T(std::forward<TArgs>(mArgs)...));
|
||||||
@ -112,7 +82,7 @@ public:
|
|||||||
return *c;
|
return *c;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> T& getComponent() const //! \returns Component of type T
|
template <typename T> T& getComponent() const
|
||||||
{
|
{
|
||||||
auto ptr(componentArray[getComponentTypeID<T>()]);
|
auto ptr(componentArray[getComponentTypeID<T>()]);
|
||||||
return *static_cast<T*>(ptr);
|
return *static_cast<T*>(ptr);
|
||||||
|
|||||||
@ -7,33 +7,22 @@
|
|||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \brief Is responsible for managing all entities
|
|
||||||
* \details The manager class handles update and draw calls collectively for all entities, and provides functionality to get all or a subset of all entities
|
|
||||||
* \sa Entity
|
|
||||||
* \sa Entity::GroupLabel
|
|
||||||
* \sa Entity::TeamLabel
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Manager
|
class Manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void update(); //!< \sa Entity::update()
|
void update();
|
||||||
void draw(); //!< \sa Entity::draw()
|
void draw();
|
||||||
//! Disables all functionality of entities marked for destruction
|
|
||||||
//! \sa Entity::destroy()
|
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
void addToGroup(Entity* mEntity, Group mGroup); //!< \todo `friend` to Entity
|
void addToGroup(Entity* mEntity, Group mGroup);
|
||||||
std::vector<Entity*>& getGroup(Group mGroup); //!< \returns std::vector containing all entities in group Entity::GroupLabel
|
std::vector<Entity*>& getGroup(Group mGroup);
|
||||||
|
|
||||||
void addToTeam(Entity* mEntity, Team mTeam); //!< \todo `friend` to Entity
|
void addToTeam(Entity* mEntity, Team mTeam);
|
||||||
std::vector<Entity*>& getTeam(Team mTeam); //!< \returns std::vector containing all entities in team Entity::TeamLabel
|
std::vector<Entity*>& getTeam(Team mTeam);
|
||||||
|
|
||||||
std::vector<Entity*> getAll(); //!< \returns std::vector containing all entities
|
std::vector<Entity*> getAll();
|
||||||
|
|
||||||
Entity& addEntity(); //!< Creates and returns a new, empty entity
|
Entity& addEntity();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<Entity>> entities;
|
std::vector<std::unique_ptr<Entity>> entities;
|
||||||
|
|||||||
@ -23,7 +23,6 @@ public:
|
|||||||
TransformComponent(float x, float y, int w, int h, int scale);
|
TransformComponent(float x, float y, int w, int h, int scale);
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
/*! TODO: document usage of collision handler */
|
|
||||||
void update() override;
|
void update() override;
|
||||||
void modifySpeed(int8_t modifier);
|
void modifySpeed(int8_t modifier);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -115,17 +115,6 @@ std::vector<ColliderComponent*> CollisionHandler::getColliders(
|
|||||||
return colliders;
|
return colliders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \details Refer to getAnyIntersection() for more details
|
|
||||||
* \return A bitset of intersections, describing the directions of intersection. Position `Direction` in bitset true if edge in that direction collides
|
|
||||||
* \see Direction
|
|
||||||
* \see IntersectionBitSet
|
|
||||||
* \snippet CollisionHandler.h IntersectionBitSet
|
|
||||||
* \details Example usage for IntersectionBitSet (TransformComponent::update()):
|
|
||||||
* \snippet{trimleft} TransformComponent.cpp getAnyIntersection example code
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<>
|
template<>
|
||||||
IntersectionBitSet CollisionHandler::getAnyIntersection<IntersectionBitSet>(
|
IntersectionBitSet CollisionHandler::getAnyIntersection<IntersectionBitSet>(
|
||||||
Entity* entity,
|
Entity* entity,
|
||||||
@ -134,7 +123,6 @@ IntersectionBitSet CollisionHandler::getAnyIntersection<IntersectionBitSet>(
|
|||||||
std::initializer_list<Entity::TeamLabel> const& teamLabels,
|
std::initializer_list<Entity::TeamLabel> const& teamLabels,
|
||||||
bool negateTeam)
|
bool negateTeam)
|
||||||
{
|
{
|
||||||
if (!entity->hasComponent<ColliderComponent>()) return std::bitset<DIRECTION_C>();
|
|
||||||
IntersectionBitSet intersections;
|
IntersectionBitSet intersections;
|
||||||
for (auto& collider : getColliders(groupLabels, teamLabels)) {
|
for (auto& collider : getColliders(groupLabels, teamLabels)) {
|
||||||
intersections |= getIntersection(entity, collider->entity, posMod);
|
intersections |= getIntersection(entity, collider->entity, posMod);
|
||||||
@ -142,13 +130,6 @@ IntersectionBitSet CollisionHandler::getAnyIntersection<IntersectionBitSet>(
|
|||||||
return intersections;
|
return intersections;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \details Refer to getAnyIntersection() for more details
|
|
||||||
* \return The first entity with collision found
|
|
||||||
* \see Entity
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<>
|
template<>
|
||||||
Entity* CollisionHandler::getAnyIntersection<Entity*>(
|
Entity* CollisionHandler::getAnyIntersection<Entity*>(
|
||||||
Entity* entity,
|
Entity* entity,
|
||||||
@ -157,7 +138,6 @@ Entity* CollisionHandler::getAnyIntersection<Entity*>(
|
|||||||
std::initializer_list<Entity::TeamLabel> const& teamLabels,
|
std::initializer_list<Entity::TeamLabel> const& teamLabels,
|
||||||
bool negateTeam)
|
bool negateTeam)
|
||||||
{
|
{
|
||||||
if (!entity->hasComponent<ColliderComponent>()) return nullptr;
|
|
||||||
for (auto& collider : getColliders(groupLabels, teamLabels)) {
|
for (auto& collider : getColliders(groupLabels, teamLabels)) {
|
||||||
SDL_Rect rect = entity->getComponent<ColliderComponent>().collider + posMod;
|
SDL_Rect rect = entity->getComponent<ColliderComponent>().collider + posMod;
|
||||||
if (SDL_HasIntersection(&rect, &collider->collider)) {
|
if (SDL_HasIntersection(&rect, &collider->collider)) {
|
||||||
@ -166,27 +146,3 @@ Entity* CollisionHandler::getAnyIntersection<Entity*>(
|
|||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
|
||||||
*
|
|
||||||
* \details Refer to getAnyIntersection() for more details
|
|
||||||
* \return True if any collision was found, otherwise false
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
template<>
|
|
||||||
bool CollisionHandler::getAnyIntersection<bool>(
|
|
||||||
Entity* entity,
|
|
||||||
Vector2D posMod,
|
|
||||||
std::initializer_list<Entity::GroupLabel> const& groupLabels,
|
|
||||||
std::initializer_list<Entity::TeamLabel> const& teamLabels,
|
|
||||||
bool negateTeam)
|
|
||||||
{
|
|
||||||
if (!entity->hasComponent<ColliderComponent>()) return false;
|
|
||||||
for (auto& collider : getColliders(groupLabels, teamLabels)) {
|
|
||||||
SDL_Rect rect = entity->getComponent<ColliderComponent>().collider + posMod;
|
|
||||||
if (SDL_HasIntersection(&rect, &collider->collider)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
@ -63,8 +63,6 @@ void TransformComponent::update()
|
|||||||
// TODO: move to separate functions
|
// TODO: move to separate functions
|
||||||
|
|
||||||
if (this->entity->hasGroup((size_t)Entity::GroupLabel::PLAYERS)) {
|
if (this->entity->hasGroup((size_t)Entity::GroupLabel::PLAYERS)) {
|
||||||
|
|
||||||
// [getAnyIntersection example code]
|
|
||||||
IntersectionBitSet intersections =
|
IntersectionBitSet intersections =
|
||||||
(CollisionHandler::getIntersectionWithBounds(entity, Vector2D(positionChange.x, 0)) |
|
(CollisionHandler::getIntersectionWithBounds(entity, Vector2D(positionChange.x, 0)) |
|
||||||
(Game::collisionHandler->getAnyIntersection<IntersectionBitSet>(entity, Vector2D(positionChange.x, 0), { Entity::GroupLabel::MAPTILES, Entity::GroupLabel::COLLIDERS })) &
|
(Game::collisionHandler->getAnyIntersection<IntersectionBitSet>(entity, Vector2D(positionChange.x, 0), { Entity::GroupLabel::MAPTILES, Entity::GroupLabel::COLLIDERS })) &
|
||||||
@ -78,7 +76,6 @@ void TransformComponent::update()
|
|||||||
|
|
||||||
if (intersections.test((size_t)Direction::UP) || intersections.test((size_t)Direction::DOWN))
|
if (intersections.test((size_t)Direction::UP) || intersections.test((size_t)Direction::DOWN))
|
||||||
positionChange.y = 0;
|
positionChange.y = 0;
|
||||||
// [getAnyIntersection example code]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
position += positionChange;
|
position += positionChange;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user