summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-08-07 11:01:31 +0000
committertron <tron@openttd.org>2005-08-07 11:01:31 +0000
commitfd00d317cbeb88948b8d7929252f6bfb2767b531 (patch)
tree0174f0901ffbb32713fa81d0c7063a5efea700c7
parent2c96a3dce955a984f02e01d41bcaa59b5caf65ae (diff)
downloadopenttd-fd00d317cbeb88948b8d7929252f6bfb2767b531.tar.xz
(svn r2829) Remove sprite locking, it was never used anyway
-rw-r--r--spritecache.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/spritecache.c b/spritecache.c
index bc2317564..ee5cd36ac 100644
--- a/spritecache.c
+++ b/spritecache.c
@@ -19,7 +19,6 @@
//#define WANT_SPRITESIZES
#define WANT_NEW_LRU
-//#define WANT_LOCKED
/* These are used in newgrf.c: */
@@ -39,11 +38,6 @@ static void* _sprite_ptr[MAX_SPRITES];
static uint16 _sprite_size[MAX_SPRITES];
static uint32 _sprite_file_pos[MAX_SPRITES];
-// This one is probably not needed.
-#if defined(WANT_LOCKED)
-static bool _sprite_locked[MAX_SPRITES];
-#endif
-
#if defined(WANT_NEW_LRU)
static int16 _sprite_lru_new[MAX_SPRITES];
#else
@@ -271,9 +265,6 @@ static bool LoadNextSprite(int load_index, byte file_index)
#endif
_sprite_ptr[load_index] = NULL;
-#if defined(WANT_LOCKED)
- _sprite_locked[load_index] = false;
-#endif
#if defined(WANT_NEW_LRU)
_sprite_lru_new[load_index] = 0;
@@ -526,13 +517,6 @@ static void CompactSpriteCache(void)
assert(i != endof(_sprite_ptr));
}
- #ifdef WANT_LOCKED
- if (_sprite_locked[i]) {
- s = next;
- continue;
- }
- #endif
-
*i = s->data; // Adjust sprite array entry
// Swap this and the next block
temp = *s;
@@ -562,12 +546,7 @@ static void DeleteEntryFromSpriteCache(void)
#if defined(WANT_NEW_LRU)
cur_lru = 0xffff;
for (i = 0; i != MAX_SPRITES; i++) {
- if (_sprite_ptr[i] != 0 &&
- _sprite_lru_new[i] < cur_lru
-#if defined(WANT_LOCKED)
- && !_sprite_locked[i]
-#endif
- ) {
+ if (_sprite_ptr[i] != NULL && _sprite_lru_new[i] < cur_lru) {
cur_lru = _sprite_lru_new[i];
best = i;
}
@@ -576,12 +555,7 @@ static void DeleteEntryFromSpriteCache(void)
{
uint16 cur_lru = 0, cur_lru_cur = 0xffff;
for (i = 0; i != MAX_SPRITES; i++) {
- if (_sprite_ptr[i] == 0 ||
-#if defined(WANT_LOCKED)
- _sprite_locked[i] ||
-#endif
- _sprite_lru[i] < cur_lru)
- continue;
+ if (_sprite_ptr[i] == NULL || _sprite_lru[i] < cur_lru) continue;
// Found a sprite with a higher LRU value, then remember it.
if (_sprite_lru[i] != cur_lru) {