remove redundant cell iter check
This commit is contained in:
parent
dbd16ccd67
commit
fef1d98c26
@ -380,11 +380,6 @@ struct space_client *space_iter_next(struct space_iter *iter)
|
|||||||
/* Started */
|
/* Started */
|
||||||
ASSERT(iter->prev != NULL);
|
ASSERT(iter->prev != NULL);
|
||||||
next_node = iter->prev->next_in_cell;
|
next_node = iter->prev->next_in_cell;
|
||||||
} else if (cell_cur.x < cell_start.x || cell_cur.y < cell_start.y) {
|
|
||||||
/* Unstarted */
|
|
||||||
iter->cell_cur = iter->cell_start;
|
|
||||||
iter->cell_cur.x -= 1;
|
|
||||||
iter->cell_cur.y -= 1;
|
|
||||||
} else if (cell_cur.x > cell_end.x || cell_cur.y > cell_end.y) {
|
} else if (cell_cur.x > cell_end.x || cell_cur.y > cell_end.y) {
|
||||||
/* Ended */
|
/* Ended */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -408,19 +403,18 @@ struct space_client *space_iter_next(struct space_iter *iter)
|
|||||||
cell_cur.y += nexty;
|
cell_cur.y += nexty;
|
||||||
cell_cur.x += (cell_cur.x == 0);
|
cell_cur.x += (cell_cur.x == 0);
|
||||||
cell_cur.y += (cell_cur.y == 0);
|
cell_cur.y += (cell_cur.y == 0);
|
||||||
iter->cell_cur = cell_cur;
|
|
||||||
struct space_cell *cell = space_get_cell(space, cell_cur);
|
struct space_cell *cell = space_get_cell(space, cell_cur);
|
||||||
next_node = cell->first_node;
|
next_node = cell->first_node;
|
||||||
} else {
|
} else {
|
||||||
/* Reached end of iter */
|
/* Reached end of iter */
|
||||||
cell_cur.x += 1;
|
cell_cur.x += 1;
|
||||||
cell_cur.y += 1;
|
cell_cur.y += 1;
|
||||||
iter->cell_cur = cell_cur;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iter->prev = next_node;
|
iter->prev = next_node;
|
||||||
|
iter->cell_cur = cell_cur;
|
||||||
|
|
||||||
return next_node ? next_node->client : NULL;
|
return next_node ? next_node->client : NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -439,8 +439,10 @@ INTERNAL void debug_draw_movement(struct entity *ent)
|
|||||||
struct v2 pos = xform_mul_v2(G.world_to_ui_xf, xf.og);
|
struct v2 pos = xform_mul_v2(G.world_to_ui_xf, xf.og);
|
||||||
struct v2 vel_ray = xform_basis_mul_v2(G.world_to_ui_xf, velocity);
|
struct v2 vel_ray = xform_basis_mul_v2(G.world_to_ui_xf, velocity);
|
||||||
|
|
||||||
|
if (v2_len(vel_ray) > 0.00001) {
|
||||||
draw_arrow_ray(G.ui_cmd_buffer, pos, vel_ray, thickness, arrow_len, color_vel);
|
draw_arrow_ray(G.ui_cmd_buffer, pos, vel_ray, thickness, arrow_len, color_vel);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ========================== *
|
/* ========================== *
|
||||||
* Sort entities
|
* Sort entities
|
||||||
@ -1077,8 +1079,9 @@ INTERNAL void user_update(void)
|
|||||||
f32 thickness = 2;
|
f32 thickness = 2;
|
||||||
{
|
{
|
||||||
/* Draw collider using support points */
|
/* Draw collider using support points */
|
||||||
|
u32 detail = 32;
|
||||||
//u32 detail = 64;
|
//u32 detail = 64;
|
||||||
u32 detail = 512;
|
//u32 detail = 512;
|
||||||
draw_collider_line(G.ui_cmd_buffer, G.world_to_ui_xf, collider, xf, thickness, color, detail);
|
draw_collider_line(G.ui_cmd_buffer, G.world_to_ui_xf, collider, xf, thickness, color, detail);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user