diff options
author | Willem Jan Palenstijn | 2009-02-21 14:11:41 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-02-21 14:11:41 +0000 |
commit | 34f90ac043230f049c58aaaf843ac347e0fc5c21 (patch) | |
tree | 36bc91c0e2ff560438f1c8e2f3e7565f82883e79 /engines/sci/scicore/resource.cpp | |
parent | 7ce7993c30225f3c28ce2a8d68935ef03a6e7175 (diff) | |
download | scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.gz scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.bz2 scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.zip |
revert large parts of r38621. error() is for fatal errors and does not return. warning() is not for debugging status messages.
svn-id: r38696
Diffstat (limited to 'engines/sci/scicore/resource.cpp')
-rw-r--r-- | engines/sci/scicore/resource.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp index 0a40d0f6a0..705546f6a4 100644 --- a/engines/sci/scicore/resource.cpp +++ b/engines/sci/scicore/resource.cpp @@ -481,7 +481,7 @@ ResourceManager::ResourceManager(int version, int maxMemory) { free(_resources); _resources = NULL; } - sciprintf("Resmgr: Could not retrieve a resource list"); + sciprintf("Resmgr: Could not retrieve a resource list!\n"); _scir_free_resource_sources(mgr->_sources); error("FIXME: Move this code to an init() method so that we can perform error handling"); // return NULL; @@ -623,8 +623,9 @@ static void _scir_add_to_lru(ResourceManager *mgr, resource_t *res) { mgr->memory_lru += res->size; #if (SCI_VERBOSE_RESMGR > 1) - error("Adding %s.%03d (%d bytes) to lru control: %d bytes total\n", sci_resource_types[res->type], - res->number, res->size, mgr->memory_lru); + fprintf(stderr, "Adding %s.%03d (%d bytes) to lru control: %d bytes total\n", + sci_resource_types[res->type], res->number, res->size, + mgr->memory_lru); #endif @@ -637,22 +638,25 @@ static void _scir_print_lru_list(ResourceManager *mgr) { resource_t *res = mgr->lru_first; while (res) { - error("\t%s.%03d: %d bytes\n", sci_resource_types[res->type], res->number, res->size); + fprintf(stderr, "\t%s.%03d: %d bytes\n", + sci_resource_types[res->type], res->number, + res->size); mem += res->size; ++entries; res = res->next; } - error("Total: %d entries, %d bytes (mgr says %d)\n", entries, mem, mgr->memory_lru); + fprintf(stderr, "Total: %d entries, %d bytes (mgr says %d)\n", + entries, mem, mgr->memory_lru); } static void _scir_free_old_resources(ResourceManager *mgr, int last_invulnerable) { while (mgr->_maxMemory < mgr->memory_lru && (!last_invulnerable || mgr->lru_first != mgr->lru_last)) { resource_t *goner = mgr->lru_last; if (!goner) { - error("Internal error: mgr->lru_last is NULL"); - error("LRU-mem= %d\n", mgr->memory_lru); - error("lru_first = %p\n", (void *)mgr->lru_first); + fprintf(stderr, "Internal error: mgr->lru_last is NULL!\n"); + fprintf(stderr, "LRU-mem= %d\n", mgr->memory_lru); + fprintf(stderr, "lru_first = %p\n", (void *)mgr->lru_first); _scir_print_lru_list(mgr); } @@ -714,9 +718,9 @@ resource_t * scir_find_resource(ResourceManager *mgr, int type, int number, int void scir_unlock_resource(ResourceManager *mgr, resource_t *res, int resnum, int restype) { if (!res) { if (restype >= ARRAYSIZE(sci_resource_types)) - sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d", restype, resnum); + sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d!\n", restype, resnum); else - sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d", sci_resource_types[restype], resnum); + sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d!\n", sci_resource_types[restype], resnum); return; } |