polyadvent

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

commit e7c279ca918af3493c045a632db24e0a8fb75733
parent bef20f847695586b99115971811ecd3490a4fa53
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 21 Jul 2019 20:20:24 -0700

is_null_id

Diffstat:
Msrc/resource.h | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/resource.h b/src/resource.h @@ -43,7 +43,6 @@ void *new_resource(struct resource_manager *, struct resource_id *id); void *new_static_resource(struct resource_manager *, struct resource_id *id); void print_id(struct resource_id *, int nl); void null_id(struct resource_id *id); -/* int is_static_resource(struct resource_id *id); */ void init_resource_manager(struct resource_manager *r, u32 elem_size, u32 initial_elements, u32 max_elements, const char *name, @@ -65,5 +64,10 @@ static inline int is_static_resource(struct resource_id *id) return id->uuid == STATIC_UUID; } +static inline int is_null_id(struct resource_id *id) +{ + return id->generation == 0; +} + #endif /* RESOURCE_H */