refactor: extreure helpers per reduir complexitat cognitiva (tidy net)
This commit is contained in:
@@ -57,6 +57,13 @@ class Text {
|
||||
void loadFont(const char* fnt_file);
|
||||
void loadBitmap(const char* gif_file);
|
||||
|
||||
// Resolt un codepoint al GlyphInfo corresponent o al fallback '?'.
|
||||
// Retorna nullptr si ni el codepoint ni el fallback existeixen.
|
||||
[[nodiscard]] auto resolveGlyph(uint32_t cp) const -> const GlyphInfo*;
|
||||
// Pinta un glif a (dst_x, dst_y) amb clipping per finestra.
|
||||
// Si la finestra és tota la pantalla, passar clip_x_min=0, clip_x_max=SCREEN_WIDTH, idem y.
|
||||
void blitGlyph(Uint32* pixel_data, int dst_x, int dst_y, const GlyphInfo& glyph, Uint32 color, int clip_x_min, int clip_x_max, int clip_y_min, int clip_y_max) const;
|
||||
|
||||
static constexpr int SCREEN_WIDTH = 320;
|
||||
static constexpr int SCREEN_HEIGHT = 200;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user