From 5e61c1280c15ab9969b94cd360cafd4a11b2dd30 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 5 Jul 2023 19:04:06 +0100 Subject: matched T2.exe --- src/T2DLL/T2TenantDef.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/T2DLL/T2TenantDef.cpp') 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; } -- cgit v1.2.3