1bd73d69fe
- keyframeGetValue now returns the last keyframe's value for times at or beyond it, fixes a missing util/math.h include, and asserts keyframes are sorted by time; adds test/animation/test_keyframe.c - Adds mainmenu scene/UI and a battle HUD UI frame - Adds save autosave-related fields and battle scene tweaks - Adds headless test coverage for cutscenes, entities, and map areas
31 lines
772 B
C
31 lines
772 B
C
/**
|
|
* Copyright (c) 2026 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "entitytestfixture.h"
|
|
#include "rpg/overworld/map.h"
|
|
#include "rpg/overworld/tile.h"
|
|
#include "util/memory.h"
|
|
|
|
void entityTestFixtureReset(void) {
|
|
memoryZero(ENTITIES, sizeof(ENTITIES));
|
|
|
|
memoryZero(&MAP, sizeof(map_t));
|
|
MAP.loaded = true;
|
|
MAP.chunkPosition = (chunkpos_t){ 0, 0, 0 };
|
|
|
|
chunk_t *chunk = &MAP.chunks[0];
|
|
chunk->position = (chunkpos_t){ 0, 0, 0 };
|
|
for(uint32_t i = 0; i < CHUNK_TILE_COUNT; i++) {
|
|
chunk->tiles[i] = (tile_t){ .shape = TILE_SHAPE_GROUND, .z = 0 };
|
|
}
|
|
for(uint8_t i = 0; i < CHUNK_ENTITY_COUNT_MAX; i++) {
|
|
chunk->entities[i] = 0xFF;
|
|
}
|
|
|
|
MAP.chunkOrder[0] = chunk;
|
|
}
|