Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: test
on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev
- run: make MAINT=1
15 changes: 7 additions & 8 deletions sdl/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static bool GlyphIsEmpty[256] = {};
static Uint8 *SingleHorzLineEdge = NULL;
static Uint8 *DoubleHorzLineEdge = NULL;

static void FixUpLineJoiningGlitch(SDL_Surface *s, Uint8 *HorzLineEdge, bool useRightEdge)
static void FixUpLineJoiningGlitch(SDL_Surface *s, bool useRightEdge)
{
Uint64 diff[2] = {}; // initialize all element to zero
for (int d=0; d<=1; d++)
Expand Down Expand Up @@ -339,27 +339,27 @@ static SDL_Texture*& GetGlyph(SDL_Renderer *ren, TTF_Font* font, BYTE chr)
if (wcschr(L"┤╢╖┐┬┼╥╫", str[0]) != NULL)
{
GetGlyph(ren, font, 0xC4); // ─ // make sure SingleHorzLineEdge is initialized
FixUpLineJoiningGlitch(s, SingleHorzLineEdge, false);
FixUpLineJoiningGlitch(s, false);
FixUpGlyphVerticallyTop(s);
}
if (wcschr(L"╡╕╣╗╦╬╤╪", str[0]) != NULL)
{
GetGlyph(ren, font, 0xCD); // ═ // make sure DoubleHorzLineEdge is initialized
FixUpLineJoiningGlitch(s, DoubleHorzLineEdge, false);
FixUpLineJoiningGlitch(s, false);
FixUpGlyphVerticallyTop(s);
}
else
if (wcschr(L"├╟╓┌", str[0]) != NULL)
{
GetGlyph(ren, font, 0xC4); // ─ // make sure SingleHorzLineEdge is initialized
FixUpLineJoiningGlitch(s, SingleHorzLineEdge, true);
FixUpLineJoiningGlitch(s, true);
FixUpGlyphVerticallyTop(s);
}
else
if (wcschr(L"╞╔╠╒", str[0]) != NULL)
{
GetGlyph(ren, font, 0xCD); // ═ // make sure DoubleHorzLineEdge is initialized
FixUpLineJoiningGlitch(s, DoubleHorzLineEdge, true);
FixUpLineJoiningGlitch(s, true);
FixUpGlyphVerticallyTop(s);
}
#endif
Expand Down Expand Up @@ -387,7 +387,6 @@ static void RenderCharacterAt(SDL_Renderer *ren, TTF_Font* font, Uint x, Uint y)
Uint bgScreen = tile.color >> 4;
SDL_Color fg = ScreenColors[fgScreen];
SDL_Color bg = ScreenColors[bgScreen];
SDL_Color black = {0, 0, 0, 0xFF};
SDL_Rect rect = { (int)x * TileWidth, (int)y * TileHeight, TileWidth, TileHeight };
SDL_SetRenderDrawColor(ren, bg.r, bg.g, bg.b, 0xFF);
if (bgScreen != 0)
Expand Down Expand Up @@ -415,8 +414,8 @@ static void ClearGlyphs()
{
memset(Glyphs, 0, sizeof(Glyphs));
memset(GlyphIsEmpty, 0, sizeof(GlyphIsEmpty));
if (SingleHorzLineEdge) delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL;
if (DoubleHorzLineEdge) delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL;
if (SingleHorzLineEdge) { delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL; }
if (DoubleHorzLineEdge) { delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL; }
}
static void DestroyGlyphs()
{
Expand Down