summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-23 16:39:55 +0000
committerrubidium <rubidium@openttd.org>2009-05-23 16:39:55 +0000
commit9f51f3a0f9c103b738af06eb77d08d6786faa9e9 (patch)
tree8f7593fbeb178cf46230ba6bd6d6c77779c00439 /src
parentb2aed51f8e42e0e45d08a65b8883b3fa034d0f4b (diff)
downloadopenttd-9f51f3a0f9c103b738af06eb77d08d6786faa9e9.tar.xz
(svn r16404) -Fix [FS#2911] (r16378): the number of spritegroups got halved when the new pool was added, which mean there weren't enough spritegroups when you have more than about a dozen ECS vectors.
-Change: increase the spritegroup pool's maximum size to something more than the number of real sprites that OpenTTD can handle; for example ECS has about 30 spritegroups per real sprite. With the 'old' limit that would mean 'only' about 4000 real sprites worth of spritegroups could be loaded.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_spritegroup.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h
index e6bbeb9d3..bb5683518 100644
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -43,7 +43,11 @@ enum SpriteGroupType {
struct SpriteGroup;
typedef uint32 SpriteGroupID;
-typedef Pool<SpriteGroup, SpriteGroupID, 512, 64000> SpriteGroupPool;
+
+/* SPRITE_WIDTH is 24. ECS has roughly 30 sprite groups per real sprite.
+ * Adding an 'extra' margin would be assuming 64 sprite groups per real
+ * sprite. 64 = 2^6, so 2^30 should be enough (for now) */
+typedef Pool<SpriteGroup, SpriteGroupID, 1024, 1 << 30> SpriteGroupPool;
extern SpriteGroupPool _spritegroup_pool;
/* Common wrapper for all the different sprite group types */