comparison dmres.c @ 737:897646df1de1

Handle preloading of resources that do not have rops.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 21 Apr 2013 20:33:48 +0300
parents ea42faa02a9a
children
comparison
equal deleted inserted replaced
736:ea42faa02a9a 737:897646df1de1
611 static int dmResourcePreload(DMResource *handle) 611 static int dmResourcePreload(DMResource *handle)
612 { 612 {
613 int ret = DMERR_OK; 613 int ret = DMERR_OK;
614 614
615 // Check if we want to preload raw data? 615 // Check if we want to preload raw data?
616 if (handle->lib->flags & DRF_PRELOAD_RAW) 616 if ((handle->lib->flags & DRF_PRELOAD_RAW) ||
617 handle->rops == NULL || handle->rops->load == NULL)
617 { 618 {
618 if (handle->flags & DMF_LOADED_RAW) 619 if (handle->flags & DMF_LOADED_RAW)
619 ret = DMERR_OK; 620 ret = DMERR_OK;
620 else 621 else
621 if (handle->fops->preload != NULL) 622 if (handle->fops->preload != NULL)
697 { 698 {
698 dmResourceFree(handle); 699 dmResourceFree(handle);
699 *phandle = handle = NULL; 700 *phandle = handle = NULL;
700 } 701 }
701 702
703 dmfreset(handle);
702 return res; 704 return res;
703 } 705 }
704 706
705 707
706 int dmf_create_memio(DMResourceLib *lib, const char *filename, 708 int dmf_create_memio(DMResourceLib *lib, const char *filename,