-#include <assert.h>
+#include "system/stacktrace.h"
#include <stdlib.h>
#include "game/level/platforms.h"
#include "physical_world.h"
-#include "system/error.h"
#include "system/lt.h"
#include "system/nth_alloc.h"
Physical_world * const physical_world =
PUSH_LT(lt, nth_alloc(sizeof(Physical_world)), free);
if (physical_world == NULL) {
- throw_error(ERROR_TYPE_LIBC);
RETURN_LT(lt, NULL);
}
nth_alloc(sizeof(Solid_ref) * PHYSICAL_WORLD_CAPACITY),
free);
if (physical_world->solids == NULL) {
- throw_error(ERROR_TYPE_LIBC);
RETURN_LT(lt, NULL);
}
void destroy_physical_world(Physical_world *physical_world)
{
- assert(physical_world);
+ trace_assert(physical_world);
RETURN_LT0(physical_world->lt);
}
void physical_world_collide_solids(Physical_world *physical_world,
Platforms *platforms)
{
- assert(physical_world);
+ trace_assert(physical_world);
for (size_t i = 0; i < physical_world->size; ++i) {
solid_collide_with_solid(
int physical_world_add_solid(Physical_world *physical_world,
Solid_ref solid)
{
- assert(physical_world);
+ trace_assert(physical_world);
if (physical_world->size >= physical_world->capacity) {
const size_t new_capacity = physical_world->capacity * 2;
void physical_world_clean(Physical_world *physical_world)
{
- assert(physical_world);
+ trace_assert(physical_world);
physical_world->size = 0;
}