Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F620578
resource.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
resource.h
View Options
#ifndef _rtech1_resource_manager_h
#define _rtech1_resource_manager_h
#include
"file-system.h"
#include
"thread.h"
#include
"pointer.h"
#include
<map>
#include
<string>
#include
<vector>
class
Sound
;
namespace
Graphics
{
class
Bitmap
;
}
/* thread-safe */
class
Resource
{
public
:
/* do not prepend Util::getDataPath() to paths. Resource will do it for you.
*/
static
Util
::
ReferenceCount
<
Sound
>
getSound
(
const
Filesystem
::
RelativePath
&
path
);
static
Util
::
ReferenceCount
<
Graphics
::
Bitmap
>
getBitmap
(
const
Filesystem
::
RelativePath
&
path
);
static
void
destroy
();
static
void
initialize
();
private
:
static
Resource
*
getResource
();
Resource
();
virtual
~
Resource
();
Util
::
ReferenceCount
<
Sound
>
_getSound
(
const
Filesystem
::
AbsolutePath
&
path
);
Util
::
ReferenceCount
<
Graphics
::
Bitmap
>
_getBitmap
(
const
Filesystem
::
AbsolutePath
&
path
);
private
:
static
Resource
*
resource
;
std
::
map
<
std
::
string
,
Util
::
ReferenceCount
<
Sound
>
>
sounds
;
std
::
map
<
std
::
string
,
Util
::
ReferenceCount
<
Graphics
::
Bitmap
>
>
bitmaps
;
Util
::
Thread
::
LockObject
lock
;
};
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 6:11 PM (16 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
129823
Default Alt Text
resource.h (1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline