Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 592e538

Browse files
committed
update
1 parent 7e452e5 commit 592e538

File tree

13 files changed

+62
-96
lines changed

13 files changed

+62
-96
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
cmake --version
2424
git --version
2525
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
submodules: recursive
2929

@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
mkdir build
3434
cd build
35-
cmake -A${{ matrix.build-arch }} ${{ matrix.build-tool }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config }} ..
35+
cmake -A${{ matrix.build-arch }} ${{ matrix.build-tool }} -DCMAKE_BUILD_TYPE=${{ matrix.build-config }} -Dcage_use_steam_sockets=OFF ..
3636
3737
- name: Build
3838
shell: bash
@@ -55,30 +55,25 @@ jobs:
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
os-version: [22]
59-
build-config: [debug, release, relwithdebinfo]
58+
os-version: [24]
59+
build-config: [debug, release]
6060
compiler:
61-
- {
62-
cc: gcc-12,
63-
cxx: g++-12,
64-
install: gcc-12 g++-12
65-
}
6661
- {
6762
cc: gcc-13,
6863
cxx: g++-13,
6964
install: gcc-13 g++-13
7065
}
7166
- {
72-
cc: clang-15,
73-
cxx: clang++-15,
74-
install: clang-15
67+
cc: clang-18,
68+
cxx: clang++-18,
69+
install: clang-18
7570
}
7671

7772
steps:
7873
- name: Install packages
7974
run: |
8075
sudo apt-get update
81-
sudo apt-get install -y xorg-dev nasm ${{ matrix.compiler.install }}
76+
sudo apt-get install -y xorg-dev libwayland-dev libxkbcommon-dev libpulse-dev libasound2-dev nasm libssl-dev ${{ matrix.compiler.install }}
8277
8378
- name: Versions
8479
run: |
@@ -87,20 +82,20 @@ jobs:
8782
${{ matrix.compiler.cc }} --version
8883
${{ matrix.compiler.cxx }} --version
8984
90-
- uses: actions/checkout@v3
85+
- uses: actions/checkout@v4
9186
with:
9287
submodules: recursive
9388

9489
- name: Configure
9590
run: |
9691
mkdir build
9792
cd build
98-
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-config }} ..
93+
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-config }} -Dcage_use_steam_sockets=0 ..
9994
10095
- name: Build
10196
run: |
10297
cd build
103-
cmake --build . --config ${{ matrix.build-config }} -- -j3
98+
cmake --build . -- -j$(( `nproc` + 1 ))
10499
105100
- name: Assets
106101
run: |

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ target_link_libraries(mazetd cage-simple)
1414
cage_ide_category(mazetd mazetd)
1515
cage_ide_sort_files(mazetd)
1616
cage_ide_working_dir_in_place(mazetd)
17+
cage_ide_startup_project(mazetd)

externals/cage

Submodule cage updated 319 files

sources/game.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#ifndef mazetd_header_game
22
#define mazetd_header_game
33

4-
#include "common.h"
5-
64
#include <cage-core/entities.h>
75
#include <cage-core/enumBits.h>
86

7+
#include "common.h"
8+
99
namespace cage
1010
{
1111
class SpatialQuery;
@@ -277,7 +277,6 @@ namespace mazetd
277277
extern uint32 playerCursorTile;
278278
extern sint32 playerHealth;
279279
extern sint32 playerMoney;
280-
extern bool playerPanning;
281280
extern Entity *playerBuildingSelection;
282281

283282
extern SpawningGroup spawningGroup;

sources/game/game.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ namespace mazetd
121121
uint32 playerCursorTile;
122122
sint32 playerHealth;
123123
sint32 playerMoney;
124-
bool playerPanning = false;
125124
Entity *playerBuildingSelection;
126125
bool playerWon = false;
127126
}

sources/game/spatial.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace mazetd
2727
monstersData->clear();
2828
CAGE_ASSERT(globalGrid);
2929

30-
entitiesVisitor([&](Entity *e, const MovementComponent &mv, const MonsterComponent &) { monstersData->update(e->name(), mv.position() * Vec3(1, 0, 1)); }, gameEntities(), false);
30+
entitiesVisitor([&](Entity *e, const MovementComponent &mv, const MonsterComponent &) { monstersData->update(e->id(), mv.position() * Vec3(1, 0, 1)); }, gameEntities(), false);
3131

3232
monstersData->rebuild();
3333
},
@@ -51,9 +51,9 @@ namespace mazetd
5151
structsData->clear();
5252
CAGE_ASSERT(globalGrid);
5353

54-
entitiesVisitor([&](Entity *e, const PositionComponent &pos, const BuildingComponent &) { structsData->update(e->name(), globalGrid->center(pos.tile) * Vec3(1, 0, 1)); }, gameEntities(), false);
54+
entitiesVisitor([&](Entity *e, const PositionComponent &pos, const BuildingComponent &) { structsData->update(e->id(), globalGrid->center(pos.tile) * Vec3(1, 0, 1)); }, gameEntities(), false);
5555

56-
entitiesVisitor([&](Entity *e, const PositionComponent &pos, const TrapComponent &) { structsData->update(e->name(), globalGrid->center(pos.tile) * Vec3(1, 0, 1)); }, gameEntities(), false);
56+
entitiesVisitor([&](Entity *e, const PositionComponent &pos, const TrapComponent &) { structsData->update(e->id(), globalGrid->center(pos.tile) * Vec3(1, 0, 1)); }, gameEntities(), false);
5757

