blob: 924ecd38120dbc80b10291891e88c45e332b1eff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "TZR_resource.h"
#include "TZR_types.h"
#include <strings.h>
static TZR_ResourceType
deduce_type(const char *path)
{
const char *const path_extension = strrchr(path, '.');
if (path_extension == NULL)
return TZR_RES_RAW;
if (strcasecmp(path_extension, ".bmp") == 0 ||
strcasecmp(path_extension, ".png") == 0)
return TZR_RES_IMAGE;
return TZR_RES_RAW;
}
TZR_Uint
TZR_LoadResource(const char *path)
{
return TZR_LoadResourceTyped(deduce_type(path), path);
}
|