Enhance animation and control tests; improve rendering and shape loading validation
- Added tests for player animations in animation_archive_tests to ensure all animations are loaded correctly. - Updated entity_dispatch_entry_tests to validate animation direction updates and added tests for sixteen-direction animations. - Expanded isometric_controls_tests with comprehensive key event handling and action requests for various controller states. - Improved map_renderer_tests by adding viewport rendering tests to compare unbounded and bounded views. - Enhanced shape_archive_tests to validate shape frame loading and decoding consistency.
This commit is contained in:
parent
e00f9f3186
commit
a76b071049
28 changed files with 1608 additions and 154 deletions
|
|
@ -114,6 +114,22 @@ int main()
|
|||
});
|
||||
};
|
||||
assert(liveBefore && samePixels(liveBefore->pixels, startingScene->pixels));
|
||||
remorse::MapRenderOptions viewportOptions;
|
||||
viewportOptions.mapIndex = 1;
|
||||
viewportOptions.maxWidth = 2560;
|
||||
viewportOptions.maxHeight = 1440;
|
||||
viewportOptions.includeRoofs = true;
|
||||
viewportOptions.viewCenter = spawn;
|
||||
const auto unboundedViewport = cachedRenderer->render(viewportOptions, &liveSceneItems);
|
||||
const remorse::s32 viewportRadius = 2560 + 1440 * 2 + 512;
|
||||
viewportOptions.worldRect = remorse::WorldRect{
|
||||
spawn.x - viewportRadius, spawn.y - viewportRadius,
|
||||
spawn.x + viewportRadius, spawn.y + viewportRadius};
|
||||
const auto boundedViewport = cachedRenderer->render(viewportOptions, &liveSceneItems);
|
||||
assert(unboundedViewport && boundedViewport);
|
||||
assert(samePixels(unboundedViewport->pixels, boundedViewport->pixels));
|
||||
assert(unboundedViewport->coverage == boundedViewport->coverage);
|
||||
assert(boundedViewport->renderItemCount < unboundedViewport->renderItemCount);
|
||||
const auto playerFrame = remorse::decodeShapeFrame(cachedRenderer->shapes, 1, 0);
|
||||
assert(playerFrame);
|
||||
const remorse::MapRenderSprite playerSprite{spawn, 1, 0, false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue