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/T2FireBurning.cpp | |
parent | c2efba6907fab934a04959b9bb644cf7141cc955 (diff) | |
download | t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip |
matched T2.exe
Diffstat (limited to 'src/T2DLL/T2FireBurning.cpp')
-rw-r--r-- | src/T2DLL/T2FireBurning.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/T2DLL/T2FireBurning.cpp b/src/T2DLL/T2FireBurning.cpp index eee04c3..9d76af6 100644 --- a/src/T2DLL/T2FireBurning.cpp +++ b/src/T2DLL/T2FireBurning.cpp @@ -69,13 +69,13 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in { CString text = LoadStringTable(GetWorldModuleHandle(), 8100, 1); DoAlert(inDoc, text, 0); - inDoc->towerDoc_vf270(mHelicopterPrice, kFundGroup2); - inDoc->towerDoc_vf2A8(25); + inDoc->DoPay(mHelicopterPrice, kFundGroup2); + inDoc->SetDrawSpeed(25); Sounds->Play("FIREBURNING:HELI", SoundMask_10, SoundFlags_10 | SoundFlags_10000, NULL, PlayMode_3, 100); break; } case kFireFightFireman: - inDoc->towerDoc_vf2A8(25); + inDoc->SetDrawSpeed(25); break; } @@ -97,7 +97,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in mTimePassed++; IdleEvent(inDoc); - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); if (!mFireArray || mFireArray->GetCount() == 0 || theNow->GetRawMinutes() == mEndTime) mStatus = kFireBurningStatus2; } @@ -115,17 +115,17 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in } /*virtual*/ void T2FireBurning::StartEvent(T2TowerDoc* inTowerDoc, POINT inPt, const T2Tenant* inTenant) { - T2FloorInfo *theFloorInfo = inTowerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inTowerDoc->GetFloorInfo(); mFightAction = kFireFightNull; mFireArray = new LArray; - inTowerDoc->towerDoc_vf144(ViewMode_0); - inTowerDoc->towerDoc_vf2A8(25); + inTowerDoc->SetViewMode(kInView); + inTowerDoc->SetDrawSpeed(25); inTowerDoc->SetFireBurning(true); inTowerDoc->towerDoc_vf1A0(true); inTowerDoc->towerDoc_vf2A0()->EnableIcon(false); - inTowerDoc->GetTowerMainView()->tmv_vf154(); - inTowerDoc->towerDoc_vf1B4(); + inTowerDoc->GetMainView()->HideToolSprite(); + inTowerDoc->BreakoutEmergency(); Sounds->FadeOut(); Sounds->AddSound("FIREBURNING:", SoundPriority_1, 8100, GetWorldModuleHandle()); @@ -134,7 +134,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in Sounds->Play("FIREBURNING:", SoundMask_10, SoundFlags_10 | SoundFlags_10000, NULL, PlayMode_0, 100); CString dialogText; - dialogText.Format("%d", inTowerDoc->towerDoc_vf12C()->UnitToFloor(inPt.y)); + dialogText.Format("%d", inTowerDoc->GetFloorInfo()->UnitToFloor(inPt.y)); dialogText += LoadStringTable(GetWorldModuleHandle(), 8100, 3); DoDialog(inTowerDoc, 8100, 5100, 3, dialogText); @@ -153,13 +153,13 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in MakeFire(inPt, inTowerDoc); // should this be called theView? as per Mac asserts - T2TowerMainView *theTowerMainView = inTowerDoc->GetTowerMainView(); + T2TowerMainView *theTowerMainView = inTowerDoc->GetMainView(); CRect area; inTenant->GetEquipArea(area); - theTowerMainView->tmv_vf15C(area); + theTowerMainView->CenterOnRect(area); - ((T2MainWindow *) AfxGetMainWnd())->mCtrlPalette->vf108(0); + T2_MAIN_WINDOW->mCtrlPalette->vf108(0); Sounds->Play("FIREBURNING:FIRE", SoundMask_10, SoundFlags_10 | SoundFlags_10000, NULL, PlayMode_3, 100); @@ -202,7 +202,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in switch (inResult) { case 8114: - if (inDoc->towerDoc_vf26C() < mHelicopterPrice) { + if (inDoc->GetCurrentFunds() < mHelicopterPrice) { theString = LoadStringTable(GetWorldModuleHandle(), 8100, 5); DoAlert(inDoc, theString, 9000); inResult = 0; @@ -210,7 +210,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in break; case 8115: - theFloorInfo = inDoc->towerDoc_vf12C(); + theFloorInfo = inDoc->GetFloorInfo(); theTenant = theFloorInfo ? theFloorInfo->GetTenantByPID('KEBI') : NULL; if (!theTenant) { theString = LoadStringTable(GetWorldModuleHandle(), 8100, 6); @@ -265,7 +265,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in } /*virtual*/ void T2FireBurning::StopEvent(T2TowerDoc* inDoc) { - T2TowerMainView *theView = inDoc->GetTowerMainView(); + T2TowerMainView *theView = inDoc->GetMainView(); theView->KillTimer(100); if (mFireArray) { @@ -295,7 +295,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in delete mAttach; mAttach = NULL; - theView->tmv_vf124(true); + theView->Invalidate(true); theView->tmv_vf120(); } @@ -328,8 +328,8 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in inDoc->towerDoc_vf1A0(false); inDoc->SetFireBurning(false); - if (inDoc->GetTowerMainView()) - inDoc->GetTowerMainView()->tmv_vf150(); + if (inDoc->GetMainView()) + inDoc->GetMainView()->UnhideToolSprite(); if (inDoc->towerDoc_vf2A0()) inDoc->towerDoc_vf2A0()->EnableIcon(true); } @@ -337,7 +337,7 @@ T2FireBurning::T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, in BOOL T2FireBurning::MakeFire(POINT inPt, T2TowerDoc* inDoc) { BOOL createdFire = false; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2Tenant *theTenant = theFloorInfo->GetTenant(inPt.y, inPt.x); if (theTenant && !theTenant->IsFire() && !theTenant->IsFireproof()) { @@ -426,13 +426,13 @@ BOOL T2FireBurning::DoExtinguish(CPoint& inPt) { } void T2FireBurning::CallFireman(T2TowerDoc* inDoc, const T2Tenant* inTenant) { - T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB(); T2EquipPtrList *theList = theDB->GetList(kTenantRegistID5); if (theList) { LArrayIterator iterator(*theList); unsigned int numFiremen = 0; - unsigned int nowMinutes = inDoc->towerDoc_vf120()->GetRawMinutes(); + unsigned int nowMinutes = inDoc->GetNow()->GetRawMinutes(); T2Tenant *theFireStation; while (numFiremen < 6 && iterator.Next(&theFireStation)) { @@ -453,10 +453,10 @@ void T2FireBurning::CallFireman(T2TowerDoc* inDoc, const T2Tenant* inTenant) { BOOL T2FireBurning::IsBreakoutFire(const T2TowerDoc* inDoc, POINT& outPt, T2Tenant*& outTenant) const { BOOL done = false; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); unsigned int curAttempt = 0; - unsigned int numAttempt = _4 ? 100000 : 100; + unsigned int numAttempt = mForceStart ? 100000 : 100; while (!done && curAttempt < numAttempt) { curAttempt++; @@ -505,7 +505,7 @@ T2Fire::T2Fire(POINT& inPt, T2TowerDoc* inDoc, int inVar, T2ImageObj* inImageObj mFireman = NULL; for (unsigned int h = 0; h < x1C; h++) { - T2Tenant *theTenant = inDoc->towerDoc_vf12C()->GetTenant(inPt.y, inPt.x + h); + T2Tenant *theTenant = inDoc->GetFloorInfo()->GetTenant(inPt.y, inPt.x + h); if (theTenant && !theTenant->IsFireproof() && !theTenant->IsFire()) { if (xC > 0) { if (mArsonTenant != theTenant) @@ -555,7 +555,7 @@ BOOL T2Fire::Move() { p.x = (xC > 0) ? (rect.right + 1) : (rect.left - 1); UT2Coordinate::QDToUnit(p, 0); - T2Tenant *theTenant = mDocument->towerDoc_vf12C()->GetTenant(p.y, p.x); + T2Tenant *theTenant = mDocument->GetFloorInfo()->GetTenant(p.y, p.x); if (theTenant && !theTenant->IsFireproof() && (!theTenant->IsFire() || mArsonTenant == theTenant)) { p.y = rect.top; p.x = rect.left + xC; @@ -567,13 +567,13 @@ BOOL T2Fire::Move() { } } else { x4++; - T2TowerMainView *theView = mDocument->GetTowerMainView(); + T2TowerMainView *theView = mDocument->GetMainView(); if (theView) { CRect unitRect = rect; UT2Coordinate::QDToUnit(unitRect.TopLeft(), 0); UT2Coordinate::QDToUnit(unitRect.BottomRight(), 0); unitRect.right++; - theView->tmv_vf128(unitRect, true); + theView->InvalUnitRect(unitRect, true); } } @@ -718,16 +718,16 @@ T2Helicopter::~T2Helicopter() { } void T2Helicopter::Move(T2TowerDoc* inDoc) { - T2TowerMainView *theMainView = inDoc->GetTowerMainView(); + T2TowerMainView *theMainView = inDoc->GetMainView(); CRect rect; CPoint cursorPt, p; GetCursorPos(&cursorPt); theMainView->ScreenToClient(&cursorPt); - cursorPt += theMainView->m64; + cursorPt += theMainView->mScrollOffset; - UT2Coordinate::QDToUnit(cursorPt, mDocument->towerDoc_vf108()); + UT2Coordinate::QDToUnit(cursorPt, mDocument->GetZoomLevel()); cursorPt.y -= 1; cursorPt.x += 1; UT2Coordinate::UnitToQD(cursorPt, 0, true); |