mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
GRIM: Use floating point division
This commit is contained in:
@@ -1397,7 +1397,7 @@ void GfxTinyGL::drawLine(const PrimitiveObject *primitive) {
|
||||
_zb->writePixel(_gameWidth * y + x1, color.getRed(), color.getGreen(), color.getBlue());
|
||||
}
|
||||
} else {
|
||||
float m = (y2 - y1) / (x2 - x1);
|
||||
float m = (y2 - y1) / (float)(x2 - x1);
|
||||
int b = (int)(-m * x1 + y1);
|
||||
for (int x = x1; x <= x2; x++) {
|
||||
int y = (int)(m * x) + b;
|
||||
|
||||
Reference in New Issue
Block a user