3 extern ChimaraGlkPrivate *glk_data;
6 * giblorb_set_resource_map:
7 * @file: The file stream to read the resource map from
9 * This function tells the library that the file is indeed the Blorby source
10 * of all resource goodness. Whenever your program calls an image or sound
11 * function, such as glk_image_draw(), the library will search this file for
12 * the resource you request.
14 * Do <emphasis>not</emphasis> close the stream after calling this function.
15 * The library is responsible for closing the stream at shutdown time.
17 * Returns: a Blorb error code.
20 giblorb_set_resource_map(strid_t file)
22 giblorb_map_t *newmap; /* create map allocates memory */
23 giblorb_err_t error = giblorb_create_map(file, &newmap);
25 if(error != giblorb_err_None) {
30 /* Check if there was already an existing resource map */
31 if(glk_data->resource_map != NULL) {
32 WARNING("Overwriting existing resource map.\n");
33 giblorb_destroy_map(glk_data->resource_map);
34 glk_stream_close(glk_data->resource_file, NULL);
37 glk_data->resource_map = newmap;
38 glk_data->resource_file = file;
39 return giblorb_err_None;
43 * giblorb_get_resource_map:
45 * This function returns the current resource map being used. Returns %NULL
46 * if giblorb_set_resource_map() has not been called yet.
48 * Returns: a resource map, or %NULL.
51 giblorb_get_resource_map()
53 if(glk_data->resource_map == NULL) {
54 WARNING("Resource map not set yet.\n");
57 return glk_data->resource_map;