tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Found an issue when compiling raylib with TCC


From: Ray
Subject: [Tinycc-devel] Found an issue when compiling raylib with TCC
Date: Mon, 28 May 2018 01:08:28 +0200

Hi TinyCC devs,

Just found an issue when compiling with TCC, it seems that TCC is not casting some int values correctly to float when dividing, I mean:

Following code fails on calculating correct float coordinates:

// sourceRec.x, sourceRec.y are floats
// texture.width, texture.height are int
rlTexCoord2f(sourceRec.x/texture.width, sourceRec.y/texture.height);

Same code works perfectly with MinGW, GCC, MSVC, Clang...

Also tried: 

rlTexCoord2f(sourceRec.x/(float)texture.width, sourceRec.y/(float)texture.height);

Instead I had to do:

float width = (float)texture.width;
float height = (float)texture.height;

rlTexCoord2f(sourceRec.x/width, sourceRec.y/height);

More info about this issue: https://github.com/raysan5/raylib/issues/553

By the way, thank you very much for this amazing light-weight super-fast compiler! It's the perfect companion for my videogames library: raylib.

Regards,

Ray

reply via email to

[Prev in Thread] Current Thread [Next in Thread]