internal asset functions are now static
parent
64b8dbcbf3
commit
cc08588b17
|
@ -6,12 +6,12 @@
|
||||||
|
|
||||||
#define NUM_ASSETS 256
|
#define NUM_ASSETS 256
|
||||||
|
|
||||||
void _remove_asset(resource_t*);
|
static void _remove_asset(resource_t*);
|
||||||
|
|
||||||
resource_t g_assets[NUM_ASSETS];
|
resource_t g_assets[NUM_ASSETS];
|
||||||
resource_t* g_assets_endptr = g_assets;
|
resource_t* g_assets_endptr = g_assets;
|
||||||
|
|
||||||
resource_t* insert_asset(const resource_t* resource) {
|
static resource_t* insert_asset(const resource_t* resource) {
|
||||||
*g_assets_endptr = *resource;
|
*g_assets_endptr = *resource;
|
||||||
resource_t* inserted = g_assets_endptr;
|
resource_t* inserted = g_assets_endptr;
|
||||||
++g_assets_endptr;
|
++g_assets_endptr;
|
||||||
|
@ -95,7 +95,7 @@ resource_t* get_asset(const char* file) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _delete_referenced_asset(resource_t* res) {
|
static void _delete_referenced_asset(resource_t* res) {
|
||||||
free(res->name);
|
free(res->name);
|
||||||
switch(res->type) {
|
switch(res->type) {
|
||||||
default:
|
default:
|
||||||
|
@ -139,7 +139,7 @@ void clean_assets() {
|
||||||
g_assets_endptr = g_assets;
|
g_assets_endptr = g_assets;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _remove_asset(resource_t* res) {
|
static void _remove_asset(resource_t* res) {
|
||||||
_delete_referenced_asset(res);
|
_delete_referenced_asset(res);
|
||||||
resource_t* last = g_assets_endptr - 1;
|
resource_t* last = g_assets_endptr - 1;
|
||||||
memmove(res, last, sizeof(resource_t));
|
memmove(res, last, sizeof(resource_t));
|
||||||
|
|
Loading…
Reference in New Issue