Skip to content

Commit

Permalink
Change: Add outline of sprite to sprite aligner.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterN committed Dec 4, 2023
1 parent f7380a4 commit 4d9f335
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/newgrf_debug_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,11 @@ struct SpriteAlignerWindow : Window {
AutoRestoreBackup dpi_backup(_cur_dpi, &new_dpi);

DrawSprite(this->current_sprite, PAL_NONE, x, y, nullptr, SpriteAlignerWindow::zoom);

Rect outline = {0, 0, UnScaleByZoom(spr->width, SpriteAlignerWindow::zoom) - 1, UnScaleByZoom(spr->height, SpriteAlignerWindow::zoom) - 1};
outline = outline.Translate(x + UnScaleByZoom(spr->x_offs, SpriteAlignerWindow::zoom),y + UnScaleByZoom(spr->y_offs, SpriteAlignerWindow::zoom));
DrawRectOutline(outline.Expand(1), PC_LIGHT_BLUE, 1, 1);

if (SpriteAlignerWindow::crosshair) {
GfxDrawLine(x, 0, x, ir.Height() - 1, PC_WHITE, 1, 1);
GfxDrawLine(0, y, ir.Width() - 1, y, PC_WHITE, 1, 1);
Expand Down

0 comments on commit 4d9f335

Please sign in to comment.