From 7a0cf92c25c4c0de8b8e80e096ed53ac96f690aa Mon Sep 17 00:00:00 2001 From: janwas Date: Tue, 5 Oct 2004 13:10:49 +0000 Subject: [PATCH] add RES_UNIQUE, required for sound code This was SVN commit r1209. --- source/lib/res/h_mgr.cpp | 2 +- source/lib/res/h_mgr.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index 024321d3f1..a1c1684b07 100755 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -505,7 +505,7 @@ Handle h_alloc(H_Type type, const char* fn, uint flags, ...) if(!key) flags |= RES_NO_CACHE; // changes scope to RES_TEMP // check if already loaded (cached) - else + else if(!(flags & RES_UNIQUE)) { // object already loaded? h = h_find(type, key); diff --git a/source/lib/res/h_mgr.h b/source/lib/res/h_mgr.h index a2e67117f0..fe897a9804 100755 --- a/source/lib/res/h_mgr.h +++ b/source/lib/res/h_mgr.h @@ -160,6 +160,9 @@ enum // alias for RES_TEMP scope. the handle will not be kept open. RES_NO_CACHE = 1, + // not cached, and will never reuse a previous instance + RES_UNIQUE = 1|16, + // the resource isn't backed by a file. the fn parameter is treated as the search key (uintptr_t) // currently only used by mem manager RES_KEY = 8