refactor(core/rendering): netejar ctors de Sprite/MovingSprite (INC-06 + INC-07)
- MovingSprite: el ctor delegat Sprite(surface, pos) ja assigna pos_;
el Sprite::pos_ = pos; manual que seguia era redundant (INC-06).
- Sprite(surface) usava initializer posicional {0.0F, 0.0F, ...} mentre
la resta del projecte usa designated initializers ({.x = ..., .y = ...}).
Unificat (INC-07).
INC-05 (el static_cast<int> de pos_.x a MovingSprite::move i setters)
es marca WONTFIX al document: és snap intencional a píxel per al
pixel-art, divergent només al setter per SDL_FRect que es reserva per
a posicionament directe sense arrodoniment.
Build + smoke 5s xvfb OK (exit 124).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8b413affa8
commit
da66a7c03f
3 files changed
+10
-7
No files matched your search
@@ -18,7 +18,7 @@ Sprite::Sprite(std::shared_ptr<Surface> surface, SDL_FRect rect)
|
||||
|
||||
Sprite::Sprite(std::shared_ptr<Surface> surface)
|
||||
: surface_(std::move(surface)),
|
||||
pos_{0.0F, 0.0F, static_cast<float>(surface_->getWidth()), static_cast<float>(surface_->getHeight())},
|
||||
pos_{.x = 0.0F, .y = 0.0F, .w = static_cast<float>(surface_->getWidth()), .h = static_cast<float>(surface_->getHeight())},
|
||||
clip_(pos_) {}
|
||||
|
||||
void Sprite::render() {
|
||||
|
||||
Reference in new issue
Block a user