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
commitc0d71b84f983070462a83cc60a17083d5ede4e50 (patch)
tree6aadaed591e7438c99bc3a02917a8c6e577ee422 /src/vehicle_base.h
parent890c5e3ae42bd7d9f904ba6c69f3c4ac3649cdf5 (diff)
downloadopenttd-c0d71b84f983070462a83cc60a17083d5ede4e50.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.