X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fresource.c;fp=src%2Fresource.c;h=0000000000000000000000000000000000000000;hb=0b85f1dd5993e2ed111ec2ba13bbbb4ebda06ada;hp=c6b4d34dc0cd4433c74461a48f91b988b2847a2e;hpb=08f8444e2ae5480eea1cf7e2c1e2eb57f46152db;p=rodin%2Fchimara.git diff --git a/src/resource.c b/src/resource.c deleted file mode 100644 index c6b4d34..0000000 --- a/src/resource.c +++ /dev/null @@ -1,54 +0,0 @@ -#include "resource.h" - -extern ChimaraGlkPrivate *glk_data; - -/** - * giblorb_set_resource_map: - * @file The file stream to read the resource map from - * - * This function tells the library that the file is indeed the Blorby source - * of all resource goodness. Whenever your program calls an image or sound - * function, such as glk_image_draw(), the library will search this file for - * the resource you request. - * - * Do not close the stream after calling this function. The library is - * responsible for closing the stream at shutdown time. - */ -giblorb_err_t -giblorb_set_resource_map(strid_t file) -{ - giblorb_map_t *newmap; /* create map allocates memory */ - giblorb_err_t error = giblorb_create_map(file, &newmap); - - if(error != giblorb_err_None) { - g_free(newmap); - return error; - } - - /* Check if there was already an existing resource map */ - if(glk_data->resource_map != NULL) { - WARNING("Overwriting existing resource map.\n"); - giblorb_destroy_map(glk_data->resource_map); - glk_stream_close(glk_data->resource_file, NULL); - } - - glk_data->resource_map = newmap; - glk_data->resource_file = file; - return giblorb_err_None; -} - -/** - * giblorb_get_resource_map: - * - * This function returns the current resource map being used. Returns NULL - * if #giblorb_set_resource_map() has not been called yet. - */ -giblorb_map_t* -giblorb_get_resource_map() -{ - if(glk_data->resource_map == NULL) { - WARNING("Resource map not set yet.\n"); - } - - return glk_data->resource_map; -}