vindar / tgx

tgx - a tiny/teensy 3D graphics library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to compile under mingw64-gcc

liux-pro opened this issue · comments

Hi @vindar
I want to build tgx on windows, when I build it, gcc give me an error.
It makes sense, when code jump from line 532 to 544, after 2 lines, assign x to start, but start never declared since goto jump over line 533.

tgx/src/Image.inl

Lines 532 to 550 in 9117532

if (x >= x1) goto TGX_SCANFILL_SKIP;
int start = x + 1;
if (start < x1) TGX_SCANFILL_PUSH(start, x1 - 1, y, -dy); // leak on left
x = x1 + 1;
do
{
while ((x < _lx) && (TGX_SCANFILL_INSIDE(readPixel<false>(x, y))))
{
drawPixel<false>(x++, y, new_color);
}
TGX_SCANFILL_PUSH(start, x - 1, y, dy);
if (x > x2 + 1) TGX_SCANFILL_PUSH(x2 + 1, x - 1, y, -dy); // leak on right
TGX_SCANFILL_SKIP:
x++;
while ((x <= x2) && (!(TGX_SCANFILL_INSIDE(readPixel<false>(x, y))))) { x++; }
start = x;
}
while (x <= x2);
}

image

I made a simple modification, but I'm not so sure if it's correct.
#18

Hi @liux-pro

Can you please try the "improved-primitive" branch instead of "main" ? I have not updated main for a long time but I made a lot of changes to the other branch a few weeks ago I think I remember correcting the problem you mention. Anyway, I will merge this branch with main soon. The 2D API for the "improved-primitives" branch is, I think, much better.

Thank for your reply.
I will try improved-primitives branch.

Looking forward to the new version of tgx.

commented

I just put up a PR for main that fixed the build for me using updated compiler for beta TD,

WIll also try other branch as well

commented

close this issue since #19 has been merged