Remove some questionable code
Changelog: - Don't shorten overlap, that is already done on position after movement update - Don't extend tile when updating tile coordscene_man
parent
a8567e2666
commit
95c4b98879
|
@ -16,11 +16,11 @@ bool find_1D_overlap(const Vector2 l1, const Vector2 l2, float* overlap)
|
||||||
// x is p1, y is p2
|
// x is p1, y is p2
|
||||||
*overlap = (l2.y >= l1.y)? l2.x - l1.y : l2.y - l1.x;
|
*overlap = (l2.y >= l1.y)? l2.x - l1.y : l2.y - l1.x;
|
||||||
}
|
}
|
||||||
if (fabs(*overlap) < 0.01) // Use 2 dp precision
|
//if (fabs(*overlap) < 0.01) // Use 2 dp precision
|
||||||
{
|
//{
|
||||||
*overlap = 0;
|
// *overlap = 0;
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -699,8 +699,8 @@ void update_tilemap_system(Scene_t *scene)
|
||||||
// Extend the check by a little to avoid missing
|
// Extend the check by a little to avoid missing
|
||||||
unsigned int tile_x1 = (p_ctransform->position.x) / TILE_SIZE;
|
unsigned int tile_x1 = (p_ctransform->position.x) / TILE_SIZE;
|
||||||
unsigned int tile_y1 = (p_ctransform->position.y) / TILE_SIZE;
|
unsigned int tile_y1 = (p_ctransform->position.y) / TILE_SIZE;
|
||||||
unsigned int tile_x2 = (p_ctransform->position.x + p_bbox->size.x) / TILE_SIZE;
|
unsigned int tile_x2 = (p_ctransform->position.x + p_bbox->size.x - 1) / TILE_SIZE;
|
||||||
unsigned int tile_y2 = (p_ctransform->position.y + p_bbox->size.y) / TILE_SIZE;
|
unsigned int tile_y2 = (p_ctransform->position.y + p_bbox->size.y - 1) / TILE_SIZE;
|
||||||
|
|
||||||
for (unsigned int tile_y=tile_y1; tile_y <= tile_y2; tile_y++)
|
for (unsigned int tile_y=tile_y1; tile_y <= tile_y2; tile_y++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue