Mercurial > hg > dmlib
comparison dmres.c @ 627:bf8986a6ede1
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 15 Apr 2013 03:32:59 +0300 |
parents | e8fc083b7499 |
children | 0533f94e843b |
comparison
equal
deleted
inserted
replaced
626:1dc029925377 | 627:bf8986a6ede1 |
---|---|
620 ret = handle->fops->preload(handle); | 620 ret = handle->fops->preload(handle); |
621 if (ret == DMERR_OK) | 621 if (ret == DMERR_OK) |
622 { | 622 { |
623 handle->flags |= DMF_LOADED_RAW; | 623 handle->flags |= DMF_LOADED_RAW; |
624 } | 624 } |
625 dmf_reset(handle); | |
625 } | 626 } |
626 } | 627 } |
627 else | 628 else |
628 { | 629 { |
629 if (((handle->flags & DMF_PRELOAD_RES) || (handle->lib->flags & DRF_PRELOAD_RES)) && | |
630 handle->fops->preload != NULL) | |
631 ret = handle->fops->preload(handle); | |
632 else | |
633 if (handle->fops->fopen != NULL) | 630 if (handle->fops->fopen != NULL) |
634 ret = handle->fops->fopen(handle); | 631 ret = handle->fops->fopen(handle); |
635 else | 632 else |
636 return DMERR_FOPEN; | 633 return DMERR_FOPEN; |
637 } | 634 } |
638 | 635 |
639 dmf_reset(handle); | |
640 | 636 |
641 // Check if resource data is to be preloaded | 637 // Check if resource data is to be preloaded |
642 if ((handle->flags & DMF_PRELOAD_RES) || (handle->lib->flags & DRF_PRELOAD_RES)) | 638 if ((handle->flags & DMF_PRELOAD_RES) || (handle->lib->flags & DRF_PRELOAD_RES)) |
643 { | 639 { |
644 if (handle->flags & DMF_LOADED_RES) | 640 if (handle->flags & DMF_LOADED_RES) |
655 | 651 |
656 // Check if we can purge the raw data now | 652 // Check if we can purge the raw data now |
657 if ((handle->flags & DMF_PERSIST) == 0) | 653 if ((handle->flags & DMF_PERSIST) == 0) |
658 dmres_purge_raw_data(handle); | 654 dmres_purge_raw_data(handle); |
659 } | 655 } |
656 | |
657 dmf_reset(handle); | |
660 } | 658 } |
661 } | 659 } |
662 | 660 |
663 dmf_reset(handle); | |
664 return ret; | 661 return ret; |
665 } | 662 } |
666 | 663 |
667 | 664 |
668 DMResource *dmf_open(DMResourceLib *lib, const char *filename) | 665 DMResource *dmf_open(DMResourceLib *lib, const char *filename) |