Skip to content

Commit

Permalink
Use named anchorOffset constant for more readable code
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Jan 2, 2025
1 parent eef3d1b commit f7f4bb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/Resource/Sprite.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ class Sprite : public ::testing::Test {

static constexpr NAS2D::Vector imageSize{1, 1};
static constexpr NAS2D::Rectangle imageRect{{0, 0}, imageSize};
static constexpr NAS2D::Vector anchorOffset{0, 0};
uint32_t imageBuffer[imageSize.x * imageSize.y];
NAS2D::Image image{&imageBuffer, 4, imageSize};
NAS2D::AnimationSet::Frame frame{image, imageRect, {0, 0}, 2};
NAS2D::AnimationSet::Frame frameStop{image, imageRect, {0, 0}, 0};
NAS2D::AnimationSet::Frame frame{image, imageRect, anchorOffset, 2};
NAS2D::AnimationSet::Frame frameStop{image, imageRect, anchorOffset, 0};
NAS2D::AnimationSet testAnimationSet{{}, {{"defaultAction", {frame}}, {"frameStopAction", {frameStop}}}};
SpriteDerived sprite{testAnimationSet, "defaultAction"};
};
Expand Down

0 comments on commit f7f4bb2

Please sign in to comment.