Skip to content

Commit b7a76b0

Browse files
authored
Merge pull request #66 from CapsCollective/feature/resource-packing
Added resource module with packer target, implemented resource packing across examples
2 parents ad7b72d + af70936 commit b7a76b0

File tree

90 files changed

+1970
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1970
-751
lines changed

.github/workflows/formatting.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ jobs:
1111
formatting:
1212
runs-on: macos-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
16-
# Install dependencies
14+
- name: perform checkout
15+
uses: actions/checkout@v4
1716

1817
- name: install latest clang-format
1918
run: brew install clang-format
2019

21-
# Run formatting checks
22-
2320
- name: make format-check
2421
run: make format-check

.github/workflows/macOS.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,29 @@ jobs:
1414
runs-on: macos-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- name: perform checkout
18+
uses: actions/checkout@v4
1819

19-
- name: perform setup
20-
run: ./scripts/setup.sh
20+
- name: install Python dependencies
21+
run: brew install python-setuptools
2122

22-
- name: build all targets
23-
run: make
23+
- name: perform setup
24+
run: ./scripts/setup.sh
25+
26+
- name: build all targets
27+
run: make
28+
29+
- name: run tests
30+
run: |
31+
cd ./bin/tests/build
32+
./app
33+
34+
- name: compress output
35+
shell: bash
36+
run: tar -cvf ./macos.tar -C ./output .
37+
38+
- name: upload artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: macos_output
42+
path: ./macos.tar

.github/workflows/tests.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/ubuntu.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,35 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- name: perform checkout
18+
uses: actions/checkout@v4
1819

19-
- name: update apt
20-
run: sudo apt-get update
20+
- name: update apt
21+
run: sudo apt-get update
2122

22-
- name: install vulkan dependencies
23-
run: sudo apt install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev
23+
- name: install vulkan dependencies
24+
run: sudo apt install git build-essential libx11-xcb-dev libxkbcommon-dev libwayland-dev libxrandr-dev
2425

25-
- name: install glfw dependencies
26-
run: sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
26+
- name: install glfw dependencies
27+
run: sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
2728

28-
- name: perform setup
29-
run: ./scripts/setup.sh
29+
- name: perform setup
30+
run: ./scripts/setup.sh
3031

31-
- name: build all targets
32-
run: make
32+
- name: build all targets
33+
run: make
34+
35+
- name: run tests
36+
run: |
37+
cd ./bin/tests/build
38+
./app
39+
40+
- name: compress output
41+
shell: bash
42+
run: tar -cvf ./linux.tar -C ./output .
43+
44+
- name: upload artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: linux_output
48+
path: ./linux.tar

.github/workflows/windows.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ jobs:
1717
shell: pwsh
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- name: perform checkout
21+
uses: actions/checkout@v4
2122

