summaryrefslogtreecommitdiff
path: root/src/spritecache.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-12-08 15:47:23 +0000
committerglx <glx@openttd.org>2007-12-08 15:47:23 +0000
commitb47bce651e64ddeab722f599c0a682281b626c45 (patch)
treea45a623dcb65481ea9d84f6b9645584f075b7849 /src/spritecache.cpp
parent2256d9d378365850ba247e7e02631cf458a4fca2 (diff)
downloadopenttd-b47bce651e64ddeab722f599c0a682281b626c45.tar.xz
(svn r11600) -Cleanup: remove extra out-of-memory checks, since it's now done in *allocT functions.
Diffstat (limited to 'src/spritecache.cpp')
-rw-r--r--src/spritecache.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 90abb0526..fef1d536d 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -53,10 +53,6 @@ static SpriteCache *AllocateSpriteCache(uint index)
_spritecache = ReallocT(_spritecache, items);
- if (_spritecache == NULL) {
- error("Unable to allocate sprite cache of %d items (%d bytes)", items, items * sizeof(*_spritecache));
- }
-
/* Reset the new items and update the count */
memset(_spritecache + _spritecache_items, 0, (items - _spritecache_items) * sizeof(*_spritecache));
_spritecache_items = items;
@@ -411,8 +407,7 @@ static void DeleteEntryFromSpriteCache()
/* Display an error message and die, in case we found no sprite at all.
* This shouldn't really happen, unless all sprites are locked. */
- if (best == (uint)-1)
- error("Out of sprite memory");
+ if (best == (uint)-1) error("Out of sprite memory");
/* Mark the block as free (the block must be in use) */
s = (MemBlock*)GetSpriteCache(best)->ptr - 1;