generally transplanted FA2sp image handling logic, but still WIP

TODO: Fix palette background issue. Fix voxel handling .
This commit is contained in:
Zero Fanker 2024-05-18 21:19:01 -04:00
parent 981059c2b4
commit 800cd951b6
17 changed files with 1058 additions and 1163 deletions

View file

@ -3453,7 +3453,7 @@ void CMapData::UpdateBuildingInfo(const CString* lpUnitType)
CIniFile& ini = GetIniFile();
if (!lpUnitType) {
memset(buildinginfo, 0, 0x0F00 * sizeof(BUILDING_INFO));
memset(buildinginfo, 0, buildingInfoCapacity * sizeof(BUILDING_INFO));
for (auto const& [seq, id] : rules.GetSection("BuildingTypes")) {
auto const& type = id;
@ -3464,7 +3464,7 @@ void CMapData::UpdateBuildingInfo(const CString* lpUnitType)
int n = Map->GetUnitTypeID(type);
if (n >= 0 && n < 0x0F00) {
if (n >= 0 && n < buildingInfoCapacity) {
buildinginfo[n].w = foundation.Width;
buildinginfo[n].h = foundation.Height;
@ -3525,7 +3525,7 @@ void CMapData::UpdateBuildingInfo(const CString* lpUnitType)
int n = Map->GetUnitTypeID(type);
if (n >= 0 && n < 0x0F00) {
if (n >= 0 && n < buildingInfoCapacity) {
buildinginfo[n].w = foundation.Width;
buildinginfo[n].h = foundation.Height;
buildinginfo[n].bSnow = TRUE;
@ -3560,7 +3560,7 @@ void CMapData::UpdateBuildingInfo(const CString* lpUnitType)
int n = Map->GetUnitTypeID(type);
if (n >= 0 && n < 0x0F00) {
if (n >= 0 && n < buildingInfoCapacity) {
buildinginfo[n].w = foundation.Width;
buildinginfo[n].h = foundation.Height;
CString lpPicFile = GetUnitPictureFilename(type, 0);