(svn r15617) -Change [FS#2694]: vehicle variables 40-43 weren't cached (though spec stated they are). Caching these variables can yield a 10+% speed increase when those vehicle variables are queried often.

This commit is contained in:
rubidium
2009-03-04 23:32:23 +00:00
parent 0860685417
commit b9aa5e17f2
4 changed files with 103 additions and 61 deletions

View File

@@ -323,6 +323,12 @@ public:
VehicleShip ship;
} u;
/* cached oftenly queried NewGRF values */
uint8 cache_valid; ///< Whether the caches are valid
uint32 cached_var40; ///< Cache for NewGRF var 40
uint32 cached_var41; ///< Cache for NewGRF var 41
uint32 cached_var42; ///< Cache for NewGRF var 42
uint32 cached_var43; ///< Cache for NewGRF var 43
/**
* Allocates a lot of vehicles.