aboutsummaryrefslogtreecommitdiff
path: root/src/resources.odin
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-01-17 18:19:57 -0500
committeriamcheeseman <[hidden email]>2026-01-17 18:19:57 -0500
commitdb10e319cc2201924815b2d8c9a4c2d21c2bfbb6 (patch)
tree17c7d1b0e485dc07161cbdca80ae2239fd6146c5 /src/resources.odin
parenteee06361048e34f6ca21348e8776636da95ef3f8 (diff)
Verlet ropes :)
Diffstat (limited to 'src/resources.odin')
-rw-r--r--src/resources.odin12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/resources.odin b/src/resources.odin
index 315551d..1bd567e 100644
--- a/src/resources.odin
+++ b/src/resources.odin
@@ -96,3 +96,15 @@ get_image :: proc(id: Image_Id) -> rl.Texture2D {
get_room :: proc(id: Room_Id) -> Room_Resource {
return rooms[id]
}
+
+convert_path_to_resource :: proc(
+ obj: Object_Resource,
+ property: string,
+) -> Resource_Id {
+ path, has_path := obj.properties[property].(string)
+ if !has_path {
+ log.warnf("Property '%v' must be a path or string", property)
+ return nil
+ }
+ return path_to_resource_id[path]
+}