polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 1cbe79dc0f73f308b51330fa97b9bdc613884d16
parent 7ad510b6278446bbbac587b0799fcf1fcc3590b8
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 19 Apr 2020 17:22:10 -0700

add resource debug

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/resource.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/resource.c b/src/resource.c @@ -168,8 +168,10 @@ void *new_resource(struct resource_manager *r, struct resource_id *id) struct resource_id *fresh_id; - if (r->resource_count + 1 > r->max_capacity) + if (r->resource_count + 1 > r->max_capacity) { + printf("new_resource: count %d > max cap %d\n", r->resource_count, r->max_capacity); return NULL; + } if (r->resource_count + 1 > r->current_capacity) resize(r);