correct my bullshit on bitmaps :E
This commit is contained in:
parent
bcbab0342a
commit
eb69825bd3
Binary file not shown.
BIN
libfxengine.a
BIN
libfxengine.a
Binary file not shown.
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue