Esempio n. 1
0
void ui_elem_delete(char* name) {

  int* type_ptr = dict_get(ui_elem_types, name);
  int type_id = *type_ptr;

  for(int i = 0; i < num_ui_elem_handlers; i++) {
    ui_elem_handler ui_hand = ui_elem_handlers[i];
    if (ui_hand.type_id == type_id) {
      dict_remove_with(ui_elems, name, ui_hand.del_func);
      break;
    }
  }
  
  if (ui_elem_exists(name)) {
    error("Don't know how to delete UI element %s. No handler for type %s!", name, type_id_name(type_id));
  }

}
Esempio n. 2
0
void file_unload(fpath filename) {

  filename = asset_map_filename(filename);

  fpath ext;
  SDL_PathFileExtension(ext.ptr, filename.ptr);

  for(int i=0; i < num_asset_handlers; i++) {

    asset_handler handler = asset_handlers[i];
    if (strcmp(ext.ptr, handler.extension) == 0) {
      debug("Unloading: '%s'", filename.ptr);
      dict_remove_with(asset_dict, filename.ptr, handler.del_func);
      break;
    }

  }
}