(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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user