From 3d0e33d2aaff957a30a9c49985485d2930341de1 Mon Sep 17 00:00:00 2001 From: Anurag Thakur Date: Wed, 14 Sep 2022 20:34:48 +0530 Subject: [PATCH] Almost fix rendering --- src/dense/ftdense.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/dense/ftdense.c b/src/dense/ftdense.c index af52dbccf..dfd0f7417 100644 --- a/src/dense/ftdense.c +++ b/src/dense/ftdense.c @@ -67,13 +67,13 @@ swap( long int* a, long int* b ) void -dense_render_line( dense_worker* worker, TPos to_x, TPos to_y ) +dense_render_line( dense_worker* worker, TPos tox, TPos toy ) { // printf("line from: %d, %d to %d, %d\n", worker->prev_x, worker->prev_y, // to_x, to_y); - TPos from_x = worker->prev_x; - TPos from_y = worker->prev_y; - if ( from_y == to_y ) + float from_x = worker->prev_x; + float from_y = worker->prev_y; + if ( from_y == toy ) return; // aP0.m_x -= worker->m_origin_x; @@ -81,12 +81,18 @@ dense_render_line( dense_worker* worker, TPos to_x, TPos to_y ) // aP1.m_x -= worker->m_origin_x; // aP1.m_y -= worker->m_origin_y; - from_x = TRUNC( (int)from_x ); - from_y = TRUNC( (int)from_y ); - to_x = TRUNC( (int)to_x ); - to_y = TRUNC( (int)to_y ); + // from_x = TRUNC( (int)from_x ); + // from_y = TRUNC( (int)from_y ); + // to_x = TRUNC( (int)to_x ); + // to_y = TRUNC( (int)to_y ); - // printf("line from: %d, %d to %d, %d\n", from_x, from_y, to_x, to_y); + from_x /= 256.0; + from_y /= 256.0; + float to_x = tox / 256.0; + float to_y = toy / 256.0; + + + //printf("line from: %f, %f to %f, %f\n", from_x, from_y, to_x, to_y); float dir; if ( from_y < to_y )