5858
structsData->rebuild();
5959
}

sources/grid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef mazetd_header_grid
22
#define mazetd_header_grid
33

4-
#include "common.h"
5-
64
#include <cage-core/enumBits.h>
75

6+
#include "common.h"
7+
88
namespace cage
99
{
1010
class Collider;

sources/main.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <cage-core/assetManager.h>
1+
#include <cage-core/assetsManager.h>
22
#include <cage-core/hashString.h>
33
#include <cage-core/logger.h>
44
#include <cage-engine/highPerformanceGpuHint.h>
@@ -11,28 +11,24 @@ using namespace cage;
1111

1212
int main(int argc, const char *args[])
1313
{
14-
Holder<Logger> log = newLogger();
15-
log->format.bind<logFormatConsole>();
16-
log->output.bind<logOutputStdOut>();
17-
1814
try
1915
{
16+
initializeConsoleLogger();
2017
engineInitialize(EngineCreateConfig());
2118
controlThread().updatePeriod(1000000 / 30);
2219

2320
const auto closeListener = engineWindow()->events.listen(inputFilter([](input::WindowClose) { engineStop(); }));
2421
engineWindow()->title("MazeTD");
25-
engineAssets()->add(HashString("mazetd/mazetd.pack"));
22+
engineAssets()->load(HashString("mazetd/mazetd.pack"));
2623

2724
{
2825
Holder<FullscreenSwitcher> fullscreen = newFullscreenSwitcher({});
2926
Holder<StatisticsGui> engineStatistics = newStatisticsGui();
3027
engineStatistics->statisticsScope = StatisticsGuiScopeEnum::None;
31-
3228
engineRun();
3329
}
3430

35-
engineAssets()->remove(HashString("mazetd/mazetd.pack"));
31+
engineAssets()->unload(HashString("mazetd/mazetd.pack"));
3632
engineFinalize();
3733
return 0;
3834
}

sources/map/render.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include <vector>
22

3-
#include "generate.h"
4-
5-
#include <cage-core/assetManager.h>
3+
#include <cage-core/assetsManager.h>
64
#include <cage-core/entities.h>
75
#include <cage-core/meshImport.h>
86
#include <cage-core/profiling.h>
@@ -14,6 +12,8 @@
1412
#include <cage-engine/texture.h>
1513
#include <cage-simple/engine.h>
1614

15+
#include "generate.h"
16+
1717
namespace mazetd
1818
{
1919
ConcurrentQueue<ChunkUpload> chunksUploadQueue;
@@ -29,11 +29,11 @@ namespace mazetd
2929
void remove()
3030
{
3131
if (model)
32-
engineAssets()->remove(model);
32+
engineAssets()->unload(model);
3333
if (albedo)
34-
engineAssets()->remove(albedo);
34+
engineAssets()->unload(albedo);
3535
if (material)
36-
engineAssets()->remove(material);
36+
engineAssets()->unload(material);
3737
model = albedo = material = 0;
3838
}
3939
};
@@ -65,8 +65,8 @@ namespace mazetd
6565
tex->filters(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, 100);
6666
tex->wraps(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
6767
tex->generateMipmaps();
68-
re.albedo = engineAssets()->generateUniqueName();
69-
engineAssets()->fabricate<AssetSchemeIndexTexture, Texture>(re.albedo, std::move(tex), "chunkAlbedo");
68+
re.albedo = engineAssets()->generateUniqueId();
69+
engineAssets()->loadValue<AssetSchemeIndexTexture, Texture>(re.albedo, std::move(tex), "chunkAlbedo");
7070
}
7171

7272
{
@@ -76,8 +76,8 @@ namespace mazetd
7676
tex->filters(GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, 100);
7777
tex->wraps(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
7878
tex->generateMipmaps();
79-
re.material = engineAssets()->generateUniqueName();
80-
engineAssets()->fabricate<AssetSchemeIndexTexture, Texture>(re.material, std::move(tex), "chunkMaterial");
79+
re.material = engineAssets()->generateUniqueId();
80+
engineAssets()->loadValue<AssetSchemeIndexTexture, Texture>(re.material, std::move(tex), "chunkMaterial");
8181
}
8282

8383
{
@@ -88,8 +88,8 @@ namespace mazetd
8888
model->textureNames[0] = re.albedo;
8989
model->textureNames[1] = re.material;
9090
model->layer = -100;
91-
re.model = engineAssets()->generateUniqueName();
92-
engineAssets()->fabricate<AssetSchemeIndexModel, Model>(re.model, std::move(model), "chunkModel");
91+
re.model = engineAssets()->generateUniqueId();
92+
engineAssets()->loadValue<AssetSchemeIndexModel, Model>(re.model, std::move(model), "chunkModel");
9393
}
9494

9595
chunksRenderQueue.push(std::move(re));

sources/player/buildingsMods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace mazetd
3232
void findNeighbors(Entity *me)
3333
{
3434
neighbors.clear();
35-
const uint32 myName = me->name();
35+
const uint32 myName = me->id();
3636
const Vec3 myPos = globalGrid->center(me->value<PositionComponent>(compPosition).tile) * Vec3(1, 0, 1);
3737
buildingsQuery->intersection(Sphere(myPos, 5));
3838
for (uint32 nn : buildingsQuery->result())

0 commit comments

Comments
 (0)