diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-05 19:04:06 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-05 19:04:06 +0100 |
commit | 5e61c1280c15ab9969b94cd360cafd4a11b2dd30 (patch) | |
tree | 1fdb60d771c4351b5aa5dcf1a43376c0558625a4 /src/T2DLL/T2TenantDef.cpp | |
parent | c2efba6907fab934a04959b9bb644cf7141cc955 (diff) | |
download | t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip |
matched T2.exe
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2TenantDef.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/T2DLL/T2TenantDef.cpp b/src/T2DLL/T2TenantDef.cpp index 365a0bf..3cde569 100644 --- a/src/T2DLL/T2TenantDef.cpp +++ b/src/T2DLL/T2TenantDef.cpp @@ -57,8 +57,8 @@ T2TenantDef::T2TenantDef(DWORD type, T2PluginSpecifier& specifier, CResFile* res } m180 = 0; - m194 = (m154 == 0); - m198 = 1; + mDrawRoof = (m154 == 0); + mDrawFloor = true; mIsLoaded = true; } @@ -104,17 +104,17 @@ T2TenantDef::T2TenantDef(DWORD type, T2PluginSpecifier& specifier, CResFile* res pattern += mHeight * 100; if (tenant->IsFire()) pattern += 2; - else if (towerDoc->towerDoc_vf160()->IsSnow()) + else if (towerDoc->GetPaletteAnime()->IsSnow()) pattern += 1; } - UT2Coordinate::UnitToQD(tenantRect, towerDoc->towerDoc_vf108(), !includeRoofAndFloor); + UT2Coordinate::UnitToQD(tenantRect, towerDoc->GetZoomLevel(), !includeRoofAndFloor); int objectIndex = mImageObj->FindObject(objID, pattern); if (objectIndex >= 0) { - mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), objectIndex, tenantRect, towerDoc->towerDoc_vf108()); + mImageObj->DrawObject(towerDoc->GetImage(), objectIndex, tenantRect, towerDoc->GetZoomLevel()); } else if (tenant->m58) { - towerDoc->towerDoc_vf10C()->FillRect(tenantRect, 1); + towerDoc->GetImage()->FillRect(tenantRect, 1); } else { CString err; #ifdef _MSC_VER @@ -153,7 +153,7 @@ T2TenantDef::T2TenantDef(DWORD type, T2PluginSpecifier& specifier, CResFile* res if (status == kStatus10) { BuildFinish(towerDoc, theEquip); - towerDoc->mTowerMainView->tmv_vf128(theEquip->mArea, true); + towerDoc->mTowerMainView->InvalUnitRect(theEquip->mArea, true); } } @@ -168,7 +168,7 @@ T2TenantDef::T2TenantDef(DWORD type, T2PluginSpecifier& specifier, CResFile* res } if (theTenant->GetDrawMode() != DrawMode0) - towerDoc->mTowerMainView->tmv_vf128(theTenant->mArea, false); + towerDoc->mTowerMainView->InvalUnitRect(theTenant->mArea, false); return result; } @@ -177,16 +177,20 @@ T2TenantDef::T2TenantDef(DWORD type, T2PluginSpecifier& specifier, CResFile* res return false; } -/*virtual*/ AREACHECKCODE T2TenantDef::AreaCheck(T2TowerDoc* towerDoc, RECT& rect, unsigned int a, BOOL flag) { +/*virtual*/ AREACHECKCODE T2TenantDef::AreaCheck(T2TowerDoc* towerDoc, RECT& rect, unsigned int a, BOOL inShowError) { if (GetCategory() != 100 && rect.top <= towerDoc->mWorldDef->mTopFloorLine) { - if (flag) + if (inShowError) { + // EN: Only Final item can be placed on the top floor of building. towerDoc->towerDoc_vf13C()->BuildErr(68, NULL); + } return AreaCheckCode_0; } if (rect.bottom > towerDoc->mWorldDef->mBottomFloorLine) { - if (flag) + if (inShowError) { + // EN: Can not place items beyond the edges of the floor below. towerDoc->towerDoc_vf13C()->BuildErr(2, NULL); + } return AreaCheckCode_0; } |