22-
- name: perform setup
23-
run: ./scripts/setup.ps1
24-
25-
- name: build all targets
26-
run: mingw32-make
23+
- name: perform setup
24+
run: ./scripts/setup.ps1
25+
26+
- name: build all targets
27+
run: mingw32-make
28+
29+
- name: run tests
30+
run: |
31+
cd ./bin/tests/build
32+
./app.exe
33+
34+
- name: compress output
35+
run: Compress-Archive -Path ./output/* -DestinationPath ./windows.zip
36+
37+
- name: upload artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: windows_output
41+
path: ./windows.zip

Makefile

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ export scriptsDir := $(abspath scripts)
3737
export outputDir := $(abspath output)
3838
export engineDir := $(abspath engine)
3939
export testsDir := $(abspath tests)
40+
export packerDir := $(abspath packer)
4041
export examplesDir := $(abspath examples)
4142

4243
# Set top level targets
4344
export utilsLib := $(libDir)/libutils.a
45+
export resourcesLib := $(libDir)/libresources.a
4446
export windowLib := $(libDir)/libwindow.a
4547
export coreLib := $(libDir)/libcore.a
4648
export renderLib := $(libDir)/librender.a
4749
export testApp := $(binDir)/tests/build/app
50+
export packerApp := $(binDir)/packer/build/app
4851
export exampleGameApp := $(binDir)/examples/game/build/app
4952
export exampleRenderApp := $(binDir)/examples/render/build/app
5053
export exampleTilemapApp := $(binDir)/examples/tilemap/build/app
@@ -54,13 +57,16 @@ export compileFlags := -Wall -std=c++17
5457
export linkFlags += -L $(libDir)
5558
buildFlagsFile:=.buildflags
5659

57-
.PHONY: all testapp gameapp renderapp tilemapapp package-gameapp package-renderapp package-tilemapapp buildFlags clean format
60+
.PHONY: all packerapp testapp gameapp renderapp tilemapapp package-gameapp package-renderapp package-tilemapapp buildFlags clean format
5861

59-
all: testapp package-gameapp package-renderapp package-tilemapapp
62+
all: packerapp testapp package-gameapp package-renderapp package-tilemapapp
6063

6164
$(utilsLib): buildFlags
6265
"$(MAKE)" -C $(engineDir)/utils CXXFLAGS="$(CXXFLAGS)"
6366

67+
$(resourcesLib): buildFlags $(utilsLib)
68+
"$(MAKE)" -C $(engineDir)/resources CXXFLAGS="$(CXXFLAGS)"
69+
6470
$(windowLib): buildFlags $(utilsLib)
6571
"$(MAKE)" -C $(engineDir)/window CXXFLAGS="$(CXXFLAGS)"
6672

@@ -70,20 +76,25 @@ $(coreLib): buildFlags $(utilsLib)
7076
$(renderLib): buildFlags $(utilsLib) $(windowLib)
7177
"$(MAKE)" -C $(engineDir)/render CXXFLAGS="$(CXXFLAGS)"
7278

73-
$(testApp): buildFlags $(utilsLib) $(coreLib)
79+
$(packerApp): buildFlags $(utilsLib) $(resourcesLib)
80+
"$(MAKE)" -C $(packerDir) CXXFLAGS="$(CXXFLAGS)"
81+
82+
$(testApp): buildFlags $(utilsLib) $(coreLib) $(packerApp)
7483
"$(MAKE)" -C $(testsDir) CXXFLAGS="$(CXXFLAGS)"
7584

76-
$(exampleGameApp): buildFlags $(renderLib) $(coreLib)
85+
$(exampleGameApp): buildFlags $(renderLib) $(coreLib) $(packerApp)
7786
"$(MAKE)" -C $(examplesDir)/game CXXFLAGS="$(CXXFLAGS)"
7887

79-
$(exampleRenderApp): buildFlags $(renderLib)
88+
$(exampleRenderApp): buildFlags $(renderLib) $(packerApp)
8089
"$(MAKE)" -C $(examplesDir)/render CXXFLAGS="$(CXXFLAGS)"
8190

82-
$(exampleTilemapApp): buildFlags $(renderLib)
91+
$(exampleTilemapApp): buildFlags $(renderLib) $(packerApp)
8392
"$(MAKE)" -C $(examplesDir)/tilemap CXXFLAGS="$(CXXFLAGS)"
8493

8594
testapp: $(testApp)
8695

96+
packerapp: $(packerApp)
97+
8798
gameapp: $(exampleGameApp)
8899

89100
renderapp: $(exampleRenderApp)
@@ -105,15 +116,15 @@ buildFlags:
105116

106117
# Run cleanup across project
107118
clean:
108-
$(RM) $(call platformpth, $(libDir))
109-
$(RM) $(call platformpth, $(binDir))
110-
$(RM) $(call platformpth, $(outputDir))
111-
$(RM) $(call platformpth, $(buildFlagsFile))
119+
$(RM) $(call platformpth,$(libDir))
120+
$(RM) $(call platformpth,$(binDir))
121+
$(RM) $(call platformpth,$(outputDir))
122+
$(RM) $(call platformpth,$(buildFlagsFile))
112123

113124
# Check file formatting program across all source files
114125
format-check:
115-
$(formatScript) "$(engineDir) $(examplesDir) $(testsDir)" --check
126+
$(formatScript) "$(engineDir) $(examplesDir) $(testsDir) $(packerDir)" --check
116127

117128
# Run file formatting program across all source files
118129
format:
119-
$(formatScript) "$(engineDir) $(examplesDir) $(testsDir)"
130+
$(formatScript) "$(engineDir) $(examplesDir) $(testsDir) $(packerDir)"

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ The ultimate purpose of this project is to act as the metaphorical siege engine
4343

4444
The following are dependencies for building and running the project:
4545

46-
- **All platforms**
47-
- [CMake](https://cmake.org/)
4846
- **macOS**
47+
- [CMake](https://cmake.org/)
4948
- [GNU Make](https://www.gnu.org/software/make/)
5049
- [Clang Format](https://clang.llvm.org/docs/ClangFormat.html)
5150
- [Xcode Command Line Tools](https://developer.apple.com/download/) (via `xcode-select --install`)
5251
- **Windows**
53-
- [MinGW32 Make](https://www.mingw-w64.org/)
54-
- [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/)
52+
- [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/)
53+
- [MSYS2](https://www.msys2.org/) with the following UCRT packages installed:
54+
- `mingw-w64-ucrt-x86_64-gcc`
55+
- `mingw-w64-ucrt-x86_64-make`
56+
- `mingw-w64-ucrt-x86_64-python`
57+
- `mingw-w64-ucrt-x86_64-cmake`
5558
- **Linux**
59+
- [CMake](https://cmake.org/)
5660
- [Clang Format](https://clang.llvm.org/docs/ClangFormat.html)
5761
- The following packages are required for building the dependencies:
5862
- `git`
@@ -162,6 +166,7 @@ You can see examples of this in any of the application targets under `examples`.
162166
│ ├─[render] <- an example app demonstrating the renderer
163167
164168
├─[make] <- additional Make file utilities for the build system
169+
├─[packer] <- an asset packing app for bundling game assets in a pack file on build
165170
├─[scripts] <- additional scripts for the build system and user convenience
166171
├─[tests] <- a unit test app covering all of the engine's libraries
167172
├─[vendor] <- all third-party libraries used by the project

engine/core/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ endif
2424

2525
# Build the static library
2626
$(coreLib): $(coreObjects)
27-
$(MKDIR) $(call platformpth, $(libDir))
27+
$(call MKDIR,$(call platformpth,$(libDir)))
2828
ar -crs $(coreLib) $(coreObjects)
2929

3030
# Add all rules from dependency files
3131
-include $(coreDepends)
3232

3333
# Compile object files to the bin directory
3434
$(coreBinDir)/%.o: $(coreSrcDir)/%.cpp
35-
$(MKDIR) $(call platformpth, $(@D))
35+
$(call MKDIR,$(call platformpth,$(@D)))
3636
$(CXX) -MMD -MP -c $(compileFlags) -I $(engineDir) $< -o $@ $(CXXFLAGS)

engine/core/ResourceSystem.cpp

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)