Feature: NewGRF callback profiling (#7868)
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
This commit is contained in:

committed by
GitHub

parent
f88ac83408
commit
c8779fb311
@@ -66,6 +66,11 @@
|
||||
/** List of all loaded GRF files */
|
||||
static std::vector<GRFFile *> _grf_files;
|
||||
|
||||
const std::vector<GRFFile *> &GetAllGRFFiles()
|
||||
{
|
||||
return _grf_files;
|
||||
}
|
||||
|
||||
/** Miscellaneous GRF features, set by Action 0x0D, parameter 0x9E */
|
||||
byte _misc_grf_features = 0;
|
||||
|
||||
@@ -5000,6 +5005,7 @@ static void NewSpriteGroup(ByteReader *buf)
|
||||
|
||||
assert(DeterministicSpriteGroup::CanAllocateItem());
|
||||
DeterministicSpriteGroup *group = new DeterministicSpriteGroup();
|
||||
group->nfo_line = _cur.nfo_line;
|
||||
act_group = group;
|
||||
group->var_scope = HasBit(type, 1) ? VSG_SCOPE_PARENT : VSG_SCOPE_SELF;
|
||||
|
||||
@@ -5116,6 +5122,7 @@ static void NewSpriteGroup(ByteReader *buf)
|
||||
{
|
||||
assert(RandomizedSpriteGroup::CanAllocateItem());
|
||||
RandomizedSpriteGroup *group = new RandomizedSpriteGroup();
|
||||
group->nfo_line = _cur.nfo_line;
|
||||
act_group = group;
|
||||
group->var_scope = HasBit(type, 1) ? VSG_SCOPE_PARENT : VSG_SCOPE_SELF;
|
||||
|
||||
@@ -5164,6 +5171,7 @@ static void NewSpriteGroup(ByteReader *buf)
|
||||
|
||||
assert(RealSpriteGroup::CanAllocateItem());
|
||||
RealSpriteGroup *group = new RealSpriteGroup();
|
||||
group->nfo_line = _cur.nfo_line;
|
||||
act_group = group;
|
||||
|
||||
group->num_loaded = num_loaded;
|
||||
@@ -5197,6 +5205,7 @@ static void NewSpriteGroup(ByteReader *buf)
|
||||
|
||||
assert(TileLayoutSpriteGroup::CanAllocateItem());
|
||||
TileLayoutSpriteGroup *group = new TileLayoutSpriteGroup();
|
||||
group->nfo_line = _cur.nfo_line;
|
||||
act_group = group;
|
||||
|
||||
/* On error, bail out immediately. Temporary GRF data was already freed */
|
||||
@@ -5212,6 +5221,7 @@ static void NewSpriteGroup(ByteReader *buf)
|
||||
|
||||
assert(IndustryProductionSpriteGroup::CanAllocateItem());
|
||||
IndustryProductionSpriteGroup *group = new IndustryProductionSpriteGroup();
|
||||
group->nfo_line = _cur.nfo_line;
|
||||
act_group = group;
|
||||
group->version = type;
|
||||
if (type == 0) {
|
||||
|
Reference in New Issue
Block a user