mini changes
This commit is contained in:
parent
afeb906e46
commit
8968379940
|
@ -58,4 +58,4 @@ double cos(double angle);
|
|||
|
||||
double sin(const double angle);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -18,4 +18,4 @@ void render_zbuffer_clear();
|
|||
**/
|
||||
bool render_zbuffer_set_px(uint32_t x, uint32_t y, uint32_t dist); // if you are allowed to draw the pixel on vram
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -30,4 +30,4 @@ void FE_keyboard_reload()
|
|||
void FE_keyboard_set_key(uint32_t matrix_code, uint32_t ev_type, callback function)
|
||||
{
|
||||
callbacks[ev_type-1][get_x(matrix_code)][get_y(matrix_code)]=function;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ bitmap_rich* bitmap_new_rich(uint32_t size_px_x, uint32_t size_px_y, uint32_t* c
|
|||
}
|
||||
else
|
||||
bmp->layout = layout;
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
|
@ -71,6 +72,7 @@ inline uint8_t bitmap_get_pixel_r(const bitmap_rich * bmp, uint32_t x, uint32_t
|
|||
const uint32_t indice = y * bmp->size_o_y + (x >> 5);
|
||||
|
||||
const uint32_t numero_bit = 31 - x % 32;
|
||||
|
||||
if (bmp->layout)
|
||||
return (( bmp->layout[indice] | 1 << numero_bit ) << 1) + ( bmp->color[indice] | (1 << numero_bit) );
|
||||
else
|
||||
|
|
|
@ -38,12 +38,12 @@ void render_zbuffer_clear()
|
|||
bool render_zbuffer_set_px(uint32_t x, uint32_t y, uint32_t dist)
|
||||
{
|
||||
const int indice = x * render_height + y;
|
||||
|
||||
|
||||
if (zbuffer[indice]>dist && dist>=render_min_dist && dist<=render_max_dist)
|
||||
{
|
||||
zbuffer[indice] = dist;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue