diff --git a/docs/audit-core-rendering.md b/docs/audit-core-rendering.md index 7c0b653..f523660 100644 --- a/docs/audit-core-rendering.md +++ b/docs/audit-core-rendering.md @@ -60,7 +60,7 @@ Los IDs se mantienen estables una vez asignados. Cada entrada apunta al(los) fic | PATCH-01 | `screen.cpp:71-92,210-214`, `sdl3gpu_shader.cpp:445-493` | workarounds Wayland/Vulkan | Importante | WONTFIX (de momento) | RAII para forzar orden — deferred | | PATCH-02 | `render_info.cpp:85-88` | guard bug-fix animation | Menor | PENDING | refactor FSM animación | | PATCH-03 | `notifier.cpp:78-85` | TODO implícito de cola FIFO | Menor | WONTFIX | documentar decisión | -| PATCH-04 | `sprite.cpp:47-49` | `Sprite::update` vacío hook no invocado | Menor | PENDING | borrar (ver DEAD-10) | +| PATCH-04 | `sprite.cpp:47-49` | `Sprite::update` vacío hook no invocado | Menor | DONE | resolt amb DEAD-10 | | PATCH-05 | `gif.cpp:12-15` | comentario "reemplaçar macro READ" | Menor | PENDING | limpiar comentario | | PATCH-06 | `gif.cpp:83-86` | guard self-reference defensivo | Menor | WONTFIX | dejar, cambiar `cerr` → logger futuro | | PATCH-07 | `sdl3gpu_shader.cpp:17,162` + `crtpi_pipeline.cpp:16,162` | `NOLINTBEGIN` gigantes sobre MSL | Importante | DONE | eliminats amb CONV-03 | @@ -96,14 +96,14 @@ Los IDs se mantienen estables una vez asignados. Cada entrada apunta al(los) fic |----|---------------|----------|-----------|--------|-------| | DEAD-01 | `text.hpp:50-51` | `writeShadowed`, `writeCentered` sin callers externos | Importante | DONE | esborrats | | DEAD-02 | `text.hpp:62-63,67` | `glyphWidth`, `getGlyphClip`, `codepointToUtf8` sin callers | Importante | DONE | esborrats | -| DEAD-03 | `text.hpp:64` | `getSprite()` sin callers | Menor | PENDING | borrar | -| DEAD-04 | `sprite.hpp:33` | `getRect()` sin callers | Menor | PENDING | borrar | -| DEAD-05 | `sprite.hpp:42-43` | `incX`, `incY` sin callers | Menor | PENDING | borrar | -| DEAD-06 | `sprite.hpp:12`, `moving_sprite.hpp:13` | ctors default sin callers | Menor | PENDING | borrar | -| DEAD-07 | `animated_sprite.hpp:30` | `getCurrentAnimationSize()` sin callers | Menor | PENDING | borrar | -| DEAD-08 | `surface.hpp:61` | `getSurfaceData()` sin callers externos | Menor | PENDING | borrar o privatizar | +| DEAD-03 | `text.hpp:64` | `getSprite()` sin callers | Menor | DONE | esborrat amb DEAD-01/02 | +| DEAD-04 | `sprite.hpp:33` | `getRect()` sin callers | Menor | DONE | esborrat | +| DEAD-05 | `sprite.hpp:42-43` | `incX`, `incY` sin callers | Menor | DONE | esborrats | +| DEAD-06 | `sprite.hpp:12`, `moving_sprite.hpp:13` | ctors default sin callers | Menor | WONTFIX | usats transitivament pel ctor de `AnimatedSprite` (base-class-construction) | +| DEAD-07 | `animated_sprite.hpp:30` | `getCurrentAnimationSize()` sin callers | Menor | DONE | esborrat | +| DEAD-08 | `surface.hpp:61` | `getSurfaceData()` sin callers externos | Menor | DONE | esborrat | | DEAD-09 | `gif.hpp:45-65` | `Extension`, `ApplicationExtension`, `PlaintextExtension`, `GraphicControlExtension` no instanciados | Menor | PENDING | borrar | -| DEAD-10 | `sprite.cpp:47-49` | `Sprite::update` hook no invocado | Menor | PENDING | borrar (cruza PATCH-04) | +| DEAD-10 | `sprite.cpp:47-49` | `Sprite::update` hook no invocado | Menor | DONE | inlined buit al header (resol PATCH-04) | ## 7. Violaciones de convenciones del proyecto @@ -127,4 +127,5 @@ Los IDs se mantienen estables una vez asignados. Cada entrada apunta al(los) fic - `a63deac` — DUP-03 + HC-01: `Text` amb `resolveGlyph` i constants `INK_COLOR_INDEX` / `DEFAULT_TEXT_COLOR` - `029907d` — COUP-02a: `Screen` desacoblat de `SDL3GPUShader` via `makeDefaultShaderBackend()` - `81fe826` — COUP-02b (= COUP-03): `Surface` usa `Rendering::activeCanvas()` en lloc de `Screen::get()` -- `` — DEAD-01 + DEAD-02: esborrats `writeShadowed`/`writeCentered`/`glyphWidth`/`getGlyphClip`/`codepointToUtf8` +- `b51109e` — DEAD-01 + DEAD-02 + DEAD-03: esborrats mètodes mort de `Text` +- `` — DEAD-04/05/07/08/10 + PATCH-04: neteja mort a `Sprite`/`AnimatedSprite`/`Surface` + `Sprite::update` inline diff --git a/source/core/rendering/sprite/animated_sprite.hpp b/source/core/rendering/sprite/animated_sprite.hpp index bead9ac..b05cd38 100644 --- a/source/core/rendering/sprite/animated_sprite.hpp +++ b/source/core/rendering/sprite/animated_sprite.hpp @@ -27,7 +27,6 @@ class AnimatedSprite : public MovingSprite { void update(float delta_time) override; auto animationIsCompleted() -> bool; - auto getCurrentAnimationSize() -> int { return static_cast(animations_[current_animation_].frames.size()); } void setCurrentAnimation(const std::string& name = "default"); void setCurrentAnimation(int index = 0); diff --git a/source/core/rendering/sprite/sprite.cpp b/source/core/rendering/sprite/sprite.cpp index 02579c9..2e04939 100644 --- a/source/core/rendering/sprite/sprite.cpp +++ b/source/core/rendering/sprite/sprite.cpp @@ -43,7 +43,3 @@ void Sprite::clear() { pos_ = {.x = 0.0F, .y = 0.0F, .w = 0.0F, .h = 0.0F}; clip_ = {.x = 0.0F, .y = 0.0F, .w = 0.0F, .h = 0.0F}; } - -void Sprite::update(float delta_time) { - (void)delta_time; -} diff --git a/source/core/rendering/sprite/sprite.hpp b/source/core/rendering/sprite/sprite.hpp index c73d043..806b2d5 100644 --- a/source/core/rendering/sprite/sprite.hpp +++ b/source/core/rendering/sprite/sprite.hpp @@ -16,7 +16,9 @@ class Sprite { virtual ~Sprite() = default; - virtual void update(float delta_time); + // Hook d'actualització per frame. Base buida (no hi ha Sprite pur a + // actualitzar); les subclasses mòbils/animades fan override. + virtual void update(float /*delta_time*/) {} virtual void render(); // Renderitza substituint l'índex source_color per target_color (ús típic: // la classe Text, que recolora glifs monocroms per paràmetre). @@ -30,7 +32,6 @@ class Sprite { [[nodiscard]] auto getPosition() const -> SDL_FRect { return pos_; } [[nodiscard]] auto getClip() const -> SDL_FRect { return clip_; } [[nodiscard]] auto getSurface() const -> std::shared_ptr { return surface_; } - auto getRect() -> SDL_FRect& { return pos_; } void setX(float x) { pos_.x = x; } void setY(float y) { pos_.y = y; } @@ -39,8 +40,6 @@ class Sprite { void setPosition(float x, float y); void setPosition(SDL_FPoint p); void setPosition(SDL_FRect r) { pos_ = r; } - void incX(float value) { pos_.x += value; } - void incY(float value) { pos_.y += value; } void setClip(SDL_FRect rect) { clip_ = rect; } void setClip(float x, float y, float w, float h) { clip_ = SDL_FRect{.x = x, .y = y, .w = w, .h = h}; } diff --git a/source/core/rendering/surface.hpp b/source/core/rendering/surface.hpp index 0a9ef16..ee1aa3b 100644 --- a/source/core/rendering/surface.hpp +++ b/source/core/rendering/surface.hpp @@ -58,7 +58,6 @@ class Surface { void putPixel(int x, int y, Uint8 color); [[nodiscard]] auto getPixel(int x, int y) const -> Uint8; - [[nodiscard]] auto getSurfaceData() const -> std::shared_ptr { return surface_data_; } [[nodiscard]] auto getWidth() const -> int { return surface_data_->width; } [[nodiscard]] auto getHeight() const -> int { return surface_data_->height; }