Files
dusk/test/rpg/entity/entitytestfixture.c
T
YourWishes 1bd73d69fe Clamp keyframe interpolation to last value, add main menu scene/UI, battle HUD, and expanded test coverage
- 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
2026-08-06 12:58:07 -05:00

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;
}