diff --git a/build/src/render/translate.c.o b/build/src/render/translate.c.o index ca6c293..192b981 100644 Binary files a/build/src/render/translate.c.o and b/build/src/render/translate.c.o differ diff --git a/libfxengine.a b/libfxengine.a index 259779f..0878c63 100644 Binary files a/libfxengine.a and b/libfxengine.a differ diff --git a/src/render/bitmap.c b/src/render/bitmap.c index f953449..c485d45 100644 --- a/src/render/bitmap.c +++ b/src/render/bitmap.c @@ -6,11 +6,11 @@ inline uint8_t bitmap_get_pixel_r(const bitmap_rich * bmp, uint32_t x, uint32_t if (x >= bmp->size_px_x || y >= bmp->size_px_y) return 0; - const uint32_t indice = y * bmp->size_o_y + x >> 5; + const uint32_t indice = y * bmp->size_o_y + (x >> 5); const uint32_t numero_bit = 31 - x % 32; - return ( bmp->layout[indice] | 1 << numero_bit ) << 1 + ( bmp->color[indice] | 1 << numero_bit ); + return (( bmp->layout[indice] | 1 << numero_bit ) << 1) + ( bmp->color[indice] | 1 << numero_bit ); } diff --git a/src/render/translate.c b/src/render/translate.c index b6b203f..a10e4ac 100644 --- a/src/render/translate.c +++ b/src/render/translate.c @@ -8,7 +8,7 @@ const double pi2 = pi * 2; const double pi_sur_2 = pi / 2; -static double reducted_cos(const double a) +inline double reducted_cos(const double a) { double u= 1.0; const double a2 = a * a; @@ -27,19 +27,14 @@ double modulo_2pi(double a) return a; } -static double cos_recursive(double angle) -{ - if (angle<0) - return cos_recursive(-angle); - if (angle>=pi_sur_2) - return -reducted_cos(angle - pi); - return reducted_cos(angle); // OK -} - double cos(double angle) { angle = modulo_2pi(angle); - return cos_recursive(angle); + if (angle<0) + angle=-angle; + if (angle>=pi_sur_2) + return -reducted_cos(angle - pi); + return reducted_cos(angle); } double sin(double angle) @@ -120,4 +115,4 @@ void render_set(const double dh, const double dv, const double roulis, const FE_ // assigner delta memcpy(&delta, camera, sizeof(FE_integer_position)); -} \ No newline at end of file +}