NewGRF: Elide unmasked vehicle callbacks where possible
This includes: * CBID_VEHICLE_32DAY_CALLBACK * CBID_VEHICLE_REFIT_COST * CBID_VEHICLE_MODIFY_PROPERTY This is on a per-property basis The main benefit of this is to avoid callbacks not handled by the vehicle's current sprite group from using the full graphics chain as the "default" branch in the callback switch. In the case where the graphics chain is long/expensive, a lot of work had to be done before a callback failure result was eventually returned.
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "core/tinystring_type.hpp"
|
||||
#include "newgrf_commons.h"
|
||||
|
||||
#include "3rdparty/cpp-btree/btree_map.h"
|
||||
|
||||
typedef Pool<Engine, EngineID, 64, 64000> EnginePool;
|
||||
extern EnginePool _engine_pool;
|
||||
|
||||
@@ -61,6 +63,10 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> {
|
||||
struct WagonOverride *overrides;
|
||||
uint16 list_position;
|
||||
|
||||
SpriteGroupCallbacksUsed callbacks_used = SGCU_ALL;
|
||||
uint64 cb36_properties_used = UINT64_MAX;
|
||||
btree::btree_map<const SpriteGroup *, uint64> sprite_group_cb36_properties_used;
|
||||
|
||||
Engine();
|
||||
Engine(VehicleType type, EngineID base);
|
||||
~Engine();
|
||||
|
Reference in New Issue
Block a user