This commit is contained in:
2025-11-25 23:21:01 +01:00
parent 0864db1464
commit a7d03deba6
2 changed files with 3 additions and 8 deletions

View File

@@ -780,11 +780,7 @@ void updatePolycubeDisplay(Arena *arena, Soma *soma) {
void createSolutionEntities(Arena *arena, Soma *soma) { void createSolutionEntities(Arena *arena, Soma *soma) {
if (soma->solutions.length > 0) { if (soma->solutions.length > 0) {
if (soma->solutionEntities.capacity === 0) { soma->solutionEntities = PushList(arena, HandleList, soma->solutions.length);
soma->solutionEntities = PushList(arena, HandleList, soma->solutions.length);
} else {
ZeroList(&soma->solutionEntities);
}
for (EachEl(soma->solutions, SomaSolution, solution)) { for (EachEl(soma->solutions, SomaSolution, solution)) {
uint32 solutionGraphNodeHandle = createSceneGraphNode(soma->scene); uint32 solutionGraphNodeHandle = createSceneGraphNode(soma->scene);
AppendList(&soma->solutionEntities, solutionGraphNodeHandle); AppendList(&soma->solutionEntities, solutionGraphNodeHandle);
@@ -839,7 +835,6 @@ int mainGfx() {
.renderer = &renderer, .renderer = &renderer,
.polycubeInput = PushListZero(arena, PolycubeInputList, 64), .polycubeInput = PushListZero(arena, PolycubeInputList, 64),
.polycubes = PushListZero(arena, HandleList, 64), .polycubes = PushListZero(arena, HandleList, 64),
.solutionEntities = EmptyList(),
.puzzleDims = {3, 3, 3}, .puzzleDims = {3, 3, 3},
.solveTaskCtx = (SolveTaskCtx){ .solveTaskCtx = (SolveTaskCtx){
.arena = arenaAlloc(Megabytes(128)), .arena = arenaAlloc(Megabytes(128)),

View File

@@ -56,8 +56,8 @@ void recalcGraphNode(SceneGraphNode *n) {
Scene createScene(Arena *arena) { Scene createScene(Arena *arena) {
Scene result = { Scene result = {
.arena = arena, .arena = arena,
.entities = PushList(arena, EntityList, 4096), .entities = PushList(arena, EntityList, 100000),
.graphNodes = PushList(arena, SceneGraphNodeList, 8192), .graphNodes = PushList(arena, SceneGraphNodeList, 100000),
}; };
result.sceneRoot = createSceneGraphNode(&result); result.sceneRoot = createSceneGraphNode(&result);
return result; return result;