core: keep tank infos in a dynamic table

The list of known tank types were kept in a fixed size table.
Instead, use a dynamic table with our horrendous table macros.
This is more flexible and sensible.

While doing this, clean up the TankInfoModel, which was leaking
memory.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-12-11 22:34:35 +01:00 committed by Dirk Hohndel
parent 2e328c7633
commit 50b11024d6
12 changed files with 154 additions and 141 deletions

View file

@ -241,8 +241,8 @@ QStringList getFullCylinderList()
addStringToSortedList(cylinders, get_cylinder(d, j)->type.description);
}
for (int ti = 0; ti < MAX_TANK_INFO; ti++)
addStringToSortedList(cylinders, tank_info[ti].name);
for (int ti = 0; ti < tank_info_table.nr; ti++)
addStringToSortedList(cylinders, tank_info_table.infos[ti].name);
return cylinders;
}