summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-04 23:32:23 +0000
committerrubidium <rubidium@openttd.org>2009-03-04 23:32:23 +0000
commitb9aa5e17f2e4796beea718c797a262eb9008cc25 (patch)
tree6aadaed591e7438c99bc3a02917a8c6e577ee422 /src/vehicle_base.h
parent0860685417b66f474f6dd57e1955788c36170dde (diff)
downloadopenttd-b9aa5e17f2e4796beea718c797a262eb9008cc25.tar.xz
(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.
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index a1ff402da..b4ae0be97 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -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.