1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Add DEV_ASSERT and DEV_CHECK macros

Change the existing DEV_ASSERT function to be switched on and off by the DEV_ENABLED define. DEV_ASSERT breaks into the debugger as soon as hit.
Add error macros DEV_CHECK and DEV_CHECK_ONCE to add an alternative check that ERR_PRINT when a condition fails, again only enabled in DEV_ENABLED builds.
This commit is contained in:
lawnjelly
2021-10-04 14:13:43 +01:00
parent 555e937815
commit c835f1f3c5
9 changed files with 58 additions and 35 deletions

View File

@@ -64,10 +64,6 @@ OcclusionHandle PortalRenderer::instance_moving_create(VSInstance *p_instance, R
}
void PortalRenderer::instance_moving_update(OcclusionHandle p_handle, const AABB &p_aabb, bool p_force_reinsert) {
// we can ignore these, they are statics / dynamics, and don't need updating
// .. these should have been filtered out before calling the visual server...
DEV_ASSERT(!_occlusion_handle_is_in_room(p_handle));
p_handle--;
Moving &moving = _moving_pool[p_handle];
moving.exact_aabb = p_aabb;
@@ -77,6 +73,10 @@ void PortalRenderer::instance_moving_update(OcclusionHandle p_handle, const AABB
return;
}
// we can ignore these, they are statics / dynamics, and don't need updating
// .. these should have been filtered out before calling the visual server...
DEV_CHECK_ONCE(!_occlusion_handle_is_in_room(p_handle));
// quick reject for most roaming cases
if (!p_force_reinsert && moving.expanded_aabb.encloses(p_aabb)) {
return;