Fix a very nasty bug

This commit is contained in:
Miloslav Ciz 2025-06-18 03:53:35 +02:00
parent abd68ce0ae
commit dae47de5f9
4 changed files with 24 additions and 18 deletions

View file

@ -112,7 +112,8 @@ int _LCR_strCmp(const char *s1, const char *s2)
return 1;
}
char _LCR_triangleWinding(int x0, int y0, int x1, int y1, int x2, int y2)
int _LCR_triangleWinding(int_least32_t x0, int_least32_t y0, int_least32_t x1,
int_least32_t y1, int_least32_t x2, int_least32_t y2)
{
x0 = (y1 - y0) * (x2 - x1) - (x1 - x0) * (y2 - y1);
return x0 != 0 ? (x0 > 0 ? 1 : -1) : 0;