feat(menu): primera versió del menú de servei
This commit is contained in:
1 parent
e4a8b4cd3e
commit
350625dec0
21 files changed
+1477
-16
No files matched your search
@@ -90,9 +90,13 @@ void Surface::render(int x, int y, const SDL_FRect* src_rect, SDL_FlipMode flip)
|
||||
|
||||
void Surface::renderWithColorReplace(int x, int y, Uint8 source_color, Uint8 target_color, const SDL_FRect* src_rect, SDL_FlipMode flip) const {
|
||||
const auto CANVAS = Rendering::activeCanvas();
|
||||
const auto CLIP = Rendering::activeClip();
|
||||
Uint32* dst = CANVAS.pixels;
|
||||
const int DST_W = CANVAS.width;
|
||||
const int DST_H = CANVAS.height;
|
||||
const int CLIP_X0 = CLIP.x;
|
||||
const int CLIP_Y0 = CLIP.y;
|
||||
const int CLIP_X1 = CLIP.x + CLIP.w;
|
||||
const int CLIP_Y1 = CLIP.y + CLIP.h;
|
||||
|
||||
const int SX = (src_rect != nullptr) ? static_cast<int>(src_rect->x) : 0;
|
||||
const int SY = (src_rect != nullptr) ? static_cast<int>(src_rect->y) : 0;
|
||||
@@ -109,7 +113,7 @@ void Surface::renderWithColorReplace(int x, int y, Uint8 source_color, Uint8 tar
|
||||
const int SRC_Y = (flip == SDL_FLIP_VERTICAL) ? (SY + sh - 1 - iy) : (SY + iy);
|
||||
const int DST_X = x + ix;
|
||||
const int DST_Y = y + iy;
|
||||
if (DST_X < 0 || DST_X >= DST_W || DST_Y < 0 || DST_Y >= DST_H) { continue; }
|
||||
if (DST_X < CLIP_X0 || DST_X >= CLIP_X1 || DST_Y < CLIP_Y0 || DST_Y >= CLIP_Y1) { continue; }
|
||||
|
||||
const Uint8 COLOR = src[SRC_X + (SRC_Y * surface_data_->width)];
|
||||
if (COLOR == transparent_color_) { continue; }
|
||||
|
||||
Reference in new issue
Block a user