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 | |
parent | c2efba6907fab934a04959b9bb644cf7141cc955 (diff) | |
download | t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip |
matched T2.exe
Diffstat (limited to 'src/T2DLL')
97 files changed, 623 insertions, 570 deletions
diff --git a/src/T2DLL/CLink.h b/src/T2DLL/CLink.h index 6edfdca..ed7304a 100644 --- a/src/T2DLL/CLink.h +++ b/src/T2DLL/CLink.h @@ -21,6 +21,7 @@ protected: CLink *mPrev; friend class CLinkIterator; + friend class DbgPeopleView; friend class T2PeopleLinkIterator; }; diff --git a/src/T2DLL/CPluginInfo.h b/src/T2DLL/CPluginInfo.h index 71fa3c7..cec185d 100644 --- a/src/T2DLL/CPluginInfo.h +++ b/src/T2DLL/CPluginInfo.h @@ -28,4 +28,6 @@ protected: CString mName; CString mFileName; BOOL mUsed; + + friend class T2TowerDoc; }; diff --git a/src/T2DLL/GlobalFunc.cpp b/src/T2DLL/GlobalFunc.cpp index a5f6f6f..71139b0 100644 --- a/src/T2DLL/GlobalFunc.cpp +++ b/src/T2DLL/GlobalFunc.cpp @@ -56,7 +56,7 @@ HBITMAP Create256DIBitmap(HDC inDC, int inWidth, int inHeight) { if (GetDeviceCaps(inDC, BITSPIXEL) == 8) { theBitmap = CreateBitmap(inWidth, inHeight, 1, 8, NULL); } else { - Bitmap *bitmap = (Bitmap *) malloc(sizeof(Bitmap)); + Bitmap256 *bitmap = (Bitmap256 *) malloc(sizeof(Bitmap256)); memset(&bitmap->header, 0, sizeof(BITMAPINFOHEADER)); bitmap->header.biSize = sizeof(BITMAPINFOHEADER); @@ -192,7 +192,7 @@ T2TowerDoc *GetCurrentT2TowerDoc() { } HINSTANCE GetWorldModuleHandle() { - return GetCurrentT2TowerDoc()->towerDoc_vf170()->mModuleHandle; + return GetCurrentT2TowerDoc()->GetWorldDef()->mModuleHandle; } CString GetModuleName(HINSTANCE inModule) { diff --git a/src/T2DLL/MoverSearchDlg.cpp b/src/T2DLL/MoverSearchDlg.cpp index 48dfc31..f4733fc 100644 --- a/src/T2DLL/MoverSearchDlg.cpp +++ b/src/T2DLL/MoverSearchDlg.cpp @@ -42,7 +42,7 @@ void MoverSearchDlg::DoFind() { return; T2Name *theName = (T2Name *) listBox->GetItemDataPtr(sel); - mDocument->towerDoc_vf238(theName); + mDocument->DoFind(theName); } void MoverSearchDlg::DoDelete() { diff --git a/src/T2DLL/PeopleSearchDlg.cpp b/src/T2DLL/PeopleSearchDlg.cpp index d7f5277..deed18a 100644 --- a/src/T2DLL/PeopleSearchDlg.cpp +++ b/src/T2DLL/PeopleSearchDlg.cpp @@ -45,7 +45,7 @@ void PeopleSearchDlg::DoFind() { return; T2Name *theName = (T2Name *) listBox->GetItemDataPtr(sel); - mDocument->towerDoc_vf238(theName); + mDocument->DoFind(theName); } void PeopleSearchDlg::DoDelete() { diff --git a/src/T2DLL/SoundDlg.cpp b/src/T2DLL/SoundDlg.cpp index 705bd70..0bc2236 100644 --- a/src/T2DLL/SoundDlg.cpp +++ b/src/T2DLL/SoundDlg.cpp @@ -1,5 +1,5 @@ #include "SoundDlg.h" -#include "CT2App.h" +#include "T2.h" #include "T2DlgItem.h" #include "T2DlgItemText.h" #include "T2MainWindow.h" @@ -57,7 +57,7 @@ static unsigned int masks[4] = { }; void SoundDlg::Save() { - T2SoundPlayer *theSoundPlayer = mDocument->towerDoc_vf134(); + T2SoundPlayer *theSoundPlayer = mDocument->GetSoundPlayer(); T2DlgItem *theCheck = GetT2DlgItem(100); if (theCheck->GetValue()) @@ -78,7 +78,7 @@ void SoundDlg::Save() { /*virtual*/ void SoundDlg::OnT2Create() { T2DlgItem *theCheck, *theICheck; - T2SoundPlayer *theSoundPlayer = mDocument->towerDoc_vf134(); + T2SoundPlayer *theSoundPlayer = mDocument->GetSoundPlayer(); theCheck = GetT2DlgItem(100); if (theSoundPlayer->IsSoundOn()) { diff --git a/src/T2DLL/SpeedDlg.cpp b/src/T2DLL/SpeedDlg.cpp index 37d5441..281bb36 100644 --- a/src/T2DLL/SpeedDlg.cpp +++ b/src/T2DLL/SpeedDlg.cpp @@ -1,5 +1,5 @@ #include "SpeedDlg.h" -#include "CT2App.h" +#include "T2.h" #include "T2DlgItem.h" #include "T2MainWindow.h" #include "T2MWControl.h" @@ -21,7 +21,7 @@ SpeedDlg::SpeedDlg() { void SpeedDlg::Setup(T2TowerDoc *inDoc, HINSTANCE inInstance, CWnd *inParentWnd, const POINT &inPt, T2ImageObj *inImageObj) { mDocument = inDoc; - mCurrentSpeed = mDocument->towerDoc_vf2A4(); + mCurrentSpeed = mDocument->GetDrawSpeed(); T2DLGTEMPLATE tmpl; tmpl.resID = 7010; @@ -50,7 +50,7 @@ void SpeedDlg::Revert() { } void SpeedDlg::Save() { - mDocument->towerDoc_vf2A8(mCurrentSpeed); + mDocument->SetDrawSpeed(mCurrentSpeed); } /*virtual*/ void SpeedDlg::OnT2Create() { diff --git a/src/T2DLL/T2Animation.cpp b/src/T2DLL/T2Animation.cpp index 9031777..1a3208d 100644 --- a/src/T2DLL/T2Animation.cpp +++ b/src/T2DLL/T2Animation.cpp @@ -112,7 +112,7 @@ void T2Animation::Play(POINT inPt, int inLen) { while (playing) { playing = Step(); - mDocument->GetTowerMainView()->tmv_vf120(); + mDocument->GetMainView()->tmv_vf120(); int now; for (now = GetTickCount(); now < endTick; now = GetTickCount()) { diff --git a/src/T2DLL/T2ArrowWnd.cpp b/src/T2DLL/T2ArrowWnd.cpp index 6c60c08..da7466e 100644 --- a/src/T2DLL/T2ArrowWnd.cpp +++ b/src/T2DLL/T2ArrowWnd.cpp @@ -32,7 +32,7 @@ void T2ArrowWnd::Show(int inX, int inY, T2TowerDoc* inDoc) { mWndClass = AfxRegisterWndClass(CS_NOCLOSE, NULL, (HBRUSH) GetStockObject(WHITE_BRUSH)); CRect rect(0, 0, 50, 50); - Create(mWndClass, "ArrowWnd", WS_CHILD, rect, inDoc->GetTowerMainView(), NULL, WS_EX_TOPMOST); + Create(mWndClass, "ArrowWnd", WS_CHILD, rect, inDoc->GetMainView(), NULL, WS_EX_TOPMOST); mRgn.CreatePolygonRgn(rgnPoints, 7, ALTERNATE); diff --git a/src/T2DLL/T2Balloon.cpp b/src/T2DLL/T2Balloon.cpp index 2fe2ef0..34ab19f 100644 --- a/src/T2DLL/T2Balloon.cpp +++ b/src/T2DLL/T2Balloon.cpp @@ -63,7 +63,7 @@ void T2Balloon::Show(int inX, int inY, const CString& inText, BOOL inDoPause) { rect1.OffsetRect(rect2.left, rect2.top); CRect rect4; - GetCurrentT2TowerDoc()->GetTowerMainView()->tmv_vf140(rect4); + GetCurrentT2TowerDoc()->GetMainView()->GetVisibleUnitRect(rect4); UT2Coordinate::UnitToQD(rect4, 0); CRect rect5; @@ -200,7 +200,7 @@ void T2Balloon::Show(int inX, int inY, const CString& inText, BOOL inDoPause) { mImage = new T2BitImage(rect8); mImage->Clear(0); - CPalette *thePalette = GetCurrentT2TowerDoc()->towerDoc_vf170()->GetPalette(); + CPalette *thePalette = GetCurrentT2TowerDoc()->GetWorldDef()->GetPalette(); dc.SelectPalette(thePalette, false); dc.RealizePalette(); diff --git a/src/T2DLL/T2BitImage.h b/src/T2DLL/T2BitImage.h index 11e143d..838e909 100644 --- a/src/T2DLL/T2BitImage.h +++ b/src/T2DLL/T2BitImage.h @@ -2,7 +2,7 @@ #include "common.h" // unknown name -struct Bitmap { +struct Bitmap256 { BITMAPINFOHEADER header; short palette[256]; }; @@ -35,7 +35,7 @@ public: int GetParam() { return mParam; } void SetParam(int v) { mParam = v; } - Bitmap mBitmap; + Bitmap256 mBitmap; unsigned char *mData; POINT mOrigin; HGLOBAL mMemHandle; diff --git a/src/T2DLL/T2BlackOut.cpp b/src/T2DLL/T2BlackOut.cpp index c3b69a8..25868ea 100644 --- a/src/T2DLL/T2BlackOut.cpp +++ b/src/T2DLL/T2BlackOut.cpp @@ -38,7 +38,7 @@ static int anims[] = {2, 8400, 8401}; if (mConsumptionPower > mSupplyPower) { mStatus = kBlackOutStatus1; - T2TowerMainView *theView = inDoc->GetTowerMainView(); + T2TowerMainView *theView = inDoc->GetMainView(); if (theView) { inDoc->towerDoc_vf284(); @@ -82,7 +82,7 @@ static int anims[] = {2, 8400, 8401}; /*virtual*/ int T2BlackOut::Exec(T2TowerDoc* inDoc) { int resultCode = IsExclusive() ? 1 : 0; - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); unsigned int theNowMinutes = theNow->GetRawMinutes(); T2TowerMainView *theMainView; T2TowerMessage *theTowerMsg; @@ -116,7 +116,7 @@ static int anims[] = {2, 8400, 8401}; case kBlackOutStatus4: mStatus = kBlackOutStatus0; - theMainView = inDoc->GetTowerMainView(); + theMainView = inDoc->GetMainView(); if (theMainView) { inDoc->towerDoc_vf284(); if (mAttach) { @@ -152,7 +152,7 @@ void T2BlackOut::AddConsumptionPower(int inPower) { // "変圧器を増設" - Add a transformer text += "\x95\xCF\x88\xB3\x8A\xED\x82\xF0\x91\x9D\x90\xDD"; } else { - CFilePlugin *plugin = theDoc->mTenantPluginsListOther->GetItem('HEND'); + CFilePlugin *plugin = theDoc->mTenantPlugins->GetItem('HEND'); if (plugin) { // "変電室を設置" - Install substation room text += "\x95\xCF\x93\x64\x8E\xBA\x82\xF0\x90\xDD\x92\x75"; @@ -245,15 +245,15 @@ T2BlackOutAttach::~T2BlackOutAttach() { void T2BlackOutAttach::ExecuteSelf(unsigned int inMessage, void *ioData) { BOOL newExecuteHost = true; - if (inMessage == 0x201) { - int sel = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetSel(); - CString *theToolName = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconName(sel); - T2TemplatePlugin *theDef = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconPlugin(sel); + if (inMessage == WM_LBUTTONDOWN) { + int sel = T2_MAIN_WINDOW->mToolWindow->GetSel(); + CString *theToolName = T2_MAIN_WINDOW->mToolWindow->GetIconName(sel); + T2TemplatePlugin *theDef = T2_MAIN_WINDOW->mToolWindow->GetIconPlugin(sel); CProgramPlugin *thePlugin = theDef->GetPlugin(); - unsigned int theValiation = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconValiation(sel); - DWORD theOption = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconOption(sel); + unsigned int theValiation = T2_MAIN_WINDOW->mToolWindow->GetIconValiation(sel); + DWORD theOption = T2_MAIN_WINDOW->mToolWindow->GetIconOption(sel); - if (theOption == 0) + if (theOption == kToolOption0) newExecuteHost = true; else newExecuteHost = (thePlugin && thePlugin->GetID() == 'HEND'); diff --git a/src/T2DLL/T2ColdTableDef.cpp b/src/T2DLL/T2ColdTableDef.cpp index 3af5ca7..f112a5c 100644 --- a/src/T2DLL/T2ColdTableDef.cpp +++ b/src/T2DLL/T2ColdTableDef.cpp @@ -2,7 +2,7 @@ #include "T2ColdTableDef.h" T2ColdTableDef::T2ColdTableDef(CResFile &inResFile) { - inResFile >> mVar; + inResFile >> mMinimumGameLevel; for (unsigned int i = 0; i < 12; i++) inResFile >> mEntries[i]; } @@ -10,11 +10,11 @@ T2ColdTableDef::T2ColdTableDef(CResFile &inResFile) { /*virtual*/ T2ColdTableDef::~T2ColdTableDef() { } -unsigned int T2ColdTableDef::GetDenomi(unsigned int inA, unsigned int inB) const { +unsigned int T2ColdTableDef::GetDenomi(unsigned int inGameLevel, unsigned int inMonth) const { unsigned int result = 0; - if (inA >= mVar && inB < 12) - result = mEntries[inB]; + if (inGameLevel >= mMinimumGameLevel && inMonth < 12) + result = mEntries[inMonth]; return result; } diff --git a/src/T2DLL/T2ColdTableDef.h b/src/T2DLL/T2ColdTableDef.h index 087402a..54162bb 100644 --- a/src/T2DLL/T2ColdTableDef.h +++ b/src/T2DLL/T2ColdTableDef.h @@ -5,9 +5,9 @@ class T2ColdTableDef { public: T2ColdTableDef(CResFile &inResFile); virtual ~T2ColdTableDef(); - unsigned int GetDenomi(unsigned int inA, unsigned int inB) const; + unsigned int GetDenomi(unsigned int inGameLevel, unsigned int inMonth) const; protected: - unsigned int mVar; + unsigned int mMinimumGameLevel; unsigned int mEntries[12]; }; diff --git a/src/T2DLL/T2DLL.cpp b/src/T2DLL/T2DLL.cpp index 9e270be..48cb3a7 100644 --- a/src/T2DLL/T2DLL.cpp +++ b/src/T2DLL/T2DLL.cpp @@ -18,14 +18,14 @@ END_MESSAGE_MAP() T2DLLApp::T2DLLApp() { } -T2DLLApp theApp; -T2SoundPlayer *Sounds; -CT2App *gT2App; -int gCommonColor[20]; -BOOL FFEnable = 0; -DWORD FFBaseForce = 0; -IDirectInput *FFgpdi = NULL; -IDirectInputDevice2 *FFJoystick = NULL; -IDirectInputEffect *FFBuild = NULL; -IDirectInputEffect *FFStatic = NULL; -T2TowerDoc *g_TowerDoc = NULL; +AFX_DATA_EXPORT T2DLLApp theApp; +AFX_DATA_EXPORT T2SoundPlayer *Sounds; +AFX_DATA_EXPORT CT2App *gT2App; +AFX_DATA_EXPORT int gCommonColor[20]; +AFX_DATA_EXPORT BOOL FFEnable = 0; +AFX_DATA_EXPORT DWORD FFBaseForce = 0; +AFX_DATA_EXPORT IDirectInput *FFgpdi = NULL; +AFX_DATA_EXPORT IDirectInputDevice2 *FFJoystick = NULL; +AFX_DATA_EXPORT IDirectInputEffect *FFBuild = NULL; +AFX_DATA_EXPORT IDirectInputEffect *FFStatic = NULL; +AFX_DATA_EXPORT T2TowerDoc *g_TowerDoc = NULL; diff --git a/src/T2DLL/T2DLL.h b/src/T2DLL/T2DLL.h index c88e1c7..e72bef2 100644 --- a/src/T2DLL/T2DLL.h +++ b/src/T2DLL/T2DLL.h @@ -8,13 +8,13 @@ public: DECLARE_MESSAGE_MAP() }; -extern AFX_DATA_EXPORT T2SoundPlayer *Sounds; -extern AFX_DATA_EXPORT CT2App *gT2App; -extern AFX_DATA_EXPORT int gCommonColor[20]; -extern AFX_DATA_EXPORT BOOL FFEnable; -extern AFX_DATA_EXPORT DWORD FFBaseForce; -extern AFX_DATA_EXPORT IDirectInput *FFgpdi; -extern AFX_DATA_EXPORT IDirectInputDevice2 *FFJoystick; -extern AFX_DATA_EXPORT IDirectInputEffect *FFBuild; -extern AFX_DATA_EXPORT IDirectInputEffect *FFStatic; -extern AFX_DATA_EXPORT T2TowerDoc *g_TowerDoc; +extern AFX_EXT_DATA T2SoundPlayer *Sounds; +extern AFX_EXT_DATA CT2App *gT2App; +extern AFX_EXT_DATA int gCommonColor[20]; +extern AFX_EXT_DATA BOOL FFEnable; +extern AFX_EXT_DATA DWORD FFBaseForce; +extern AFX_EXT_DATA IDirectInput *FFgpdi; +extern AFX_EXT_DATA IDirectInputDevice2 *FFJoystick; +extern AFX_EXT_DATA IDirectInputEffect *FFBuild; +extern AFX_EXT_DATA IDirectInputEffect *FFStatic; +extern AFX_EXT_DATA T2TowerDoc *g_TowerDoc; diff --git a/src/T2DLL/T2Dialog.cpp b/src/T2DLL/T2Dialog.cpp index d240f07..4823c7d 100644 --- a/src/T2DLL/T2Dialog.cpp +++ b/src/T2DLL/T2Dialog.cpp @@ -135,9 +135,9 @@ int T2Dialog::OnCreate(CREATESTRUCT* cs) { if (mTowerDoc && !(GetWindowLong(m_hWnd, GWL_STYLE) & WS_CHILD)) { if (mModal != 0) - mTowerDoc->towerDoc_vf1A0(1); + mTowerDoc->towerDoc_vf1A0(true); if (mModal == 1) - mTowerDoc->towerDoc_vf290(1); + mTowerDoc->towerDoc_vf290(true); } if (mAutoShow && !(cs->style & WS_CHILD)) @@ -717,9 +717,9 @@ void T2Dialog::OnDestroy() { if (mTowerDoc && !(GetWindowLong(m_hWnd, GWL_STYLE) & WS_CHILD)) { if (mModal != 0) - mTowerDoc->towerDoc_vf1A0(0); + mTowerDoc->towerDoc_vf1A0(false); if (mModal == 1) - mTowerDoc->towerDoc_vf290(0); + mTowerDoc->towerDoc_vf290(false); } } diff --git a/src/T2DLL/T2ElevatorModule.cpp b/src/T2DLL/T2ElevatorModule.cpp index 5fa8438..5835aad 100644 --- a/src/T2DLL/T2ElevatorModule.cpp +++ b/src/T2DLL/T2ElevatorModule.cpp @@ -112,15 +112,15 @@ BOOL T2ElevatorModule::IsPtInArea(POINT pt, const RECT& area) const { if (position == mHomePosition) { flag = !HomePosRemoved(mover, position); - if (!flag && !towerDoc->towerDoc_vf16C() && mover->IsShaftVisible()) { + if (!flag && !towerDoc->GetElevTransparent() && mover->IsShaftVisible()) { RECT area; CalcUintArea(mover, mHomePosition, area); - T2TowerMainView *theView = towerDoc->GetTowerMainView(); + T2TowerMainView *theView = towerDoc->GetMainView(); #line 142 ASSERT(theView != NULL); - theView->tmv_vf128(area); + theView->InvalUnitRect(area); } } @@ -135,7 +135,7 @@ BOOL T2ElevatorModule::IsPtInArea(POINT pt, const RECT& area) const { } void T2ElevatorModule::Remove(T2TowerDoc* towerDoc, T2Mover* mover) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); T2People *theRemovePeople = NULL; BOOL isDown = true; T2Request *theRequest; @@ -174,7 +174,7 @@ void T2ElevatorModule::RemoveContents(T2TowerDoc* towerDoc, T2Mover* mover, int if (mLink1) { POINT theStopPos = mover->PositionToStopPt(position, ERequestUpDown_0); - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); #line 221 ASSERT(theFloorInfo != NULL); @@ -204,11 +204,11 @@ void T2ElevatorModule::RemoveContents(T2TowerDoc* towerDoc, T2Mover* mover, int RECT theRect; CalcUintArea(mover, theRect); - T2TowerMainView *theView = towerDoc->GetTowerMainView(); + T2TowerMainView *theView = towerDoc->GetMainView(); #line 251 ASSERT(theView != NULL); - theView->tmv_vf128(theRect); + theView->InvalUnitRect(theRect); } } } diff --git a/src/T2DLL/T2ElvModuleList.cpp b/src/T2DLL/T2ElvModuleList.cpp index 4fc835b..0ed388f 100644 --- a/src/T2DLL/T2ElvModuleList.cpp +++ b/src/T2DLL/T2ElvModuleList.cpp @@ -65,7 +65,7 @@ void T2ElvModuleList::CalcBaseQDRect(RECT& outRect) { int T2ElvModuleList::DestructModule(T2TowerDoc* towerDoc, T2Mover* mover, POINT inPt) { RECT theBaseQDRect; int theModuleIndex = -1; - int theZoomLevel = towerDoc->towerDoc_vf108(); + int theZoomLevel = towerDoc->GetZoomLevel(); POINT pt = inPt; CalcBaseQDRect(theBaseQDRect); diff --git a/src/T2DLL/T2Equip.cpp b/src/T2DLL/T2Equip.cpp index d42cf4e..f2221d2 100644 --- a/src/T2DLL/T2Equip.cpp +++ b/src/T2DLL/T2Equip.cpp @@ -44,7 +44,7 @@ int T2Equip::InitEquip(T2EquipDef* def, const RECT& area, unsigned int valiation T2TowerDoc *towerDoc = GetCurrentT2TowerDoc(); if (towerDoc) - mBuildDay = towerDoc->towerDoc_vf120()->CalcTotalDays(); + mBuildDay = towerDoc->GetNow()->CalcTotalDays(); else mBuildDay = 0; @@ -63,7 +63,7 @@ int T2Equip::InitEquip(T2EquipDef* def, const RECT& area, unsigned int valiation } int T2Equip::DaysSinceBuilt(const T2TowerDoc* towerDoc) const { - return towerDoc->towerDoc_vf120()->CalcLapseDays(mBuildDay); + return towerDoc->GetNow()->CalcLapseDays(mBuildDay); } void T2Equip::SetEquipArea(const RECT& rect) { @@ -182,9 +182,9 @@ void T2Equip::ReplaceCEID(unsigned int oldID, unsigned int newID) { } /*virtual*/ void T2Equip::PlaySound(T2TowerDoc* inDoc, int id, unsigned int inMask, unsigned int inFlags) const { - if (inDoc->towerDoc_vf15C(mArea)) { + if (inDoc->IsRectInView(mArea)) { T2EquipDef *equipDef = GetEquipDef(); - T2SoundPlayer *soundPlayer = inDoc->towerDoc_vf134(); + T2SoundPlayer *soundPlayer = inDoc->GetSoundPlayer(); if (equipDef && soundPlayer) { CRect theArea; GetEquipArea(theArea); diff --git a/src/T2DLL/T2EquipDef.cpp b/src/T2DLL/T2EquipDef.cpp index 6084b5c..2888811 100644 --- a/src/T2DLL/T2EquipDef.cpp +++ b/src/T2DLL/T2EquipDef.cpp @@ -101,7 +101,7 @@ T2EquipDef::T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFi return -1; } -/*virtual*/ AREACHECKCODE T2EquipDef::AreaCheck(T2TowerDoc*, RECT&, unsigned int, int) { +/*virtual*/ AREACHECKCODE T2EquipDef::AreaCheck(T2TowerDoc* inDoc, RECT& inRect, unsigned int, BOOL inShowError) { return AreaCheckCode_0; } @@ -114,7 +114,7 @@ T2EquipDef::T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFi } /*virtual*/ void T2EquipDef::BuildFinish(T2TowerDoc* towerDoc, T2Equip* equip) { - towerDoc->towerDoc_vf170()->CalcOptionObj(towerDoc, equip); + towerDoc->GetWorldDef()->CalcOptionObj(towerDoc, equip); } /*virtual*/ unsigned long T2EquipDef::OptionProc(T2TowerDoc*, T2Equip*, void*) { @@ -124,8 +124,8 @@ T2EquipDef::T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFi /*virtual*/ void T2EquipDef::DebugInfo(CWnd&, CListCtrl&, T2Equip*) { } -/*virtual*/ int T2EquipDef::FingerToolProc(T2TowerDoc*, T2Equip*, const POINT&, MOUSEEVENT) { - return 0; +/*virtual*/ BOOL T2EquipDef::FingerToolProc(T2TowerDoc*, T2Equip*, const POINT&, MOUSEEVENT) { + return false; } /*virtual*/ T2InfoDialog* T2EquipDef::ShowInfoDialog(T2TowerDoc* towerDoc, T2Equip* equip) { diff --git a/src/T2DLL/T2EquipDef.h b/src/T2DLL/T2EquipDef.h index fe6fe3e..8b5b780 100644 --- a/src/T2DLL/T2EquipDef.h +++ b/src/T2DLL/T2EquipDef.h @@ -17,14 +17,14 @@ public: virtual void LoadExtraData(T2Archive& inArchive, T2TowerDoc*, T2HaveOutViewObject*); virtual void SaveExtraData(T2Archive& inArchive, T2HaveOutViewObject*); - virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT&, unsigned int, int); + virtual AREACHECKCODE AreaCheck(T2TowerDoc* inDoc, RECT& inRect, unsigned int, BOOL inShowError); virtual int ClickProc(T2TowerDoc*, RECT*, unsigned int&); virtual int GetDestructPartProc(int, POINT, POINT, T2Equip*); virtual PARTCODE GetPartFromPoint(T2TowerDoc*, T2Equip*, POINT, int*); virtual PROCCODE DoBuildProc(T2TowerDoc*, RECT&, unsigned int) { return ProcCode_0; } - virtual int FingerToolProc(T2TowerDoc*, T2Equip*, const POINT&, MOUSEEVENT); + virtual BOOL FingerToolProc(T2TowerDoc*, T2Equip*, const POINT&, MOUSEEVENT); virtual void BuildFinish(T2TowerDoc*, T2Equip*); virtual unsigned long OptionProc(T2TowerDoc*, T2Equip*, void*); virtual void DrawPeople(T2TowerDoc* inDoc, T2Equip* inEquip); diff --git a/src/T2DLL/T2EventItem.cpp b/src/T2DLL/T2EventItem.cpp index 302752f..bcd6f52 100644 --- a/src/T2DLL/T2EventItem.cpp +++ b/src/T2DLL/T2EventItem.cpp @@ -27,7 +27,7 @@ T2EventItem::T2EventItem(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in *inResFile >> mEndTime; mOriginalDef = this; - _4 = 0; + mForceStart = false; } T2EventItem::T2EventItem(T2TowerEvent* inTowerEvent, int inSubID, int inLevelBit, BOOL inExclusive, int inCycleDay, int inBeginTime, int inEndTime) { @@ -41,7 +41,7 @@ T2EventItem::T2EventItem(T2TowerEvent* inTowerEvent, int inSubID, int inLevelBit mStatus = 0; mOriginalDef = NULL; - _4 = 0; + mForceStart = false; } T2EventItem::T2EventItem(T2EventItem* inItem, int inSubID) { @@ -56,7 +56,7 @@ T2EventItem::T2EventItem(T2EventItem* inItem, int inSubID) { mStatus = 0; mOriginalDef = inItem; - _4 = 0; + mForceStart = false; } /*virtual*/ T2EventItem::~T2EventItem() { @@ -134,7 +134,7 @@ T2EventItem* T2EventItem::GetOriginalDef() { /*virtual*/ unsigned int T2EventItem::DoDialog(T2TowerDoc* inDoc, int inDlgResID, int inAnimResID, int inAnimUnk, const char* inText) { T2WorldDef *theWorldDef = GetWorldDef(); - inDoc->GetTowerMainView()->tmv_vf154(); + inDoc->GetMainView()->HideToolSprite(); inDoc->towerDoc_vf290(true); unsigned int result = 0; @@ -160,13 +160,13 @@ T2EventItem* T2EventItem::GetOriginalDef() { } inDoc->towerDoc_vf290(false); - inDoc->GetTowerMainView()->tmv_vf150(); + inDoc->GetMainView()->UnhideToolSprite(); return result; } /*virtual*/ void T2EventItem::DoAlert(T2TowerDoc* inDoc, CString& inText, int inSoundID) { T2WorldDef *theWorldDef = GetWorldDef(); - inDoc->GetTowerMainView()->tmv_vf154(); + inDoc->GetMainView()->HideToolSprite(); inDoc->towerDoc_vf290(true); T2EventDialog *theDialog = T2EventDialog::Show(this, inDoc, theWorldDef->mModuleHandle, 8000); @@ -195,7 +195,7 @@ T2EventItem* T2EventItem::GetOriginalDef() { } inDoc->towerDoc_vf294(); - inDoc->GetTowerMainView()->tmv_vf150(); + inDoc->GetMainView()->UnhideToolSprite(); } /*virtual*/ void T2EventItem::Write(T2Archive& inArchive) { diff --git a/src/T2DLL/T2EventItem.h b/src/T2DLL/T2EventItem.h index 844186a..0167def 100644 --- a/src/T2DLL/T2EventItem.h +++ b/src/T2DLL/T2EventItem.h @@ -35,7 +35,7 @@ public: void SetStatus(int inStatus); T2EventItem* GetOriginalDef(); - int _4; + BOOL mForceStart; int mSubID; T2TowerEvent *mTowerEvent; int mStatus; 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); diff --git a/src/T2DLL/T2FloorInfo.cpp b/src/T2DLL/T2FloorInfo.cpp index 0bd508c..a4366af 100644 --- a/src/T2DLL/T2FloorInfo.cpp +++ b/src/T2DLL/T2FloorInfo.cpp @@ -124,7 +124,7 @@ void T2FloorInfo::Read(T2Archive& inArchive, T2TowerDoc* inDoc) { inArchive >> classID; if (classID == 'TntA') { mTenantArrayList->Read(inArchive, inDoc); - T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB(); theDB->Init(mTenantArrayList); mTenantArrayList->RecoverRelatedTenantList(theDB); inArchive >> classID; @@ -1022,7 +1022,7 @@ BOOL T2FloorInfo::BuildFinishForce(const RECT& inRect) { if (theTenant && theTenant->GetStatus() < kTenantStatus10) { theTenant->SetStatus(kTenantStatus9); theTenant->Idle(GetCurrentT2TowerDoc()); - GetCurrentT2TowerDoc()->mTowerMainView->tmv_vf128(theTenant->mArea); + GetCurrentT2TowerDoc()->mTowerMainView->InvalUnitRect(theTenant->mArea); finished = true; } } diff --git a/src/T2DLL/T2FloorNumberTable.cpp b/src/T2DLL/T2FloorNumberTable.cpp index 41bd585..ce20205 100644 --- a/src/T2DLL/T2FloorNumberTable.cpp +++ b/src/T2DLL/T2FloorNumberTable.cpp @@ -64,7 +64,7 @@ void T2FloorNumberTable::RefreshCell(int inFloor) { RECT theDrawArea = mRect; OffsetRect(&theDrawArea, cellRect.left, cellRect.top); - T2FloorInfo *theFloorInfo = GetCurrentT2TowerDoc()->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = GetCurrentT2TowerDoc()->GetFloorInfo(); RECT moverArea; mMover->GetEquipArea(moverArea); diff --git a/src/T2DLL/T2GlobalData.h b/src/T2DLL/T2GlobalData.h index f7b3da9..1e13644 100644 --- a/src/T2DLL/T2GlobalData.h +++ b/src/T2DLL/T2GlobalData.h @@ -11,13 +11,13 @@ public: BOOL IsCheckSerial(); int Get1stCinemaDate() { return m1stCinemaDate; } + BOOL mChanged; + int m1stCinemaDate; + T2MovieParamArray *mMovieParamArray; + char mSerial[20]; + protected: void Read(T2Archive& inArchive); void Write(T2Archive& inArchive); BOOL Check_Serial(char* inSerial); - - BOOL mChanged; - int m1stCinemaDate; - T2MovieParamArray *mMovieParamArray; - char mSerial[20]; }; diff --git a/src/T2DLL/T2GuestroomTable.cpp b/src/T2DLL/T2GuestroomTable.cpp index 4458d0f..752f276 100644 --- a/src/T2DLL/T2GuestroomTable.cpp +++ b/src/T2DLL/T2GuestroomTable.cpp @@ -409,12 +409,12 @@ int T2GuestroomItem::GetOutMoney() { void T2GuestroomItem::UpdateTenantEstimation(T2TowerDoc* inDoc) { BOOL isChanged = mTenant->UpdateResidencialEstimate(inDoc); - int viewMode = inDoc->towerDoc_vf140(); - if ((viewMode == ViewMode_2 && isChanged) || (viewMode == ViewMode_3)) { + int viewMode = inDoc->GetViewMode(); + if ((viewMode == kEvalView && isChanged) || (viewMode == kPriceView)) { mTenant->SetDrawMode(DrawMode1); RECT rect; mTenant->GetEquipArea(rect); - inDoc->GetTowerMainView()->tmv_vf128(rect); + inDoc->GetMainView()->InvalUnitRect(rect); } } diff --git a/src/T2DLL/T2HallEventTable.cpp b/src/T2DLL/T2HallEventTable.cpp index b522ed2..3bc08d7 100644 --- a/src/T2DLL/T2HallEventTable.cpp +++ b/src/T2DLL/T2HallEventTable.cpp @@ -184,7 +184,7 @@ T2MonthlyTable::T2MonthlyTable(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalet void T2MonthlyTable::SetStartMonth(T2TowerDoc* inDoc, int inMonth) { mStartMonth = inMonth; - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); T2DateTime date = *theNow; int months = 12; diff --git a/src/T2DLL/T2HaveOutViewObject.cpp b/src/T2DLL/T2HaveOutViewObject.cpp index 1b24415..125a0be 100644 --- a/src/T2DLL/T2HaveOutViewObject.cpp +++ b/src/T2DLL/T2HaveOutViewObject.cpp @@ -1,4 +1,5 @@ #include "T2HaveOutViewObject.h" +#include "T2Settlement.h" #include "T2ToolDef.h" #include "T2TowerDoc.h" @@ -63,6 +64,6 @@ int T2HaveOutViewObject::CalcMentenanceCost(T2TowerDoc* towerDoc) const { ASSERT(mToolDef); cost = mToolDef->CalcMentenanceCostProc(this); - towerDoc->DoPayTool(cost, 0, mToolDef); + towerDoc->DoPayTool(cost, kFundGroup0, mToolDef); return cost; } diff --git a/src/T2DLL/T2Maru_Reggae.cpp b/src/T2DLL/T2Maru_Reggae.cpp index d236e36..ee863ea 100644 --- a/src/T2DLL/T2Maru_Reggae.cpp +++ b/src/T2DLL/T2Maru_Reggae.cpp @@ -77,7 +77,7 @@ T2Maru_Reggae::T2Maru_Reggae(T2TowerEvent* inTowerEvent, CResFile* inResFile, in T2Tenant *theTenant = FindTargetTenant(inDoc); if (theTenant) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); #line 85 _ASSERT(thePool != NULL); @@ -95,7 +95,7 @@ T2Maru_Reggae::T2Maru_Reggae(T2TowerEvent* inTowerEvent, CResFile* inResFile, in } T2MatterDef *theMatterDef = thePeople->GetMatterDef(); - T2TemplatePluginList *thePluginList = inDoc->towerDoc_vf128(); + T2TemplatePluginList *thePluginList = inDoc->GetSilhouetteTemplates(); T2SilhouetteDef *theSilhouetteDef = thePluginList ? thePluginList->FindSilhouette(theMatterDef->mSilhouetteID + 1) : NULL; if (theSilhouetteDef) { @@ -182,7 +182,7 @@ BOOL T2Maru_Reggae::DoReception(T2TowerDoc* inDoc) { } mStatus = kMaruReggaeStatus8; } else if (mGuardman == NULL) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); #line 208 _ASSERT(thePool != NULL); @@ -201,7 +201,7 @@ BOOL T2Maru_Reggae::DoReception(T2TowerDoc* inDoc) { unsigned int theNextTenant; switch (mStatus) { case kMaruReggaeStatus1: - theTenant = inDoc->towerDoc_vf12C()->GetTenant(mVisitTenantID); + theTenant = inDoc->GetFloorInfo()->GetTenant(mVisitTenantID); if (theTenant) { T2EquipDef *theDef = theTenant->GetEquipDef(); if (theTenant->IsTherePeople() && !theTenant->IsFireproof()) { @@ -291,15 +291,15 @@ void T2Maru_Reggae::MaruReception(T2TowerDoc* inDoc, T2People* inPeople) { POINT curPos = inPeople->GetCurPosition(); CRect theRect; - T2TowerMainView *theView = inDoc->GetTowerMainView(); + T2TowerMainView *theView = inDoc->GetMainView(); theView->GetClientRect(theRect); - theRect.OffsetRect(theView->m64); + theRect.OffsetRect(theView->mScrollOffset); - UT2Coordinate::QDToUnit(theRect, inDoc->towerDoc_vf108()); + UT2Coordinate::QDToUnit(theRect, inDoc->GetZoomLevel()); - if (theRect.PtInRect(curPos) && inDoc->towerDoc_vf140() != ViewMode_1) { + if (theRect.PtInRect(curPos) && inDoc->GetViewMode() != kOutView) { UT2Coordinate::MakeRect(theRect, curPos, 2, 1); - theView->tmv_vf128(theRect, true); + theView->InvalUnitRect(theRect, true); } else { mStatus = kMaruReggaeStatus4; } @@ -329,7 +329,7 @@ void T2Maru_Reggae::ReggaeReception(T2TowerDoc* inDoc, T2People* inPeople) { inPeople->SetDestination(0); inPeople->UpdateEstimation(); - theTenant = inDoc->towerDoc_vf12C()->GetTenant(mVisitTenantID); + theTenant = inDoc->GetFloorInfo()->GetTenant(mVisitTenantID); if (theTenant) { CRect rect; theTenant->GetEquipArea(rect); @@ -354,18 +354,18 @@ void T2Maru_Reggae::ReggaeReception(T2TowerDoc* inDoc, T2People* inPeople) { case kMaruReggaeStatus6: curPos = inPeople->GetCurPosition(); - theTenant = inDoc->towerDoc_vf12C()->GetTenant(curPos.y, curPos.x); + theTenant = inDoc->GetFloorInfo()->GetTenant(curPos.y, curPos.x); if (theTenant && !theTenant->IsFloor() && mLastMinutes < GetEndTime()) { CRect theRect; - T2TowerMainView *theView = inDoc->GetTowerMainView(); + T2TowerMainView *theView = inDoc->GetMainView(); theView->GetClientRect(&theRect); - theRect.OffsetRect(theView->m64); + theRect.OffsetRect(theView->mScrollOffset); - UT2Coordinate::QDToUnit(theRect, inDoc->towerDoc_vf108()); + UT2Coordinate::QDToUnit(theRect, inDoc->GetZoomLevel()); - if (theRect.PtInRect(curPos) && inDoc->towerDoc_vf140() != ViewMode_1) { + if (theRect.PtInRect(curPos) && inDoc->GetViewMode() != kOutView) { UT2Coordinate::MakeRect(theRect, curPos, 2, 1); - theView->tmv_vf128(theRect, true); + theView->InvalUnitRect(theRect, true); if (inPeople->GetWalkStyle() == 0) inPeople->ChangeWalkStyle(1); @@ -407,7 +407,7 @@ void T2Maru_Reggae::ReggaeReception(T2TowerDoc* inDoc, T2People* inPeople) { CString message; curPos = inPeople->GetCurPosition(); - theTenant = inDoc->towerDoc_vf12C()->GetTenant(curPos.y, curPos.x); + theTenant = inDoc->GetFloorInfo()->GetTenant(curPos.y, curPos.x); MakeClaimMessage(inDoc, theTenant, message); inDoc->towerDoc_vf13C()->CancelInfoBarMessage(message); @@ -434,13 +434,13 @@ void T2Maru_Reggae::ReggaeReception(T2TowerDoc* inDoc, T2People* inPeople) { void T2Maru_Reggae::MakeClaimMessage(T2TowerDoc* inDoc, T2Tenant* inTenant, CString& outStr) { CString floorStr, roomStr, nameStr; - int floorNum = inTenant->GetFloorNumber(inDoc->towerDoc_vf12C()); + int floorNum = inTenant->GetFloorNumber(inDoc->GetFloorInfo()); if (floorNum < 0) floorStr.Format("B%d", -floorNum); else floorStr.Format("%d", floorNum); - int roomNum = inTenant->GetRoomNumber(inDoc->towerDoc_vf12C()); + int roomNum = inTenant->GetRoomNumber(inDoc->GetFloorInfo()); if (roomNum < 0) roomStr.Format("B%d", -roomNum); else @@ -458,7 +458,7 @@ void T2Maru_Reggae::MakeClaimMessage(T2TowerDoc* inDoc, T2Tenant* inTenant, CStr } T2Tenant* T2Maru_Reggae::FindTargetTenant(T2TowerDoc* inDoc) { - T2RouteNavigator *theNavi = inDoc->towerDoc_vf124(); + T2RouteNavigator *theNavi = inDoc->GetRouteNavi(); #line 521 _ASSERT(theNavi != NULL); @@ -494,7 +494,7 @@ T2Tenant* T2Maru_Reggae::FindTargetTenant(T2TowerDoc* inDoc) { unsigned int T2Maru_Reggae::FindNextTenant(T2TowerDoc* inDoc) { unsigned int theNextTenantID = 0; - T2FloorInfo *fInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *fInfo = inDoc->GetFloorInfo(); #line 550 _ASSERT(fInfo != NULL); T2People *thePeople = GetReggaeMan(); @@ -526,7 +526,7 @@ T2People* T2Maru_Reggae::GetReggaeMan() { } T2Tenant* T2Maru_Reggae::GetVisitTenant() { - return (mStatus == kMaruReggaeStatus6) ? GetTowerDoc()->towerDoc_vf12C()->GetTenant(mVisitTenantID) : NULL; + return (mStatus == kMaruReggaeStatus6) ? GetTowerDoc()->GetFloorInfo()->GetTenant(mVisitTenantID) : NULL; } /*virtual*/ void T2Maru_Reggae::Write(T2Archive& inArchive) { @@ -575,7 +575,7 @@ T2Guardman::T2Guardman(T2Maru_Reggae *inOwner, T2TowerDoc *inDoc, T2Tenant *inTe mOwner = inOwner; mPeople = NULL; - T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB(); #line 647 _ASSERT(theDB != NULL); @@ -585,7 +585,7 @@ T2Guardman::T2Guardman(T2Maru_Reggae *inOwner, T2TowerDoc *inDoc, T2Tenant *inTe theList->FetchItemAt(1, &theTenant); if (theTenant) { - T2RouteNavigator *theNavi = inDoc->towerDoc_vf124(); + T2RouteNavigator *theNavi = inDoc->GetRouteNavi(); #line 656 _ASSERT(theNavi != NULL); @@ -638,11 +638,11 @@ BOOL T2Guardman::DoReception(T2TowerDoc *inDoc) { case kStatus15: { CPoint curPos = mPeople->GetCurPosition(); - T2Tenant *theTenant = inDoc->towerDoc_vf12C()->GetTenant(curPos.y, curPos.x); + T2Tenant *theTenant = inDoc->GetFloorInfo()->GetTenant(curPos.y, curPos.x); T2People *theReggaeMan = mOwner->GetReggaeMan(); if (theTenant && theReggaeMan && mOwner->mStatus == kMaruReggaeStatus6) { CPoint reggaeManPos = theReggaeMan->GetCurPosition(); - if (theTenant == inDoc->towerDoc_vf12C()->GetTenant(reggaeManPos.y, reggaeManPos.x)) { + if (theTenant == inDoc->GetFloorInfo()->GetTenant(reggaeManPos.y, reggaeManPos.x)) { if (reggaeManPos == curPos) { mOwner->mStatus = kMaruReggaeStatus7; } else { diff --git a/src/T2DLL/T2Message.cpp b/src/T2DLL/T2Message.cpp index 15876af..0d6b1bd 100644 --- a/src/T2DLL/T2Message.cpp +++ b/src/T2DLL/T2Message.cpp @@ -1,4 +1,4 @@ -#include "CT2App.h" +#include "T2.h" #include "T2Message.h" #ifdef _DEBUG @@ -98,7 +98,7 @@ END_MESSAGE_MAP() /*virtual*/ void T2Message::PostNcDestroy() { sVisible = false; delete this; - ((CT2App *) AfxGetApp())->app_vfAC(); + T2_APP->app_vfAC(); } int T2Message::OnCreate(CREATESTRUCT* cs) { @@ -151,7 +151,7 @@ int T2Message::OnCreate(CREATESTRUCT* cs) { m74 = GetTickCount(); - ((CT2App *) AfxGetApp())->app_vfA8(this); + T2_APP->app_vfA8(this); return 0; } diff --git a/src/T2DLL/T2MetroRailway.cpp b/src/T2DLL/T2MetroRailway.cpp index 5653e83..560c58d 100644 --- a/src/T2DLL/T2MetroRailway.cpp +++ b/src/T2DLL/T2MetroRailway.cpp @@ -142,7 +142,7 @@ void T2MetroRailway::Init(T2Transport* inParent, CResFile* inResFile) { var1C += mStation; if (var1C < GetWorldDef()->GetWidth()) { - T2TowerMainView *theMainView = inDoc->GetTowerMainView(); + T2TowerMainView *theMainView = inDoc->GetMainView(); if (theMainView) { POINT p; RECT metroRect; @@ -155,12 +155,12 @@ void T2MetroRailway::Init(T2Transport* inParent, CResFile* inResFile) { p.y = metroRect.top; p.x = metroRect.left; - UT2Coordinate::ZoomOut(metroRect, inDoc->towerDoc_vf108()); + UT2Coordinate::ZoomOut(metroRect, inDoc->GetZoomLevel()); CRect visibleRect; theMainView->GetClientRect(&visibleRect); - visibleRect.OffsetRect(theMainView->m64); - visibleRect.right += UT2Coordinate::UnitHSize(inDoc->towerDoc_vf108()); + visibleRect.OffsetRect(theMainView->mScrollOffset); + visibleRect.right += UT2Coordinate::UnitHSize(inDoc->GetZoomLevel()); RECT intersection; if (IntersectRect(&intersection, &metroRect, &visibleRect)) { diff --git a/src/T2DLL/T2Mover.cpp b/src/T2DLL/T2Mover.cpp index 65120c1..7440364 100644 --- a/src/T2DLL/T2Mover.cpp +++ b/src/T2DLL/T2Mover.cpp @@ -193,7 +193,7 @@ void T2Mover::GetTypicalName(CString& outStr) const { /*virtual*/ BOOL T2Mover::Destruct(T2TowerDoc* towerDoc, CRect& rect) { GetEquipArea(rect); - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); mModuleList->Destruct(towerDoc); for (int p = 0; p < mLength; p++) { @@ -208,7 +208,7 @@ void T2Mover::GetTypicalName(CString& outStr) const { BOOL done = true; - towerDoc->towerDoc_vf124()->MoverRemoved(this, 1); + towerDoc->GetRouteNavi()->MoverRemoved(this, 1); return done; } @@ -231,7 +231,7 @@ int T2Mover::GetNumStop() const { void T2Mover::AddStopBoth(T2TowerDoc* towerDoc, int position) { BOOL ok = false; - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); ok |= AddStop(theFloorInfo, position, ERequestUpDown_0); ok |= AddStop(theFloorInfo, position, ERequestUpDown_1); @@ -274,7 +274,7 @@ void T2Mover::RemoveStopBoth(T2TowerDoc* towerDoc, int position) { RemoveStop(towerDoc, position, ERequestUpDown_0); RemoveStop(towerDoc, position, ERequestUpDown_1); - RemoveCrossEquipID(towerDoc->towerDoc_vf12C(), position); + RemoveCrossEquipID(towerDoc->GetFloorInfo(), position); mReqIDArray->StopRemoved(towerDoc, PositionToUnit(position)); if (mModuleList) @@ -308,7 +308,7 @@ void T2Mover::RemoveUnstoppable(T2TowerDoc* towerDoc) { } if (changed) - towerDoc->GetTowerMainView()->tmv_vf128(mArea); + towerDoc->GetMainView()->InvalUnitRect(mArea); } void T2Mover::AddCrossEquipID(T2FloorInfo* floorInfo, int position) { @@ -544,7 +544,7 @@ int T2Mover::CalcScore(int multiplier) const { int T2Mover::ExpandArea(T2TowerDoc* inDoc, EEquipPos inEquipPos, int inCount) { int result = 0; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); RECT theMoverArea = mArea; @@ -638,7 +638,7 @@ int T2Mover::ExpandArea(T2TowerDoc* inDoc, EEquipPos inEquipPos, int inCount) { } if (inCount != 0) - inDoc->GetTowerMainView()->tmv_vf128(theMoverArea, true); + inDoc->GetMainView()->InvalUnitRect(theMoverArea, true); return result; } @@ -675,7 +675,7 @@ void T2Mover::ShowShaft() { mShowShaft = true; T2TowerDoc *theTowerDoc = GetCurrentT2TowerDoc(); - theTowerDoc->GetTowerMainView()->tmv_vf128(mArea); + theTowerDoc->GetMainView()->InvalUnitRect(mArea); } } @@ -684,8 +684,8 @@ void T2Mover::HideShaft() { mShowShaft = false; T2TowerDoc *theTowerDoc = GetCurrentT2TowerDoc(); - theTowerDoc->GetTowerMainView()->tmv_vf128(mArea); - theTowerDoc->towerDoc_vf12C()->SetTenantDrawModeByRect(mArea, DrawMode2); + theTowerDoc->GetMainView()->InvalUnitRect(mArea); + theTowerDoc->GetFloorInfo()->SetTenantDrawModeByRect(mArea, DrawMode2); } } diff --git a/src/T2DLL/T2MoverArray.h b/src/T2DLL/T2MoverArray.h index c832cd1..a2266c7 100644 --- a/src/T2DLL/T2MoverArray.h +++ b/src/T2DLL/T2MoverArray.h @@ -20,6 +20,8 @@ public: protected: friend class T2MoverArrayList; + friend class T2TowerDoc; + friend class T2TowerMainView; T2Mover mMover[kGroupSize]; }; diff --git a/src/T2DLL/T2MoverDef.cpp b/src/T2DLL/T2MoverDef.cpp index 3d39f27..9277fb8 100644 --- a/src/T2DLL/T2MoverDef.cpp +++ b/src/T2DLL/T2MoverDef.cpp @@ -62,18 +62,18 @@ BOOL T2MoverDef::InitObject(T2Mover* mover, const POINT&) { return true; } -/*virtual*/ AREACHECKCODE T2MoverDef::AreaCheck(T2TowerDoc* towerDoc, RECT& rect, unsigned int, int) { - if (!towerDoc->mFloorInfo->IsThereMover(rect)) +/*virtual*/ AREACHECKCODE T2MoverDef::AreaCheck(T2TowerDoc* inDoc, RECT& inRect, unsigned int, BOOL inShowError) { + if (!inDoc->mFloorInfo->IsThereMover(inRect)) return AreaCheckCode_1; - RECT adjRect = rect; + RECT adjRect = inRect; adjRect.top++; adjRect.bottom--; - if (adjRect.top < adjRect.bottom && !towerDoc->mFloorInfo->IsThereMover(adjRect)) + if (adjRect.top < adjRect.bottom && !inDoc->mFloorInfo->IsThereMover(adjRect)) return AreaCheckCode_0; - if (!towerDoc->mFloorInfo->IsThereOtherKindMover(rect, GetEquipType())) + if (!inDoc->mFloorInfo->IsThereOtherKindMover(inRect, GetEquipType())) return AreaCheckCode_2; return AreaCheckCode_0; diff --git a/src/T2DLL/T2MoverDef.h b/src/T2DLL/T2MoverDef.h index e8e4057..d4ef617 100644 --- a/src/T2DLL/T2MoverDef.h +++ b/src/T2DLL/T2MoverDef.h @@ -15,7 +15,7 @@ public: virtual BOOL InitObject(T2Object*) { return false; } virtual CURSORTYPE QueryCursor(T2TowerDoc*, POINT, CString&, RECT&, POINT&, int, unsigned int, int); virtual int CalcMentenanceCostProc(const T2HaveOutViewObject*) const; - virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT&, unsigned int, int); + virtual AREACHECKCODE AreaCheck(T2TowerDoc* inDoc, RECT& inRect, unsigned int, BOOL inShowError); virtual int ClickProc(T2TowerDoc*, RECT*, unsigned int&); virtual BOOL MakeRequestProc(T2TowerDoc*, T2Equip*); virtual PROCCODE AddModuleProc(T2TowerDoc*, T2Equip*, RECT*); @@ -63,6 +63,8 @@ protected: int m1AC; int m1B0[3]; T2BitImage *mOffBitMap; + + friend class T2TowerDoc; }; inline BOOL T2MoverDef::IsStair() { diff --git a/src/T2DLL/T2MoverModule.cpp b/src/T2DLL/T2MoverModule.cpp index ae7de97..1d1db71 100644 --- a/src/T2DLL/T2MoverModule.cpp +++ b/src/T2DLL/T2MoverModule.cpp @@ -225,7 +225,7 @@ void T2MoverModule::AddPosition(int value) { /*static*/ unsigned int T2MoverModule::GetNewModuleID(T2TowerDoc* towerDoc) { incAgain: sModuleID++; - if (towerDoc->towerDoc_vf12C()->GetModule(sModuleID)) + if (towerDoc->GetFloorInfo()->GetModule(sModuleID)) goto incAgain; return sModuleID; diff --git a/src/T2DLL/T2MoverModuleTable.cpp b/src/T2DLL/T2MoverModuleTable.cpp index f025e6e..80741e1 100644 --- a/src/T2DLL/T2MoverModuleTable.cpp +++ b/src/T2DLL/T2MoverModuleTable.cpp @@ -1,5 +1,5 @@ -#include "CT2App.h" #include "GlobalFunc.h" +#include "T2.h" #include "T2BitImage.h" #include "T2DlgItemVScr.h" #include "T2ElevatorModule.h" @@ -19,7 +19,7 @@ T2MoverModuleTable::T2MoverModuleTable(T2TowerDoc* inDoc, T2ImageObj* inImageObj { mImage = NULL; SetRect(&mRect, 0, 0, 0, 0); - ((CT2App *) AfxGetApp())->app_vfA4(true); + T2_APP->app_vfA4(true); } /*virtual*/ T2MoverModuleTable::~T2MoverModuleTable() { diff --git a/src/T2DLL/T2Name.cpp b/src/T2DLL/T2Name.cpp index 5febc0c..078071e 100644 --- a/src/T2DLL/T2Name.cpp +++ b/src/T2DLL/T2Name.cpp @@ -107,8 +107,8 @@ void T2Name::MakeFullName(T2TowerDoc* inDoc, CString& outStr) { if (mName != NULL) { switch (GetType()) { case kTenantNameType: - if (inDoc && inDoc->towerDoc_vf12C()) { - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + if (inDoc && inDoc->GetFloorInfo()) { + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2Tenant *theTenant = theFloorInfo->GetTenant(GetID()); if (theTenant) { CString str; @@ -121,10 +121,10 @@ void T2Name::MakeFullName(T2TowerDoc* inDoc, CString& outStr) { break; case kPeopleNameType: - if (inDoc && inDoc->towerDoc_vf12C() && inDoc->mPeopleArrayList) { + if (inDoc && inDoc->GetFloorInfo() && inDoc->mPeopleArrayList) { T2People *thePeople = inDoc->mPeopleArrayList->FindPeople(GetID()); if (thePeople) { - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); int theTenantID = (thePeople->GetWorkTenant() > 1) ? thePeople->GetWorkTenant() : (thePeople->GetHomeTenant() > 1) ? thePeople->GetHomeTenant() : 1; CString str; diff --git a/src/T2DLL/T2OptionPluginList.cpp b/src/T2DLL/T2OptionPluginList.cpp index 278086d..13c08e6 100644 --- a/src/T2DLL/T2OptionPluginList.cpp +++ b/src/T2DLL/T2OptionPluginList.cpp @@ -17,7 +17,7 @@ void T2OptionPluginList::Add(T2OptionPlugin* plugin) { } void T2OptionPluginList::OnIdle(T2TowerDoc* towerDoc) { - DispatchEvent(OptionEventType_0, towerDoc, NULL); + DispatchEvent(kIdleOptionEvent, towerDoc, NULL); } BOOL T2OptionPluginList::DispatchEvent(OPTIONEVENTTYPE eventType, T2TowerDoc* towerDoc, void* data) { diff --git a/src/T2DLL/T2OutDecoration.cpp b/src/T2DLL/T2OutDecoration.cpp index 575f0f8..e8d7d74 100644 --- a/src/T2DLL/T2OutDecoration.cpp +++ b/src/T2DLL/T2OutDecoration.cpp @@ -43,11 +43,11 @@ T2OutDecoration::T2OutDecoration(T2TowerEvent* inTowerEvent, CResFile* inResFile } /*virtual*/ int T2OutDecoration::Exec(T2TowerDoc* inDoc) { - T2PaletteAnime *thePalette = inDoc->towerDoc_vf160(); + T2PaletteAnime *thePalette = inDoc->GetPaletteAnime(); int frame = thePalette->IsSnow() ? 1 : 0; - if (inDoc->towerDoc_vf140() != mCurrentViewMode || frame != mCurrentFrame) - DoDecoration(inDoc, (VIEWMODE) inDoc->towerDoc_vf140(), frame); + if (inDoc->GetViewMode() != mCurrentViewMode || frame != mCurrentFrame) + DoDecoration(inDoc, (VIEWMODE) inDoc->GetViewMode(), frame); return 0; } @@ -55,7 +55,7 @@ T2OutDecoration::T2OutDecoration(T2TowerEvent* inTowerEvent, CResFile* inResFile void T2OutDecoration::DoDecoration(T2TowerDoc* inDoc, VIEWMODE inViewMode, int inFrame) { T2OutDeco *theOutDeco; - if (inViewMode == ViewMode_1) { + if (inViewMode == kOutView) { LArray *theRoofList = MakeLoofList(); if (theRoofList) { T2Sprite *theSprite = &inDoc->mSprite; @@ -109,8 +109,8 @@ void T2OutDecoration::DoDecoration(T2TowerDoc* inDoc, VIEWMODE inViewMode, int i } /*virtual*/ void T2OutDecoration::ViewModeChanged(T2TowerDoc* inDoc, VIEWMODE inViewMode) { - if (inViewMode != mCurrentViewMode && (inViewMode == ViewMode_1 || mCurrentViewMode == ViewMode_1)) { - T2PaletteAnime *thePalette = inDoc->towerDoc_vf160(); + if (inViewMode != mCurrentViewMode && (inViewMode == kOutView || mCurrentViewMode == kOutView)) { + T2PaletteAnime *thePalette = inDoc->GetPaletteAnime(); int frame = thePalette->IsSnow() ? 1 : 0; DoDecoration(inDoc, inViewMode, frame); @@ -125,7 +125,7 @@ LArray* T2OutDecoration::MakeLoofList() { LArray *theArray = new LArray; if (theArray) { - T2FloorInfo *theFloorInfo = GetTowerDoc()->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = GetTowerDoc()->GetFloorInfo(); int curV; int groundV = GetWorldDef()->mGroundLine - 1; int nextH; diff --git a/src/T2DLL/T2OutObj.cpp b/src/T2DLL/T2OutObj.cpp index 29c1fca..d6f7090 100644 --- a/src/T2DLL/T2OutObj.cpp +++ b/src/T2DLL/T2OutObj.cpp @@ -38,7 +38,7 @@ T2OutObj::T2OutObj() { /*virtual*/ PROCCODE T2OutObj::Destruct(T2TowerDoc* towerDoc, RECT& rect) { GetOutObjArea(rect); - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); if (theFloorInfo) { theFloorInfo->FillOutObjID(rect, 0); if (GetToolDef()) @@ -61,7 +61,7 @@ T2OutObj::T2OutObj() { result = GetToolDef()->IdleProc(this, towerDoc); if (result) - towerDoc->GetTowerMainView()->tmv_vf128(mOutObjArea); + towerDoc->GetMainView()->InvalUnitRect(mOutObjArea); return result; } diff --git a/src/T2DLL/T2OutObj.h b/src/T2DLL/T2OutObj.h index aea795a..f6cec0b 100644 --- a/src/T2DLL/T2OutObj.h +++ b/src/T2DLL/T2OutObj.h @@ -31,6 +31,7 @@ protected: friend class T2OuterObjDef; friend class T2OutObjArray; friend class T2OutObjInfoDialog; + friend class T2TowerDoc; unsigned int mID; RECT mOutObjArea; diff --git a/src/T2DLL/T2OutObjArray.h b/src/T2DLL/T2OutObjArray.h index 008bd17..0f99639 100644 --- a/src/T2DLL/T2OutObjArray.h +++ b/src/T2DLL/T2OutObjArray.h @@ -19,6 +19,7 @@ public: protected: friend class T2OutObjArrayList; + friend class T2TowerDoc; T2OutObj mOutObj[kGroupSize]; }; diff --git a/src/T2DLL/T2OuterObjDef.cpp b/src/T2DLL/T2OuterObjDef.cpp index f06e18e..8b3adf1 100644 --- a/src/T2DLL/T2OuterObjDef.cpp +++ b/src/T2DLL/T2OuterObjDef.cpp @@ -36,20 +36,20 @@ T2OuterObjDef::T2OuterObjDef(DWORD type, T2PluginSpecifier& specifier, CResFile* /*virtual*/ void T2OuterObjDef::DrawProc(T2HaveOutViewObject* obj, const RECT& inRect, T2TowerDoc* inDoc) const { RECT rect = ((T2OutObj *) obj)->_3C; - UT2Coordinate::UnitToQD(rect, inDoc->towerDoc_vf108(), true); + UT2Coordinate::UnitToQD(rect, inDoc->GetZoomLevel(), true); int objectID = mImageObj->FindObject("View"); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); } -/*virtual*/ AREACHECKCODE T2OuterObjDef::AreaCheck(T2TowerDoc* inDoc, RECT& rect, unsigned int arg1, int arg2) { +/*virtual*/ AREACHECKCODE T2OuterObjDef::AreaCheck(T2TowerDoc* inDoc, RECT& rect, unsigned int arg1, int inShowError) { LArrayIterator iterator(*inDoc->mOuterObjList); T2OutObj *theOutObj; while (iterator.Next(&theOutObj)) { RECT intersect; if (IntersectRect(&intersect, &theOutObj->_3C, &rect)) { - if (arg2) { + if (inShowError) { // "重ねて設置できません" - cannot be placed on top of each other (new T2Message)->ShowMessage("\x8F\x64\x82\xCB\x82\xC4\x90\xDD\x92\x75\x82\xC5\x82\xAB\x82\xDC\x82\xB9\x81\xF1"); } @@ -60,7 +60,7 @@ T2OuterObjDef::T2OuterObjDef(DWORD type, T2PluginSpecifier& specifier, CResFile* for (int x = rect.left; x < rect.right; x++) { for (int y = rect.top; y < rect.bottom; y++) { if (!inDoc->mFloorInfo->GetTenant(y, x)) { - if (arg2) { + if (inShowError) { // "はみだして設置できません" - it cannot be installed as it protrudes (new T2Message)->ShowMessage("\x82\xCD\x82\xDD\x82\xBE\x82\xB5\x82\xC4\x90\xDD\x92\x75\x82\xC5\x82\xAB\x82\xDC\x82\xB9\x82\xF1"); } @@ -70,7 +70,7 @@ T2OuterObjDef::T2OuterObjDef(DWORD type, T2PluginSpecifier& specifier, CResFile* } if (rect.bottom > (inDoc->mWorldDef->mGroundLine - inDoc->mWorldDef->mLobbyHeight)) { - if (arg2) { + if (inShowError) { // "ここには設置できません" - cannot be installed here (new T2Message)->ShowMessage("\x82\xB1\x82\xB1\x82\xC9\x82\xCD\x90\xDD\x92\x75\x82\xC5\x82\xAB\x82\xDC\x82\xB9\x82\xF1"); } diff --git a/src/T2DLL/T2OuterObjDef.h b/src/T2DLL/T2OuterObjDef.h index e8c1328..28683d0 100644 --- a/src/T2DLL/T2OuterObjDef.h +++ b/src/T2DLL/T2OuterObjDef.h @@ -11,7 +11,7 @@ public: virtual void DrawProc(T2HaveOutViewObject*, const RECT&, T2TowerDoc*) const; virtual PROCCODE DoDestructProc(T2TowerDoc*, T2HaveOutViewObject*, POINT, RECT&); virtual void SetTenantDef(T2TenantDef* def) { mTenantDef = def; } - virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT&, unsigned int, int); + virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT&, unsigned int, BOOL inShowError); virtual T2InfoDialog* ShowInfoDialog(T2TowerDoc*, T2OutObj*); virtual int GetInfoDialogID(T2TowerDoc*, const T2OutObj*) const; virtual T2InfoDialog* ConstructInfoDialog(T2OutObj*); diff --git a/src/T2DLL/T2PaletteAnime.cpp b/src/T2DLL/T2PaletteAnime.cpp index d1dee3b..fba291b 100644 --- a/src/T2DLL/T2PaletteAnime.cpp +++ b/src/T2DLL/T2PaletteAnime.cpp @@ -190,11 +190,11 @@ void T2PaletteAnime::MinuteChanged(T2DateTime* dateTime) { void T2PaletteAnime::DoAnimatePalette() { if (mPaletteUpdated) { - GetCurrentT2TowerDoc()->towerDoc_vf11C( - mPaletteAnimeDef->GetAnimStartIndex(), - mPaletteAnimeDef->GetNumOfAnimColor(), - mInterCTab->palPalEntry - ); + GetCurrentT2TowerDoc()->UpdatePalette( + mPaletteAnimeDef->GetAnimStartIndex(), + mPaletteAnimeDef->GetNumOfAnimColor(), + mInterCTab->palPalEntry + ); mPaletteUpdated = false; } } @@ -206,7 +206,7 @@ void T2PaletteAnime::ReplaceDayLightPalette(int id) { void T2PaletteAnime::SetSkyState(int skyState, int skyCount) { if (mSkyState != skyState) - GetCurrentT2TowerDoc()->GetTowerMainView()->tmv_vf124(true); + GetCurrentT2TowerDoc()->GetMainView()->Invalidate(true); mSkyState = skyState; mSkyCount = skyCount; diff --git a/src/T2DLL/T2People.cpp b/src/T2DLL/T2People.cpp index 38fd272..c83373a 100644 --- a/src/T2DLL/T2People.cpp +++ b/src/T2DLL/T2People.cpp @@ -64,7 +64,7 @@ void T2People::Initialize() { /*virtual*/ void T2People::SetUsed(BOOL used) { if (!used) { if (IsFavorite()) { - GetCurrentT2TowerDoc()->towerDoc_vf1C4(this, true); + GetCurrentT2TowerDoc()->RemoveFavoritePeople(this, true); } else if (IsNamed()) { T2NameList *nameDB = GetCurrentT2TowerDoc()->mNameDB; T2Name *name = nameDB->Search(this, false); @@ -185,17 +185,17 @@ unsigned int T2People::GetCurTenantID() const { switch (mStatus) { case kStatus1: - if (IsStartTime(towerDoc->towerDoc_vf120()->GetRawMinutes()) && IsSetDestination()) { - towerDoc->towerDoc_vf130()->Leave(this); + if (IsStartTime(towerDoc->GetNow()->GetRawMinutes()) && IsSetDestination()) { + towerDoc->GetPool()->Leave(this); MoveToTowerEntrance(towerDoc); - if (towerDoc->towerDoc_vf154()) + if (towerDoc->IsToiletFlagOn()) SetSpecialFlag(kSpecialFlag2); } break; case kStatus11: - if (IsStartTime(towerDoc->towerDoc_vf120()->GetRawMinutes())) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + if (IsStartTime(towerDoc->GetNow()->GetRawMinutes())) { + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); T2Tenant *theCurrTenant = theFloorInfo->GetTenant(mCurrEquipID); if (theCurrTenant) { if (IsSetDestination()) @@ -223,7 +223,7 @@ unsigned int T2People::GetCurTenantID() const { what = 1; if (!IsWalk()) { - if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) { + if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) { if (!IsRegistRequest(towerDoc)) ChangeStatus(kStatus3); } @@ -234,8 +234,8 @@ unsigned int T2People::GetCurTenantID() const { case kStatus10: if (!IsWalk()) { - if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) { + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); T2Tenant *theDstTenant = theFloorInfo->GetTenant(mDstTenant); if (theDstTenant) theDstTenant->EnterTenant(towerDoc, this); @@ -245,21 +245,21 @@ unsigned int T2People::GetCurTenantID() const { case kStatus12: if (!IsWalk()) { - if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) + if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) GoOutTower(towerDoc); } break; case kStatus13: if (!IsWalk()) { - if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) + if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) MoveByEStair(towerDoc); } break; case kStatus14: if (!IsWalk()) { - if (IsReachDestination(towerDoc->towerDoc_vf12C()->GetGroundLine() - 1)) + if (IsReachDestination(towerDoc->GetFloorInfo()->GetGroundLine() - 1)) ChangeStatus(kStatus15); } break; @@ -269,7 +269,7 @@ unsigned int T2People::GetCurTenantID() const { } void T2People::IdleWaitMover(T2TowerDoc* towerDoc) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); BOOL didChange = IncStress(5); if (mStress >= 300) { @@ -283,7 +283,7 @@ void T2People::IdleWaitMover(T2TowerDoc* towerDoc) { if (didChange) { RECT rect; CalcWaitPersonArea(theFloorInfo, rect); - towerDoc->GetTowerMainView()->tmv_vf128(rect, false); + towerDoc->GetMainView()->InvalUnitRect(rect, false); } } @@ -313,7 +313,7 @@ void T2People::MoveToTowerEntrance(T2TowerDoc* towerDoc) { } void T2People::MoveToLobby(T2TowerDoc* towerDoc) { - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); T2Tenant *lobby = floorInfo->GetTenant(1000); if (lobby) { @@ -338,7 +338,7 @@ void T2People::MoveToLobby(T2TowerDoc* towerDoc) { BOOL T2People::MoveToParking(T2TowerDoc* towerDoc) { BOOL ok = false; - T2RegistedTenantDB *registedTenantDB = towerDoc->towerDoc_vf174(); + T2RegistedTenantDB *registedTenantDB = towerDoc->GetRegistedTenantDB(); if (registedTenantDB) { T2Tenant *parking = NULL; if (!IsGeneral()) @@ -360,7 +360,7 @@ BOOL T2People::MoveToSubway(T2TowerDoc* towerDoc) { BOOL ok = false; T2TowerEvent *theEvent = towerDoc->mWorldDef->GetTowerEvent(); - T2DateTime *theCurrTime = towerDoc->towerDoc_vf120(); + T2DateTime *theCurrTime = towerDoc->GetNow(); T2Transport *metro = theEvent->GetMetroRailway(); if (metro) { T2Transport *available = metro->GetAvailable(theCurrTime); @@ -377,7 +377,7 @@ BOOL T2People::MoveToShip(T2TowerDoc* towerDoc) { BOOL ok = false; T2TowerEvent *event = towerDoc->mWorldDef->GetTowerEvent(); - T2DateTime *now = towerDoc->towerDoc_vf120(); + T2DateTime *now = towerDoc->GetNow(); T2Transport *cruise = event->GetCruise(); if (cruise) { T2Transport *available = cruise->GetAvailable(now); @@ -391,7 +391,7 @@ BOOL T2People::MoveToShip(T2TowerDoc* towerDoc) { } void T2People::MoveByEStair(T2TowerDoc* towerDoc) { - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); if (floorInfo) { T2Tenant *theCurTenant = floorInfo->GetTenant(mCurrEquipID); @@ -413,11 +413,11 @@ void T2People::MoveByEStair(T2TowerDoc* towerDoc) { } if (IsWalk()) { - T2TowerMainView *towerMainView = towerDoc->GetTowerMainView(); + T2TowerMainView *towerMainView = towerDoc->GetMainView(); if (towerMainView) { RECT rect; SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1); - towerMainView->tmv_vf128(rect, false); + towerMainView->InvalUnitRect(rect, false); } } } @@ -433,7 +433,7 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) { if (!FindRoute(towerDoc)) { changed = IncStress(30) && IsWalk(); if (mStress >= 300) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); if (IsWalk()) { // "道がないよ~" - there is no way CString theMessage = "\x93\xB9\x82\xAA\x82\xC8\x82\xA2\x82\xE6\x81\x60"; @@ -442,7 +442,7 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) { RECT theRect; CalcWalkingSilhouetteArea(theRect); theFloorInfo->SetTenantDrawModeByRect(theRect, DrawMode1); - towerDoc->GetTowerMainView()->tmv_vf128(theRect, false); + towerDoc->GetMainView()->InvalUnitRect(theRect, false); } T2Tenant *theFloor = theFloorInfo->GetTenant(mCurrEquipID); @@ -455,14 +455,14 @@ void T2People::SolveNoRoute(T2TowerDoc* towerDoc) { if (changed) { RECT rect; CalcWalkingSilhouetteArea(rect); - towerDoc->GetTowerMainView()->tmv_vf128(rect, false); + towerDoc->GetMainView()->InvalUnitRect(rect, false); } } BOOL T2People::FindRoute(T2TowerDoc* towerDoc) { BOOL ok = false; int status = mStatus; - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); if (theFloorInfo) { mCurrDestPos = theFloorInfo->GetEntrancePt(mDstTenant); @@ -477,7 +477,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) { ok = true; } else { int routeType = GetRouteType(); - if (towerDoc->towerDoc_vf124()->GetNextRoute(mCurPosition, mCurrDestPos, routeType)) { + if (towerDoc->GetRouteNavi()->GetNextRoute(mCurPosition, mCurrDestPos, routeType)) { if (routeType >= kRouteType0) status = kStatus5; else @@ -496,7 +496,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) { ChangeStatus(status); - T2TrafficInfo *trafficInfo = towerDoc->towerDoc_vf150(); + T2TrafficInfo *trafficInfo = towerDoc->GetTrafficInfo(); if (trafficInfo) trafficInfo->Pass(mCurPosition, mCurrDestPos, 1); } @@ -505,7 +505,7 @@ BOOL T2People::FindRoute(T2TowerDoc* towerDoc) { } void T2People::JumpToDestination(T2TowerDoc* towerDoc) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); POINT theDestPos = theFloorInfo->GetEntrancePt(mDstTenant); mCurPosition = theDestPos; @@ -514,11 +514,11 @@ void T2People::JumpToDestination(T2TowerDoc* towerDoc) { } void T2People::GoOutTower(T2TowerDoc* towerDoc) { - T2Tenant *theFloor = towerDoc->towerDoc_vf12C()->GetTenant(mCurrEquipID); + T2Tenant *theFloor = towerDoc->GetFloorInfo()->GetTenant(mCurrEquipID); if (theFloor) theFloor->Leave(this); - T2Pool *pool = towerDoc->towerDoc_vf130(); + T2Pool *pool = towerDoc->GetPool(); pool->Enter(this); } @@ -543,10 +543,10 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) { case kStatus2: { - T2TowerMainView *theView = towerDoc->GetTowerMainView(); + T2TowerMainView *theView = towerDoc->GetMainView(); RECT area; CalcWalkingSilhouetteArea(area); - theView->tmv_vf128(area, false); + theView->InvalUnitRect(area, false); mStatus = kStatus3; break; } @@ -561,7 +561,7 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) { case kStatus10: { - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); T2Tenant *theDstTenant = floorInfo->GetTenant(mDstTenant); if (theDstTenant) theDstTenant->EnterTenant(towerDoc, this); @@ -588,12 +588,12 @@ void T2People::IdleSearchedPerson(T2TowerDoc* towerDoc) { BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) { BOOL ok = false; T2FloorInfo *floorInfo = towerDoc->mFloorInfo; - T2TowerMainView *theMainView = towerDoc->GetTowerMainView(); + T2TowerMainView *theMainView = towerDoc->GetMainView(); RECT rect; SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1); floorInfo->SetTenantDrawModeByRect(rect, DrawMode1); - theMainView->tmv_vf128(rect, false); + theMainView->InvalUnitRect(rect, false); int theWalkWidth = 2; @@ -610,7 +610,7 @@ BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) { mCurPosition.x += theWalkWidth; OffsetRect(&rect, theWalkWidth, 0); - theMainView->tmv_vf128(rect, false); + theMainView->InvalUnitRect(rect, false); if (mCurPosition.y != (floorInfo->GetGroundLine() - 1)) IncStress(theWalkWidth / 4); @@ -620,13 +620,13 @@ BOOL T2People::WalkSearchedPersonRight(T2TowerDoc* towerDoc) { BOOL T2People::WalkSearchedPersonLeft(T2TowerDoc* towerDoc) { BOOL ok = false; - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); - T2TowerMainView *theMainView = towerDoc->GetTowerMainView(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); + T2TowerMainView *theMainView = towerDoc->GetMainView(); RECT rect; SetRect(&rect, mCurPosition.x, mCurPosition.y, mCurPosition.x + 2, mCurPosition.y + 1); floorInfo->SetTenantDrawModeByRect(rect, DrawMode1); - theMainView->tmv_vf128(rect, false); + theMainView->InvalUnitRect(rect, false); int theWalkWidth = 2; @@ -646,7 +646,7 @@ BOOL T2People::WalkSearchedPersonLeft(T2TowerDoc* towerDoc) { mCurPosition.x -= theWalkWidth; OffsetRect(&rect, -theWalkWidth, 0); - theMainView->tmv_vf128(rect, false); + theMainView->InvalUnitRect(rect, false); if (mCurPosition.y != (floorInfo->GetGroundLine() - 1)) IncStress(theWalkWidth / 4); @@ -817,7 +817,7 @@ void T2People::SetDestinationToOutOfTower(T2TowerDoc* towerDoc) { switch (mPeopleType->GetTransportType()) { case kTransportParking: { - T2RegistedTenantDB *registedTenantDB = towerDoc->towerDoc_vf174(); + T2RegistedTenantDB *registedTenantDB = towerDoc->GetRegistedTenantDB(); if (registedTenantDB) { T2Tenant *parking = NULL; if (!IsGeneral()) { @@ -974,8 +974,8 @@ BOOL T2People::SearchToilet(T2TowerDoc* towerDoc) { BOOL ok = false; if (SetDestinationToReturn()) { - T2RegistedTenantDB *theDB = towerDoc->towerDoc_vf174(); - T2RouteNavigator *theNavi = towerDoc->towerDoc_vf124(); + T2RegistedTenantDB *theDB = towerDoc->GetRegistedTenantDB(); + T2RouteNavigator *theNavi = towerDoc->GetRouteNavi(); if (theDB && theNavi) { int toiletStatus; T2Tenant *theToilet = theDB->SearchToilet(theNavi, mCurPosition, toiletStatus); @@ -1031,7 +1031,7 @@ void T2People::DrawSearchedPerson(T2TowerDoc* towerDoc) { } /*virtual*/ void T2People::Draw(T2TowerDoc* towerDoc, const RECT& inRect) { - if (towerDoc->towerDoc_vf108() > 0) + if (towerDoc->GetZoomLevel() > 0) return; if (m18 != -1) { @@ -1042,7 +1042,8 @@ void T2People::DrawSearchedPerson(T2TowerDoc* towerDoc) { #line 1380 _ASSERT(objectID != -1); - mSilhouetteDef[mStyle]->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), objectID, rect, towerDoc->towerDoc_vf108(), T2PaletteAnimeDef::GetCommonColor(mColor)); + mSilhouetteDef[mStyle]->mImageObj->DrawObject(towerDoc->GetImage(), objectID, rect, + towerDoc->GetZoomLevel(), T2PaletteAnimeDef::GetCommonColor(mColor)); } } @@ -1066,11 +1067,12 @@ void T2People::Draw(T2TowerDoc* towerDoc, T2Equip* equip) { POINT curPosition = GetCurPosition(); SetRect(&rect, curPosition.x, curPosition.y, curPosition.x + 2, curPosition.y + 1); - UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108()); + UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel()); int theInd = equip->GetEquipDef()->mImageObj->FindObject(1003, mFiller); if (theInd >= 0) - equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), theInd, rect, towerDoc->towerDoc_vf108()); + equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->GetImage(), theInd, rect, + towerDoc->GetZoomLevel()); } } @@ -1080,11 +1082,11 @@ void T2People::DrawAt(T2TowerDoc* towerDoc, T2Equip* equip, POINT pt) { SetRect(&rect, 0, 0, 2, 1); rect.OffsetRect(mCurPosition.x - pt.x, mCurPosition.y - pt.y); - UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108()); + UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel()); int theInd = equip->GetEquipDef()->mImageObj->FindObject(1003, mFiller); if (theInd >= 0) - equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->towerDoc_vf10C(), theInd, rect); + equip->GetEquipDef()->mImageObj->DrawObject(towerDoc->GetImage(), theInd, rect); } } @@ -1110,7 +1112,7 @@ void T2People::Remove(T2TowerDoc* inTowerDoc, unsigned int id) { } if (flag && IsGeneral() && GetStatus() == kStatus1) { - T2Pool *pool = inTowerDoc->towerDoc_vf130(); + T2Pool *pool = inTowerDoc->GetPool(); if (pool) pool->RemovePeople(this); } @@ -1126,7 +1128,7 @@ void T2People::TenantRemoved(unsigned int id) { } void T2People::Interview(T2TowerDoc* towerDoc) { - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); if (floorInfo) { CString text; if (GetInterviewWords(towerDoc, text) && text.GetLength() != 0) { @@ -1155,13 +1157,13 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) { optionEvent.people = this; optionEvent.str = &outStr; - if (!DispatchOptionEvent(OptionEventType_11, &optionEvent)) + if (!DispatchOptionEvent(kPreInterviewWordsOptionEvent, &optionEvent)) return outStr != ""; unsigned int theFlags = 0; T2PeopleDef *thePeopleDef = (T2PeopleDef *) GetMatterDef(); - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); T2Tenant *theDstTenant = theFloorInfo->GetTenant(mDstTenant); T2Tenant *theWorkTenant = theFloorInfo->GetTenant(GetWorkTenant()); @@ -1189,7 +1191,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) { if (mDstTenant == 1 && VIPEstimation()) theFlags |= 0x10; - switch (towerDoc->towerDoc_vf138()) { + switch (towerDoc->GetLevel()) { case 1: level = 3; break; @@ -1214,7 +1216,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) { T2WordDefArray *theWordDefArray = NULL; if (level != 0) { - theWordDefArray = towerDoc->towerDoc_vf170()->mWordDefArray; + theWordDefArray = towerDoc->GetWorldDef()->mWordDefArray; } else { if (mStatus == kStatus6 && thePeopleDef && mStress >= thePeopleDef->GetStressYellowLimit()) { T2Request *request = theFloorInfo->GetRequest(mCurrEquipID); @@ -1235,7 +1237,7 @@ BOOL T2People::GetInterviewWords(T2TowerDoc* towerDoc, CString& outStr) { optionEvent.people = this; optionEvent.str = &outStr; - DispatchOptionEvent(OptionEventType_12, &optionEvent); + DispatchOptionEvent(kPostInterviewWordsOptionEvent, &optionEvent); return outStr != ""; } @@ -1263,7 +1265,7 @@ void T2People::BreakoutEmergency(T2TowerDoc* towerDoc) { break; case kStatus1: if (IsGeneral()) - towerDoc->towerDoc_vf130()->RemovePeople(this); + towerDoc->GetPool()->RemovePeople(this); break; } } @@ -1480,8 +1482,8 @@ void T2People::GetName(CString& outStr) { if (IsWalk()) { CRect rect; if (GetSilhouetteRect(rect)) { - UT2Coordinate::UnitToQD(rect, towerDoc->towerDoc_vf108()); - towerDoc->towerDoc_vf10C()->FillRect(rect, 1); + UT2Coordinate::UnitToQD(rect, towerDoc->GetZoomLevel()); + towerDoc->GetImage()->FillRect(rect, 1); } } } diff --git a/src/T2DLL/T2People.h b/src/T2DLL/T2People.h index 74c63d0..f84f7ca 100644 --- a/src/T2DLL/T2People.h +++ b/src/T2DLL/T2People.h @@ -132,6 +132,7 @@ protected: int CalcFreeTime(unsigned int); BOOL StressChanged(); + friend class DbgPeopleView; friend class T2ElevatorModule; friend class T2FireBurning; friend class T2Guardman; diff --git a/src/T2DLL/T2PeopleArray.cpp b/src/T2DLL/T2PeopleArray.cpp index f60debd..c5f37df 100644 --- a/src/T2DLL/T2PeopleArray.cpp +++ b/src/T2DLL/T2PeopleArray.cpp @@ -4,17 +4,17 @@ T2PeopleArray::T2PeopleArray(unsigned int startID) : T2ObjectArray(startID) { - for (unsigned int i = 0; i < 256; i++) + for (unsigned int i = 0; i < kGroupSize; i++) mPeople[i].mMatterID = mStartID + i; } T2People* T2PeopleArray::FindPeople(unsigned int peopleID) { unsigned int firstID = mPeople[0].GetPeopleID(); - if (firstID > peopleID || (firstID + 256) < peopleID) + if (firstID > peopleID || (firstID + kGroupSize) < peopleID) return NULL; - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].GetPeopleID() == peopleID) return &mPeople[i]; } @@ -23,7 +23,7 @@ T2People* T2PeopleArray::FindPeople(unsigned int peopleID) { } void T2PeopleArray::ResolveLink(T2PeopleArrayList* list) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].ResolveLink(list); } @@ -32,7 +32,7 @@ void T2PeopleArray::ResolveLink(T2PeopleArrayList* list) { T2People* T2PeopleArray::FindUnusedPeople() { T2People *result = NULL; - for (unsigned int i = 0; i < 256; i++) { + for (unsigned int i = 0; i < kGroupSize; i++) { if (!mPeople[i].IsUsed()) { result = &mPeople[i]; break; @@ -47,15 +47,15 @@ T2People* T2PeopleArray::FindUnusedPeople() { T2People *thePeople; thePeople = &mPeople[startIndex]; - for (i = startIndex; i < 256; i += 8) { + for (i = startIndex; i < kGroupSize; i += 8) { if (thePeople->mUsed) thePeople->Idle(towerDoc); thePeople += 8; } thePeople = mPeople; - int theWalkRate = towerDoc->towerDoc_vf148(); - for (i = 0; i < 256; i++) { + int theWalkRate = towerDoc->GetWalkRate(); + for (i = 0; i < kGroupSize; i++) { if (thePeople->mUsed) { if ((theWalkRate > 0 && !(i % theWalkRate)) || thePeople->IsSetSpecialFlag(kSpecialFlag20)) thePeople->IdleSearchedPerson(towerDoc); @@ -66,7 +66,7 @@ T2People* T2PeopleArray::FindUnusedPeople() { void T2PeopleArray::DrawSearchedPerson(T2TowerDoc* towerDoc) { T2People *people = mPeople; - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (people->mUsed && people->IsWalk()) people->DrawSearchedPerson(towerDoc); people++; @@ -74,38 +74,38 @@ void T2PeopleArray::DrawSearchedPerson(T2TowerDoc* towerDoc) { } void T2PeopleArray::SetWalkPeople(int v) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].SetWalk(false); if (v != -1) { - for (int i = 0; i < 256; i += v) + for (int i = 0; i < kGroupSize; i += v) mPeople[i].SetWalk(true); } } void T2PeopleArray::DayChanged() { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].DayChanged(); } } void T2PeopleArray::TenantRemoved(unsigned int v) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].TenantRemoved(v); } } void T2PeopleArray::AddStress(int v) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { if (mPeople[i].IsUsed()) mPeople[i].IncStress(v); } } void T2PeopleArray::BreakoutEmergency(T2TowerDoc* towerDoc) { - for (int i = 0; i < 256; i++) { + for (int i = 0; i < kGroupSize; i++) { T2People *people = &mPeople[i]; if (people->IsUsed()) people->BreakoutEmergency(towerDoc); @@ -113,11 +113,11 @@ void T2PeopleArray::BreakoutEmergency(T2TowerDoc* towerDoc) { } void T2PeopleArray::Read(T2Archive& archive, T2TowerDoc* towerDoc) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].Load(archive, towerDoc); } void T2PeopleArray::Write(T2Archive& archive) { - for (int i = 0; i < 256; i++) + for (int i = 0; i < kGroupSize; i++) mPeople[i].Save(archive); } diff --git a/src/T2DLL/T2PeopleArray.h b/src/T2DLL/T2PeopleArray.h index 8e64e3d..ba692c6 100644 --- a/src/T2DLL/T2PeopleArray.h +++ b/src/T2DLL/T2PeopleArray.h @@ -5,6 +5,8 @@ class AFX_CLASS_EXPORT T2PeopleArray : public T2ObjectArray { public: + enum { kGroupSize = 256 }; + T2PeopleArray(unsigned int startID = 1); virtual ~T2PeopleArray() {} virtual void DispatchIdle(T2TowerDoc*, int); @@ -23,5 +25,7 @@ public: T2People* GetIndexPeople(int i) { return &mPeople[i]; } protected: - T2People mPeople[256]; + T2People mPeople[kGroupSize]; + friend class DbgPeopleView; + friend class T2TowerDoc; }; diff --git a/src/T2DLL/T2PeopleArrayList.h b/src/T2DLL/T2PeopleArrayList.h index 9ace5dc..cd668b7 100644 --- a/src/T2DLL/T2PeopleArrayList.h +++ b/src/T2DLL/T2PeopleArrayList.h @@ -2,7 +2,7 @@ #include "common.h" #include "LArray.h" -class AFX_CLASS_EXPORT T2PeopleArrayList : private LArray { +class AFX_CLASS_EXPORT T2PeopleArrayList : public LArray { public: T2PeopleArrayList(); virtual ~T2PeopleArrayList(); diff --git a/src/T2DLL/T2PeopleDemandList.cpp b/src/T2DLL/T2PeopleDemandList.cpp index f406515..b2085a5 100644 --- a/src/T2DLL/T2PeopleDemandList.cpp +++ b/src/T2DLL/T2PeopleDemandList.cpp @@ -60,7 +60,7 @@ void T2PeopleDemandList::Add(T2PoolGradeDef* inGradeDef) { } } -void T2PeopleDemandList::Init(unsigned int inMonth, unsigned int inSomeNum) { +void T2PeopleDemandList::Init(unsigned int inMonth, unsigned int inHour) { float theRate = 0.0f; if (mSeasonParamDef) theRate = mSeasonParamDef->GetRate(inMonth - 1); @@ -69,7 +69,7 @@ void T2PeopleDemandList::Init(unsigned int inMonth, unsigned int inSomeNum) { T2PeopleTimeZoneList *theTimeZoneList; while (iterator.Next(&theTimeZoneList)) - theTimeZoneList->Init(inSomeNum, theRate); + theTimeZoneList->Init(inHour, theRate); } void T2PeopleDemandList::IncHour(unsigned int inMonth) { diff --git a/src/T2DLL/T2PeopleDemandList.h b/src/T2DLL/T2PeopleDemandList.h index c5cbb6c..8d1ab60 100644 --- a/src/T2DLL/T2PeopleDemandList.h +++ b/src/T2DLL/T2PeopleDemandList.h @@ -2,14 +2,14 @@ #include "common.h" #include "LArray.h" -class AFX_CLASS_EXPORT T2PeopleDemandList : private LArray { +class AFX_CLASS_EXPORT T2PeopleDemandList : public LArray { public: T2PeopleDemandList(T2PoolDef* inPoolDef, T2SeasonParamDef* inSeasonParamDef, T2WorldDef* inWorldDef); T2PeopleDemandList(T2Archive& inArchive, T2SeasonParamDef* inSeasonParamDef, T2WorldDef* inWorldDef); virtual ~T2PeopleDemandList(); void Add(T2PoolGradeDef* gradeDef); - void Init(unsigned int inMonth, unsigned int inSomeNum); + void Init(unsigned int inMonth, unsigned int inHour); void IncHour(unsigned int inMonth); BOOL Find(T2TenantMemberDef* inTenantMemberDef, int inEconoType, unsigned int inTransportType, BOOL inCheckOnlyFirstEconoType) const; BOOL Call(T2TenantMemberDef* inTenantMemberDef, int inEconoType, unsigned int inTransportType, T2PeopleType& outPeopleType) const; diff --git a/src/T2DLL/T2PeopleInfoDialog.cpp b/src/T2DLL/T2PeopleInfoDialog.cpp index 9a3dbc5..8356f71 100644 --- a/src/T2DLL/T2PeopleInfoDialog.cpp +++ b/src/T2DLL/T2PeopleInfoDialog.cpp @@ -29,7 +29,7 @@ T2PeopleInfoDialog::T2PeopleInfoDialog(T2People* people) /*virtual*/ void T2PeopleInfoDialog::OnT2Create() { #pragma var_order(item1040, item1012, item7090, favName, item1030, item1010, item1020, item1011, pplEvalGage, theName, str1, nonFavName, theWorldDef, stressGage, hasAnyName, str2, theTowerDoc, theSilhouettePane, theNameID) T2TowerDoc *theTowerDoc = mTowerDoc; - T2WorldDef *theWorldDef = GetCurrentT2TowerDoc()->towerDoc_vf170(); + T2WorldDef *theWorldDef = GetCurrentT2TowerDoc()->GetWorldDef(); if (mPeople) mPeopleDef = (T2PeopleDef *) mPeople->GetMatterDef(); @@ -282,8 +282,8 @@ CString T2PeopleInfoDialog::GetTenantName(T2TowerDoc* towerDoc, unsigned int inT T2Name *favName = mTowerDoc->mNameDB->Search(mPeople, true); if (favName) { - mTowerDoc->towerDoc_vf1C4(mPeople, false); - mTowerDoc->towerDoc_vf1B8(mPeople); + mTowerDoc->RemoveFavoritePeople(mPeople, false); + mTowerDoc->AddFavoritePeople(mPeople); } } } diff --git a/src/T2DLL/T2PeopleTimeZoneList.cpp b/src/T2DLL/T2PeopleTimeZoneList.cpp index 1b3578a..7fc6d80 100644 --- a/src/T2DLL/T2PeopleTimeZoneList.cpp +++ b/src/T2DLL/T2PeopleTimeZoneList.cpp @@ -10,7 +10,7 @@ T2PeopleTimeZoneList::T2PeopleTimeZoneList(unsigned int someNum, unsigned int is : LArray(sizeof(T2PeopleTypeArray *)) { mIsFixed = isFixed; - _20 = 0; + _20 = false; mHoursPerItem = 0; mCurrentItem = 0; mCurrentHour = 0; @@ -28,7 +28,7 @@ T2PeopleTimeZoneList::T2PeopleTimeZoneList(T2Archive& archive, T2WorldDef* world : LArray(sizeof(T2PeopleTypeArray *)) { #pragma var_order(uc, c, i, count) - _20 = 0; + _20 = false; mWorldDef = worldDef; int count; @@ -89,9 +89,9 @@ void T2PeopleTimeZoneList::Add(T2PeopleType* inPeopleType, T2PoolDefDemandElem* } } -void T2PeopleTimeZoneList::Init(unsigned int someNum, float limit) { - mCurrentItem = someNum / mHoursPerItem; - mCurrentHour = someNum % mHoursPerItem; +void T2PeopleTimeZoneList::Init(unsigned int inHour, float limit) { + mCurrentItem = inHour / mHoursPerItem; + mCurrentHour = inHour % mHoursPerItem; T2PeopleTypeArray *array; LArrayIterator iterator(*this); diff --git a/src/T2DLL/T2PeopleTimeZoneList.h b/src/T2DLL/T2PeopleTimeZoneList.h index 1b00721..2f90b65 100644 --- a/src/T2DLL/T2PeopleTimeZoneList.h +++ b/src/T2DLL/T2PeopleTimeZoneList.h @@ -8,7 +8,7 @@ public: T2PeopleTimeZoneList(T2Archive&, T2WorldDef*); virtual ~T2PeopleTimeZoneList(); void Add(T2PeopleType* inPeopleType, T2PoolDefDemandElem* inDemandElem); - void Init(unsigned int someNum, float limit); + void Init(unsigned int inHour, float limit); void IncHour(float limit); BOOL Find(T2TenantMemberDef* inTenantMemberDef, int inEconoType, unsigned int inTransportType, BOOL inCheckOnlyFirstEconoType) const; BOOL Call(T2TenantMemberDef* inTenantMemberDef, int inEconoType, unsigned int inTransportType, T2PeopleType& outPeopleType); @@ -25,12 +25,14 @@ protected: int GetNumOfTimeZone() const; - int _20; + BOOL _20; BOOL mIsFixed; int mHoursPerItem; int mCurrentItem; int mCurrentHour; T2WorldDef *mWorldDef; + + friend class T2PoolView; }; inline BOOL T2PeopleTimeZoneList::IsFixed() const { diff --git a/src/T2DLL/T2PeopleType.h b/src/T2DLL/T2PeopleType.h index f38535a..b2d2969 100644 --- a/src/T2DLL/T2PeopleType.h +++ b/src/T2DLL/T2PeopleType.h @@ -76,6 +76,8 @@ protected: int mEconoType; int mLife; int mTransportType; + + friend class T2PoolView; }; inline void T2PeopleType::SetSilhouetteType(int v) { diff --git a/src/T2DLL/T2PeopleTypeArray.cpp b/src/T2DLL/T2PeopleTypeArray.cpp index 4b2c645..1512ae6 100644 --- a/src/T2DLL/T2PeopleTypeArray.cpp +++ b/src/T2DLL/T2PeopleTypeArray.cpp @@ -8,14 +8,14 @@ T2PeopleTypeArray::T2PeopleTypeArray(unsigned int val) : LArray(sizeof(T2PeopleType)) { m24 = val; - m20 = 0; + m20 = false; InitSearchLimit(1.0f); } T2PeopleTypeArray::T2PeopleTypeArray(T2Archive& archive) : LArray(sizeof(T2PeopleType)) { - m20 = 0; + m20 = false; Read(archive); } diff --git a/src/T2DLL/T2PeopleTypeArray.h b/src/T2DLL/T2PeopleTypeArray.h index 2fa8cad..48c4a2a 100644 --- a/src/T2DLL/T2PeopleTypeArray.h +++ b/src/T2DLL/T2PeopleTypeArray.h @@ -18,8 +18,10 @@ public: protected: void Read(T2Archive&); - int m20; + BOOL m20; unsigned int m24; int m28; int m2C; + + friend class T2PoolView; }; diff --git a/src/T2DLL/T2PluginLoader.cpp b/src/T2DLL/T2PluginLoader.cpp index 9018012..345d92e 100644 --- a/src/T2DLL/T2PluginLoader.cpp +++ b/src/T2DLL/T2PluginLoader.cpp @@ -1,5 +1,5 @@ -#include "CT2App.h" #include "GlobalFunc.h" +#include "T2.h" #include "T2DLL.h" #include "T2PluginLoader.h" #include "T2PluginSpecifier.h" diff --git a/src/T2DLL/T2Pool.cpp b/src/T2DLL/T2Pool.cpp index 8d280c2..007735c 100644 --- a/src/T2DLL/T2Pool.cpp +++ b/src/T2DLL/T2Pool.cpp @@ -14,7 +14,7 @@ #include "T2TenantMemberTableDef.h" #include "T2WorldDef.h" -T2Pool::T2Pool(T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, int inLevel, unsigned int inIndex, unsigned int inSomeNum, T2WorldDef* inWorldDef) { +T2Pool::T2Pool(T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, int inLevel, unsigned int inMonth, unsigned int inHour, T2WorldDef* inWorldDef) { mLevel = 0; mSpecialFlag = inDef->Get20(); mPopulation = 0; @@ -29,7 +29,7 @@ T2Pool::T2Pool(T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginLis for (int level = 1; level <= inLevel; level++) GameLevelChanged(level); - mDemandList->Init(inIndex, inSomeNum); + mDemandList->Init(inMonth, inHour); } T2Pool::T2Pool(T2Archive& inArchive, T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, T2WorldDef* inWorldDef) { diff --git a/src/T2DLL/T2Pool.h b/src/T2DLL/T2Pool.h index 54489f9..d874d2c 100644 --- a/src/T2DLL/T2Pool.h +++ b/src/T2DLL/T2Pool.h @@ -3,7 +3,7 @@ class AFX_CLASS_EXPORT T2Pool { public: - T2Pool(T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, int inLevel, unsigned int inIndex, unsigned int inSomeNum, T2WorldDef* inWorldDef); + T2Pool(T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, int inLevel, unsigned int inMonth, unsigned int inHour, T2WorldDef* inWorldDef); T2Pool(T2Archive& inArchive, T2PoolDef* inDef, T2SeasonParamDef* inSeason, T2TemplatePluginList* inPluginList, T2PeopleArrayList* inPeopleList, T2WorldDef* inWorldDef); virtual ~T2Pool(); void GameLevelChanged(int inLevel); @@ -36,6 +36,8 @@ protected: T2PoolDef *mPoolDef; T2TemplatePluginList *mPlugins; T2PeopleArrayList *mPeopleList; + + friend class T2PoolView; }; inline int T2Pool::GetPopulation() const { diff --git a/src/T2DLL/T2Request.cpp b/src/T2DLL/T2Request.cpp index 3ff951a..83c52f3 100644 --- a/src/T2DLL/T2Request.cpp +++ b/src/T2DLL/T2Request.cpp @@ -63,8 +63,8 @@ void T2Request::InitRequest(T2FloorInfo* floorInfo, unsigned int moverID, POINT } void T2Request::RemoveRequest(T2TowerDoc* towerDoc) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); - T2TowerMainView *theView = towerDoc->GetTowerMainView(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); + T2TowerMainView *theView = towerDoc->GetMainView(); RemoveContents(theFloorInfo); @@ -83,7 +83,7 @@ void T2Request::RemoveRequest(T2TowerDoc* towerDoc) { theFloorInfo->SetTenantDrawModeByRect(thePrevArea, DrawMode1); if (theView) - theView->tmv_vf128(theNextArea, false); + theView->InvalUnitRect(theNextArea, false); } void T2Request::RemoveContents(T2FloorInfo* floorInfo) { @@ -113,7 +113,7 @@ void T2Request::RemoveContents(T2FloorInfo* floorInfo) { } void T2Request::StopRemoved(T2TowerDoc* towerDoc, int y) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); T2Tenant *theFloor = theFloorInfo->GetFloor(mHeadPosition.y, mHeadPosition.x); #line 138 _ASSERT(theFloor != NULL); @@ -314,7 +314,7 @@ T2People* T2Request::LeaveFirst() { BOOL T2Request::Regist(T2TowerDoc* towerDoc, T2People* people) { BOOL isRegist = false; - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); POINT headPt = mHeadPosition; POINT curPt = people->GetCurPosition(); @@ -417,7 +417,7 @@ T2People* T2Request::RemoveOffPeople() { /*virtual*/ unsigned int T2Request::Idle(T2TowerDoc* towerDoc) { unsigned int result = 0; - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); if (mNumOfContent > 0 && !IsModuleReserved()) { T2Mover *theMover = theFloorInfo->GetMover(mMoverID); @@ -425,7 +425,7 @@ T2People* T2Request::RemoveOffPeople() { theMover->SetCheckRequest(true); } - T2TowerMainView *theView = towerDoc->GetTowerMainView(); + T2TowerMainView *theView = towerDoc->GetMainView(); #line 541 _ASSERT(theView != NULL); @@ -434,20 +434,20 @@ T2People* T2Request::RemoveOffPeople() { if (mPeopleRemoved) { CalcOnArea(area); theFloorInfo->SetTenantDrawModeByRect(area, DrawMode1); - theView->tmv_vf128(area, false); + theView->InvalUnitRect(area, false); } else if (mOnPeople || mOffPeople) { CalcOnArea(area); - theView->tmv_vf128(area, false); + theView->InvalUnitRect(area, false); } if (m44) { CalcPrevArea(area); theFloorInfo->SetTenantDrawModeByRect(area, DrawMode1); - theView->tmv_vf128(area, false); + theView->InvalUnitRect(area, false); } if (CalcIncQueueArea(area)) - theView->tmv_vf128(area, false); + theView->InvalUnitRect(area, false); return result; } @@ -522,7 +522,7 @@ void* T2Request::GetInfoClickDown(T2TowerDoc*, POINT) { } void T2Request::BreakoutEmergency(T2TowerDoc* towerDoc) { - RemoveContents(towerDoc->towerDoc_vf12C()); + RemoveContents(towerDoc->GetFloorInfo()); } /*virtual*/ void T2Request::LoadSelf(T2Archive& archive, T2TowerDoc* towerDoc) { @@ -774,6 +774,6 @@ void T2Request::CalcValidArea(RECT& rect) { /*virtual*/ void T2Request::DrawHitMask(T2TowerDoc* towerDoc) { RECT area; CalcValidArea(area); - UT2Coordinate::UnitToQD(area, towerDoc->towerDoc_vf108()); - towerDoc->towerDoc_vf10C()->FillRect(area, 1); + UT2Coordinate::UnitToQD(area, towerDoc->GetZoomLevel()); + towerDoc->GetImage()->FillRect(area, 1); } diff --git a/src/T2DLL/T2Request.h b/src/T2DLL/T2Request.h index 95da6e5..d946d97 100644 --- a/src/T2DLL/T2Request.h +++ b/src/T2DLL/T2Request.h @@ -60,8 +60,9 @@ protected: T2People* FindUpPeople(int) const; T2People* FindDownPeople(int) const; - friend class T2RequestArray; friend class T2ElevatorModule; + friend class T2RequestArray; + friend class T2TowerMainView; unsigned int mRequestID; unsigned int mMoverID; diff --git a/src/T2DLL/T2RequestIDArray.cpp b/src/T2DLL/T2RequestIDArray.cpp index 8758856..14236cd 100644 --- a/src/T2DLL/T2RequestIDArray.cpp +++ b/src/T2DLL/T2RequestIDArray.cpp @@ -70,7 +70,7 @@ BOOL T2RequestIDArray::IsStopPosition(int index) const { void T2RequestIDArray::RemoveRequest(T2TowerDoc* towerDoc, int index, ERequestUpDown upDown) { unsigned int requestID = GetRequestIDAt(index, upDown); if (requestID) { - T2FloorInfo *floorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = towerDoc->GetFloorInfo(); if (floorInfo) { T2Request *request = floorInfo->GetRequest(requestID); if (request) @@ -100,7 +100,7 @@ void T2RequestIDArray::MoverIDChanged(T2FloorInfo* floorInfo, unsigned int mover } void T2RequestIDArray::StopRemoved(T2TowerDoc* towerDoc, int y) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); #line 142 _ASSERT(theFloorInfo != NULL); @@ -117,7 +117,7 @@ void T2RequestIDArray::StopRemoved(T2TowerDoc* towerDoc, int y) { } void T2RequestIDArray::ModuleRemoved(T2TowerDoc* towerDoc, unsigned int moduleIndex) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); LArrayIterator iterator(*this); unsigned int theReqID; diff --git a/src/T2DLL/T2SantaClaus.cpp b/src/T2DLL/T2SantaClaus.cpp index 4aaa59d..37f34c3 100644 --- a/src/T2DLL/T2SantaClaus.cpp +++ b/src/T2DLL/T2SantaClaus.cpp @@ -55,7 +55,7 @@ T2SantaClaus::T2SantaClaus(T2TowerEvent* inTowerEvent, CResFile* inResFile, int } /*virtual*/ BOOL T2SantaClaus::Start(T2TowerDoc* inDoc) { - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); m48 = theNow ? (theNow->GetRawMinutes() - mBeginTime) : 0; m4C = -6; @@ -90,7 +90,7 @@ T2SantaClaus::T2SantaClaus(T2TowerEvent* inTowerEvent, CResFile* inResFile, int mSprite->ShowSprite(mSpriteID, true); mVisible = true; - mMainView = inDoc->GetTowerMainView(); + mMainView = inDoc->GetMainView(); if (mMainView) { mAttach = new T2SantaClausAttach(this, 0, true); mMainView->AddAttachment(mAttach, NULL, true); @@ -107,7 +107,7 @@ T2SantaClaus::T2SantaClaus(T2TowerEvent* inTowerEvent, CResFile* inResFile, int /*virtual*/ int T2SantaClaus::Exec(T2TowerDoc* inDoc) { if (!mMainView) - mMainView = inDoc->GetTowerMainView(); + mMainView = inDoc->GetMainView(); if (!mMainView) return 0; @@ -128,7 +128,7 @@ T2SantaClaus::T2SantaClaus(T2TowerEvent* inTowerEvent, CResFile* inResFile, int CRect intersect; mMainView->GetClientRect(viewArea); - viewArea.OffsetRect(mMainView->m64); + viewArea.OffsetRect(mMainView->mScrollOffset); spriteArea.SetRect(position.x, position.y, position.x + mSpriteHeight, position.y + mSpriteWidth); @@ -205,16 +205,16 @@ T2SantaClausAttach::T2SantaClausAttach(T2SantaClaus* inOwner, unsigned int inMes if (inMessage == WM_LBUTTONDOWN) { MSG *messagePtr = (MSG *) ioData; - int id = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetSel(); - CString *theIconName = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconName(id); - T2TemplatePlugin *theTemplatePlugin = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconPlugin(id); + int id = T2_MAIN_WINDOW->mToolWindow->GetSel(); + CString *theIconName = T2_MAIN_WINDOW->mToolWindow->GetIconName(id); + T2TemplatePlugin *theTemplatePlugin = T2_MAIN_WINDOW->mToolWindow->GetIconPlugin(id); CProgramPlugin *theIconProgramPlugin = theTemplatePlugin->GetPlugin(); - unsigned int theIconValiation = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconValiation(id); - DWORD theIconOption = ((T2MainWindow *) AfxGetMainWnd())->mToolWindow->GetIconOption(id); + unsigned int theIconValiation = T2_MAIN_WINDOW->mToolWindow->GetIconValiation(id); + DWORD theIconOption = T2_MAIN_WINDOW->mToolWindow->GetIconOption(id); - if (theIconOption == 0 && *theIconName == "ToolInfo") { + if (theIconOption == kToolOption0 && *theIconName == "ToolInfo") { CPoint pt(LOWORD(messagePtr->lParam), HIWORD(messagePtr->lParam)); - pt.Offset(GetCurrentT2TowerDoc()->GetTowerMainView()->m64); + pt.Offset(GetCurrentT2TowerDoc()->GetMainView()->mScrollOffset); if (mOwner) { CRect rect; diff --git a/src/T2DLL/T2Settlement.cpp b/src/T2DLL/T2Settlement.cpp index 4f84841..30ea8e5 100644 --- a/src/T2DLL/T2Settlement.cpp +++ b/src/T2DLL/T2Settlement.cpp @@ -72,24 +72,24 @@ T2Archive& T2Settlement::Write(T2Archive& archive) const { archive << m18; archive << m1C; - archive << (unsigned int) mDocument->towerDoc_vf178()->GetCount(); - LArrayIterator theTenantIter(*mDocument->towerDoc_vf178()); + archive << (unsigned int) mDocument->GetTenantTemplates()->GetCount(); + LArrayIterator theTenantIter(*mDocument->GetTenantTemplates()); T2TenantDef *theTenantDef = NULL; while (theTenantIter.Next(&theTenantDef)) { archive << (short) theTenantDef->GetToolType(); archive << theTenantDef->mSettlement; } - archive << (unsigned int) mDocument->towerDoc_vf17C()->GetCount(); - LArrayIterator theMoverIter(*mDocument->towerDoc_vf17C()); + archive << (unsigned int) mDocument->GetMoverTemplates()->GetCount(); + LArrayIterator theMoverIter(*mDocument->GetMoverTemplates()); T2MoverDef *theMoverDef = NULL; while (theMoverIter.Next(&theMoverDef)) { archive << (short) theMoverDef->GetToolType(); archive << theMoverDef->mSettlement; } - archive << (unsigned int) mDocument->towerDoc_vf180()->GetCount(); - LArrayIterator theOuterObjIter(*mDocument->towerDoc_vf180()); + archive << (unsigned int) mDocument->GetOuterObjTemplates()->GetCount(); + LArrayIterator theOuterObjIter(*mDocument->GetOuterObjTemplates()); T2OuterObjDef *theOuterObjDef = NULL; while (theOuterObjIter.Next(&theOuterObjDef)) { archive << (short) theOuterObjDef->GetToolType(); @@ -136,7 +136,7 @@ void T2Settlement::DoPayTool(int funds, short fundGroup, T2ToolDef* inToolDef) { void T2Settlement::EmitPayToolMessage(T2TowerDoc* towerDoc, T2ToolDef* inToolDef, const CString& str, int length, int type) { BOOL canPay = true; - T2DateTime *theNow = towerDoc->towerDoc_vf120(); + T2DateTime *theNow = towerDoc->GetNow(); #line 197 _ASSERT(theNow != NULL); @@ -226,13 +226,13 @@ T2DateTime* T2Settlement::FindCategoryTimeLimit(T2TowerDoc* inDoc, T2ToolDef* in switch (theCategory) { default: - thePluginList = inDoc->towerDoc_vf178(); + thePluginList = inDoc->GetTenantTemplates(); break; case 20: - thePluginList = inDoc->towerDoc_vf17C(); + thePluginList = inDoc->GetMoverTemplates(); break; case 200: - thePluginList = inDoc->towerDoc_vf180(); + thePluginList = inDoc->GetOuterObjTemplates(); break; } @@ -261,13 +261,13 @@ void T2Settlement::LinkCategoryTimeLimit(T2TowerDoc* inDoc, T2ToolDef* inToolDef switch (theCategory) { default: - thePluginList = inDoc->towerDoc_vf178(); + thePluginList = inDoc->GetTenantTemplates(); break; case 20: - thePluginList = inDoc->towerDoc_vf17C(); + thePluginList = inDoc->GetMoverTemplates(); break; case 200: - thePluginList = inDoc->towerDoc_vf180(); + thePluginList = inDoc->GetOuterObjTemplates(); break; } @@ -365,7 +365,7 @@ int T2Settlement::GetCategorySettlement(int inCategory) const { switch (inCategory) { default: { - LArrayIterator theTenantIter(*mDocument->towerDoc_vf178()); + LArrayIterator theTenantIter(*mDocument->GetTenantTemplates()); T2ToolDef *theTenantDef = NULL; while (theTenantIter.Next(&theTenantDef)) { if (theTenantDef->GetCategory() == inCategory) @@ -375,7 +375,7 @@ int T2Settlement::GetCategorySettlement(int inCategory) const { } case 20: { - LArrayIterator theMoverIter(*mDocument->towerDoc_vf17C()); + LArrayIterator theMoverIter(*mDocument->GetMoverTemplates()); T2ToolDef *theMoverDef = NULL; while (theMoverIter.Next(&theMoverDef)) { result += theMoverDef->mSettlement; @@ -384,7 +384,7 @@ int T2Settlement::GetCategorySettlement(int inCategory) const { } case 200: { - LArrayIterator theOuterObjIter(*mDocument->towerDoc_vf180()); + LArrayIterator theOuterObjIter(*mDocument->GetOuterObjTemplates()); T2ToolDef *theOuterObjDef = NULL; while (theOuterObjIter.Next(&theOuterObjDef)) { result += theOuterObjDef->mSettlement; @@ -422,19 +422,19 @@ void T2Settlement::Update() { m18 = 0; m1C = 0; - LArrayIterator theTenantIter(*mDocument->towerDoc_vf178()); + LArrayIterator theTenantIter(*mDocument->GetTenantTemplates()); T2TenantDef *theTenantDef = NULL; while (theTenantIter.Next(&theTenantDef)) { theTenantDef->mSettlement = 0; } - LArrayIterator theMoverIter(*mDocument->towerDoc_vf17C()); + LArrayIterator theMoverIter(*mDocument->GetMoverTemplates()); T2MoverDef *theMoverDef = NULL; while (theMoverIter.Next(&theMoverDef)) { theMoverDef->mSettlement = 0; } - LArrayIterator theOuterObjIter(*mDocument->towerDoc_vf180()); + LArrayIterator theOuterObjIter(*mDocument->GetOuterObjTemplates()); T2OuterObjDef *theOuterObjDef = NULL; while (theOuterObjIter.Next(&theOuterObjDef)) { theOuterObjDef->mSettlement = 0; diff --git a/src/T2DLL/T2SoundPlayer.cpp b/src/T2DLL/T2SoundPlayer.cpp index 8c06ec9..523b741 100644 --- a/src/T2DLL/T2SoundPlayer.cpp +++ b/src/T2DLL/T2SoundPlayer.cpp @@ -221,7 +221,7 @@ void T2SoundPlayer::Play(const CString& inName, unsigned int inMask, unsigned in int pan = 0; if (inPt) { CRect rect; - GetCurrentT2TowerDoc()->GetTowerMainView()->tmv_vf140(rect); + GetCurrentT2TowerDoc()->GetMainView()->GetVisibleUnitRect(rect); POINT centerPt = rect.CenterPoint(); float x = ((float) (inPt->x - centerPt.x) / (float) ((rect.right - rect.left) / 2)); diff --git a/src/T2DLL/T2SoundPlayer.h b/src/T2DLL/T2SoundPlayer.h index 344917d..667ac13 100644 --- a/src/T2DLL/T2SoundPlayer.h +++ b/src/T2DLL/T2SoundPlayer.h @@ -14,11 +14,13 @@ enum SOUNDPRIORITY { }; enum { - SoundMask_10 = 0x10 + SoundMask_10 = 0x10, + SoundMask_20 = 0x20, }; enum { SoundFlags_10 = 0x10, + SoundFlags_20 = 0x20, SoundFlags_10000 = 0x10000 }; diff --git a/src/T2DLL/T2Sprite.h b/src/T2DLL/T2Sprite.h index 3210f11..32748d3 100644 --- a/src/T2DLL/T2Sprite.h +++ b/src/T2DLL/T2Sprite.h @@ -2,7 +2,7 @@ #include "common.h" #include "T2SpriteObj.h" -class AFX_CLASS_EXPORT T2Sprite : private CList<T2SpriteObj *, T2SpriteObj *> { +class AFX_CLASS_EXPORT T2Sprite : protected CList<T2SpriteObj *, T2SpriteObj *> { public: T2Sprite(); virtual ~T2Sprite(); @@ -34,4 +34,6 @@ private: void AddUpdateRect(T2SpriteObj* obj, POINT pt); RECT mUpdateRect; + + friend class T2TowerDoc; }; diff --git a/src/T2DLL/T2StairModule.cpp b/src/T2DLL/T2StairModule.cpp index ec2e5c3..e172798 100644 --- a/src/T2DLL/T2StairModule.cpp +++ b/src/T2DLL/T2StairModule.cpp @@ -26,7 +26,7 @@ void T2StairModule::MoverIDChanged(unsigned int moverID) { } /*virtual*/ void T2StairModule::RemoveContents(T2TowerDoc* towerDoc) { - T2FloorInfo *theFloorInfo = towerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = towerDoc->GetFloorInfo(); while (mLink1) { T2People *thePeople = (T2People *) mLink1; diff --git a/src/T2DLL/T2TemplatePluginList.h b/src/T2DLL/T2TemplatePluginList.h index 6bcb21c..0e1673a 100644 --- a/src/T2DLL/T2TemplatePluginList.h +++ b/src/T2DLL/T2TemplatePluginList.h @@ -2,7 +2,7 @@ #include "common.h" #include "LArray.h" -class AFX_CLASS_EXPORT T2TemplatePluginList : private LArray { +class AFX_CLASS_EXPORT T2TemplatePluginList : public LArray { public: T2TemplatePluginList(DWORD pluginType); virtual ~T2TemplatePluginList(); diff --git a/src/T2DLL/T2Tenant.cpp b/src/T2DLL/T2Tenant.cpp index cec110b..0a29db6 100644 --- a/src/T2DLL/T2Tenant.cpp +++ b/src/T2DLL/T2Tenant.cpp @@ -108,13 +108,13 @@ void T2Tenant::SetFloorID(T2FloorInfo* inFloorInfo) { if (theFloorInfo) { if (IsFloor()) { - inDoc->towerDoc_vf124()->FloorRemoved(this, false); + inDoc->GetRouteNavi()->FloorRemoved(this, false); theFloorInfo->FillTenantID(outRect, 0); outRect.left -= theFloorInfo->GetEntranceWidth(); outRect.right += theFloorInfo->GetEntranceWidth(); } else { RemovePeople(inDoc); - inDoc->towerDoc_vf268(this); + inDoc->TenantRemoved(this); RECT rect = outRect; rect.top = rect.bottom - 1; @@ -281,21 +281,21 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) { } /*virtual*/ void T2Tenant::Draw(T2TowerDoc* inDoc, const RECT& inRect) { - if (inDoc->mViewMode != ViewMode_1 && IsFire() && !IsFloor()) { - inDoc->towerDoc_vf170()->DrawRubble(inDoc, this); + if (inDoc->mViewMode != kOutView && IsFire() && !IsFloor()) { + inDoc->GetWorldDef()->DrawRubble(inDoc, this); } else { GetEquipDef()->DrawProc(this, inRect, inDoc); if (true) GetEquipDef()->DrawPeople(inDoc, this); - if (mMark > -1 && inDoc->towerDoc_vf140() != ViewMode_1) { + if (mMark > -1 && inDoc->GetViewMode() != kOutView) { T2WorldDef *theWorldDef = inDoc->mWorldDef; if (theWorldDef) { RECT equipArea, qdRect; GetEquipArea(equipArea); UT2Coordinate::UnitToQD(equipArea, qdRect, inDoc->mZoomLevel); - theWorldDef->DrawMark(inDoc->towerDoc_vf10C(), qdRect, inDoc->towerDoc_vf108(), mMark); + theWorldDef->DrawMark(inDoc->GetImage(), qdRect, inDoc->GetZoomLevel(), mMark); } } } @@ -304,10 +304,10 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) { if (theWorldDef->IsBlackOut()) { CRect rect = mArea; DrawColorMesh(inDoc, rect, 1); - } else if (inDoc->towerDoc_vf140() == ViewMode_5) { + } else if (inDoc->GetViewMode() == kTransView) { CRect rect = inRect; DrawTrafficColor(inDoc, rect); - } else if (inDoc->towerDoc_vf140() != ViewMode_0) { + } else if (inDoc->GetViewMode() != kInView) { DrawViewModeColor(inDoc); } @@ -326,7 +326,7 @@ void T2Tenant::LeaveTenant(T2TowerDoc* inDoc, T2People* inPeople) { unsigned int result = GetEquipDef()->IdleProc(this, inDoc); if (result != -1 && result > 0) { - inDoc->GetTowerMainView()->tmv_vf128(mArea); + inDoc->GetMainView()->InvalUnitRect(mArea); mDrawMode = DrawMode1; } @@ -666,7 +666,7 @@ void T2Tenant::StartBuild() { mStatus = kTenantStatus1; } else { mStatus = kTenantStatus2; - mTenantNumber = GetCurrentT2TowerDoc()->towerDoc_vf27C(mArea.bottom - 1); + mTenantNumber = GetCurrentT2TowerDoc()->GetNextTenantNumber(mArea.bottom - 1); } ((T2TenantDef *) GetEquipDef())->BuildStartProc(GetCurrentT2TowerDoc(), this); @@ -693,7 +693,7 @@ int T2Tenant::CollectCustomerFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef* unsigned int checkRoute = CheckRouteFromPool(inDoc, searchScore); if (checkRoute > 0) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); unsigned int restCapacity = CalcRestCapacity(); int econoType = inTable->GetEconoType(); @@ -731,7 +731,7 @@ int T2Tenant::CollectCustomerFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef* int T2Tenant::CollectCustomerFromTenant(T2TowerDoc* inDoc, T2TenantMemberTableDef* inTable, unsigned int inTime) { int numCustomer = 0; - T2RouteNavigator *theNavi = inDoc->towerDoc_vf124(); + T2RouteNavigator *theNavi = inDoc->GetRouteNavi(); T2Tenant *theNearTenant = theNavi->SelectNearTenant(GetEntrancePt(), inTable->GetScore(T2PlaceParamDef::Place_1)); if (theNearTenant) { @@ -772,7 +772,7 @@ int T2Tenant::CollectCustomerFromTenant(T2TowerDoc* inDoc, T2TenantMemberTableDe int T2Tenant::CollectCustomerFromFloor(T2TowerDoc* inDoc, T2TenantMemberTableDef* inTable, unsigned int inTime) { int numCustomer = 0; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); unsigned int theEntranceFloorID = GetEntranceFloorID(); T2Tenant *theFloor = theFloorInfo->GetTenant(theEntranceFloorID); @@ -817,7 +817,7 @@ int T2Tenant::CollectCustomerFromFloor(T2TowerDoc* inDoc, T2TenantMemberTableDef void T2Tenant::CollectCustomer(T2TowerDoc* inDoc, T2Tenant* inTenant) { if (!WillBeFull()) { - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); if (theNow->WithinMinutes(GetOpenTime(), GetCloseTime() - GetBindTime() - 60)) { T2TenantMemberTableDef *theTable = GetCustomerTableDef(true); if (theTable) { @@ -913,7 +913,7 @@ void T2Tenant::PushOutPeople(T2TowerDoc* inDoc, T2People* inPeople) { if (inPeople->IsSetReturn()) inPeople->SetReturnToDestination(); else - inPeople->SetDestination(inPeople->mHomeTenant, inDoc->towerDoc_vf120()->GetRawMinutes() + 180); + inPeople->SetDestination(inPeople->mHomeTenant, inDoc->GetNow()->GetRawMinutes() + 180); } LeaveTenant(inDoc, inPeople); @@ -1068,7 +1068,7 @@ int T2Tenant::GetNumOfKind() const { /*virtual*/ void T2Tenant::SetUsed(BOOL used) { if (!used && IsFavorite()) - GetCurrentT2TowerDoc()->towerDoc_vf1CC(this, false); + GetCurrentT2TowerDoc()->RemoveFavoriteTenant(this, false); T2Equip::SetUsed(used); @@ -1146,13 +1146,13 @@ void T2Tenant::Destruct(T2TowerDoc* inDoc, CRect& outRect) { T2FloorInfo *theFloorInfo = inDoc->mFloorInfo; if (theFloorInfo) { if (IsFloor()) { - inDoc->towerDoc_vf124()->FloorRemoved(this, false); + inDoc->GetRouteNavi()->FloorRemoved(this, false); theFloorInfo->FillTenantID(outRect, 0); outRect.left -= theFloorInfo->GetEntranceWidth(); outRect.right += theFloorInfo->GetEntranceWidth(); } else { RemovePeople(inDoc); - inDoc->towerDoc_vf268(this); + inDoc->TenantRemoved(this); RECT rect = outRect; rect.top = rect.bottom - 1; @@ -1297,7 +1297,7 @@ BOOL T2Tenant::IsWithinSearchRange(T2TowerDoc* inDoc, T2Tenant* inTenant) const BOOL result = false; if (inTenant) { - T2RouteNavigator *theNavi = inDoc->towerDoc_vf124(); + T2RouteNavigator *theNavi = inDoc->GetRouteNavi(); T2TenantMemberTableDef *theTable = inTenant->GetCustomerTableDef(true); if (theTable) { @@ -1339,7 +1339,7 @@ int T2Tenant::GetRoomNumber(T2FloorInfo* inFloorInfo) const { void T2Tenant::GetRoomName(T2TowerDoc* inDoc, CString& outStr) const { CString roomNum; - UT2Utils::GetRoomNumberString(inDoc->towerDoc_vf12C()->UnitToFloor(mArea.bottom - 1), roomNum); + UT2Utils::GetRoomNumberString(inDoc->GetFloorInfo()->UnitToFloor(mArea.bottom - 1), roomNum); outStr += roomNum; outStr += "\x8A\x4B"; @@ -1359,9 +1359,9 @@ void T2Tenant::GetRoomName(T2TowerDoc* inDoc, CString& outStr) const { } /*virtual*/ void T2Tenant::PlaySound(T2TowerDoc* inDoc, int inID, unsigned int inMask, unsigned int inFlags) const { - if (inDoc->towerDoc_vf15C(mArea)) { + if (inDoc->IsRectInView(mArea)) { T2EquipDef *theDef = GetEquipDef(); - T2SoundPlayer *thePlayer = inDoc->towerDoc_vf134(); + T2SoundPlayer *thePlayer = inDoc->GetSoundPlayer(); if (theDef && thePlayer) { CRect rect; GetEquipArea(rect); @@ -1423,11 +1423,11 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const { T2Tenant *tenant; int color = -1; - switch (inDoc->towerDoc_vf140()) { - case ViewMode_2: + switch (inDoc->GetViewMode()) { + case kEvalView: color = CalcEstimateColor(); break; - case ViewMode_3: + case kPriceView: switch (GetPriceIndex()) { case 4: color = 9; @@ -1443,12 +1443,12 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const { break; } break; - case ViewMode_4: + case kMaintView: if (GetRegistID() == kTenantRegistID1 && GetStatus() >= kTenantStatus35) color = 9; break; case ViewMode_6: - tenant = inDoc->towerDoc_vf18C(); + tenant = inDoc->GetSearchRangeFrom(); if (tenant) { if (this == tenant) color = 14; @@ -1465,7 +1465,7 @@ void T2Tenant::DrawViewModeColor(T2TowerDoc* inDoc) const { } void T2Tenant::DrawTrafficColor(T2TowerDoc* inDoc, const CRect& inRect) const { - T2TrafficInfo *theTrafficInfo = inDoc->towerDoc_vf150(); + T2TrafficInfo *theTrafficInfo = inDoc->GetTrafficInfo(); CRect rect1 = inRect; if (inRect.Height() > 1) { @@ -1512,7 +1512,7 @@ void T2Tenant::DrawTrafficColor(T2TowerDoc* inDoc, const CRect& inRect) const { CRect qdRect; UT2Coordinate::UnitToQD(inRect, qdRect, inDoc->mZoomLevel); - inDoc->towerDoc_vf10C()->FillMesh(qdRect, T2PaletteAnimeDef::GetCommonColor(inClr)); + inDoc->GetImage()->FillMesh(qdRect, T2PaletteAnimeDef::GetCommonColor(inClr)); } void T2Tenant::IncPeopleEstimate(int inEstimate) { @@ -1543,12 +1543,12 @@ BOOL T2Tenant::CollectEmployeeFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef BOOL found = false; int searchScore = inTable->GetScore(T2PlaceParamDef::Place_0); - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); - T2RouteNavigator *theNavigator = inDoc->towerDoc_vf124(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); + T2RouteNavigator *theNavigator = inDoc->GetRouteNavi(); unsigned int checkRoute = CheckRouteFromPool(inDoc, searchScore); if (checkRoute > 0) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); int econoType = inTable->GetEconoType(); BOOL checkOnlyFirstEconoType = inTable->IsCheckOnlyFirstEconoType(); if (thePool->Find(inTable, econoType, checkRoute, checkOnlyFirstEconoType)) { @@ -1567,7 +1567,7 @@ BOOL T2Tenant::CollectEmployeeFromPool(T2TowerDoc* inDoc, T2TenantMemberTableDef found = true; - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); mResideDay = theNow->CalcTotalDays(); } } @@ -1587,23 +1587,23 @@ BOOL T2Tenant::IsRegist() const { unsigned int T2Tenant::CheckRouteFromPool(T2TowerDoc* inDoc, unsigned int inScore) const { unsigned int checkRoute = 0; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); - T2RouteNavigator *theNavi = inDoc->towerDoc_vf124(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); + T2RouteNavigator *theNavi = inDoc->GetRouteNavi(); POINT entrancePt = GetEntrancePt(); if (theNavi->CheckRoute(theFloorInfo->GetEntrancePt(1000), entrancePt, inScore)) checkRoute |= kTransportFlagLobbyLeft | kTransportFlagLobbyRight; - T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB(); T2Tenant *theEmptyParking = theDB->FindEmptyParking(); if (theEmptyParking) { if (theNavi->CheckRoute(theEmptyParking->GetExitPt(), entrancePt, inScore)) checkRoute |= kTransportFlagParking; } - T2TowerEvent *theEvent = inDoc->towerDoc_vf170()->GetTowerEvent(); - T2DateTime *theCurrentDateTime = inDoc->towerDoc_vf120(); + T2TowerEvent *theEvent = inDoc->GetWorldDef()->GetTowerEvent(); + T2DateTime *theCurrentDateTime = inDoc->GetNow(); theEmptyParking = theDB->GetFirstTenant(kTenantRegistID8); if (theEmptyParking && theEmptyParking->IsOpen()) { if (theNavi->CheckRoute(theEmptyParking->GetExitPt(), entrancePt, inScore)) @@ -1671,7 +1671,7 @@ BOOL T2Tenant::UpdateResidencialEstimate(T2TowerDoc* inDoc) { int senseOfNoise = ((T2TenantDef *) GetEquipDef())->GetSenseOfNoise(); if (senseOfNoise != 0) { - T2TrafficInfo *theTrafficInfo = inDoc->towerDoc_vf150(); + T2TrafficInfo *theTrafficInfo = inDoc->GetTrafficInfo(); if (theTrafficInfo) mEstimate -= senseOfNoise * theTrafficInfo->GetRange(GetEntrancePt()); } @@ -1679,7 +1679,7 @@ BOOL T2Tenant::UpdateResidencialEstimate(T2TowerDoc* inDoc) { if (GetPriceIndex() != 0) mEstimate += (GetPriceIndex() - 3) * -30; - mEstimate += inDoc->towerDoc_vf120()->CalcLapseYears(mBuildDay) * -1; + mEstimate += inDoc->GetNow()->CalcLapseYears(mBuildDay) * -1; } else { mEstimate = 1; } @@ -1697,7 +1697,7 @@ void T2Tenant::BreakoutEmergency(T2TowerDoc* inTowerDoc) { int result = GetEquipDef()->EmergencyProc(inTowerDoc, this); if (result) { SetDrawMode(result); - inTowerDoc->GetTowerMainView()->tmv_vf128(mArea); + inTowerDoc->GetMainView()->InvalUnitRect(mArea); } } } @@ -1712,7 +1712,7 @@ void T2Tenant::BurntDown(T2TowerDoc* inDoc) { GetEquipDef()->BurntDownProc(inDoc, this); mDrawMode = DrawMode1; - inDoc->GetTowerMainView()->tmv_vf128(mArea); + inDoc->GetMainView()->InvalUnitRect(mArea); } } @@ -1887,7 +1887,7 @@ void T2Tenant::SetMerchandise(int inCount, int* inArray) { void T2Tenant::SetRelatedTenant(T2TowerDoc* inDoc, unsigned int inRegistID) { if (!mRelatedTenantList) { - T2RegistedTenantDB *theDB = inDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = inDoc->GetRegistedTenantDB(); mRelatedTenantList = theDB->GetList(inRegistID); } diff --git a/src/T2DLL/T2TenantArray.cpp b/src/T2DLL/T2TenantArray.cpp index 9dd23ee..b2a5823 100644 --- a/src/T2DLL/T2TenantArray.cpp +++ b/src/T2DLL/T2TenantArray.cpp @@ -33,7 +33,7 @@ T2Tenant* T2TenantArray::FindUnusedTenant() { for (int i = 0; i < kGroupSize; i++) { if (tenant->mUsed) { - if ((counter % 32) == startIndex || towerDoc->m180) + if ((counter % 32) == startIndex || towerDoc->mDebugStepRunEnabled) tenant->Idle(towerDoc); counter++; } diff --git a/src/T2DLL/T2TenantArray.h b/src/T2DLL/T2TenantArray.h index aef2cd0..a62d045 100644 --- a/src/T2DLL/T2TenantArray.h +++ b/src/T2DLL/T2TenantArray.h @@ -22,6 +22,8 @@ public: protected: friend class T2TenantArrayList; + friend class T2TowerDoc; + friend class T2TowerMainView; T2Tenant *mTenants; }; 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; } diff --git a/src/T2DLL/T2TenantDef.h b/src/T2DLL/T2TenantDef.h index 9f4b5e1..81ff79d 100644 --- a/src/T2DLL/T2TenantDef.h +++ b/src/T2DLL/T2TenantDef.h @@ -13,7 +13,7 @@ public: virtual unsigned int IdleProc(T2HaveOutViewObject*, T2TowerDoc*); virtual void DrawProc(T2HaveOutViewObject*, const RECT& inRect, T2TowerDoc*) const; virtual int CalcMentenanceCostProc(const T2HaveOutViewObject*) const; - virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT& inRect, unsigned int, BOOL); + virtual AREACHECKCODE AreaCheck(T2TowerDoc*, RECT& inRect, unsigned int, BOOL inShowError); virtual void DrawPeople(T2TowerDoc*, T2Equip*); virtual BOOL EmergencyProc(T2TowerDoc*, T2Equip*); virtual int DrawData(int); @@ -62,8 +62,8 @@ public: int m188; T2TenantMemberTableDef *mEmployeeTableDef; T2TenantMemberTableDef *mCustomerTableDef; - int m194; - int m198; + BOOL mDrawRoof; + BOOL mDrawFloor; unsigned int mRegistID; unsigned int mDownFlag; int mSenseOfNoise; diff --git a/src/T2DLL/T2TenantMemberTableDef.cpp b/src/T2DLL/T2TenantMemberTableDef.cpp index 10c0b82..9ca80f4 100644 --- a/src/T2DLL/T2TenantMemberTableDef.cpp +++ b/src/T2DLL/T2TenantMemberTableDef.cpp @@ -134,7 +134,7 @@ BOOL T2TenantMemberTableDef::IsCollectFromPool(T2TowerDoc* towerDoc) const { T2DayParamDef::EDay theDay = T2DayParamDef::Day_0; T2DayParamDef::EWhether theWhether = T2DayParamDef::Whether_0; - T2DateTime *theNow = towerDoc->towerDoc_vf120(); + T2DateTime *theNow = towerDoc->GetNow(); if (theNow->IsHoliday(towerDoc)) theDay = T2DayParamDef::Day_1; diff --git a/src/T2DLL/T2Terrorist.cpp b/src/T2DLL/T2Terrorist.cpp index 9afd78d..b42e389 100644 --- a/src/T2DLL/T2Terrorist.cpp +++ b/src/T2DLL/T2Terrorist.cpp @@ -1,7 +1,7 @@ #include "CResFile.h" -#include "CT2App.h" #include "GlobalFunc.h" #include "LArray.h" +#include "T2.h" #include "T2CtrlPalette.h" #include "T2DateTime.h" #include "T2Dialog.h" @@ -57,7 +57,7 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in BOOL found = false; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); RECT theIteratorArea; int theGroundLine = theFloorInfo->GetGroundLine(); @@ -77,7 +77,7 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in return false; SetupSound(); - inDoc->towerDoc_vf144(ViewMode_0); + inDoc->SetViewMode(kInView); inDoc->towerDoc_vf1A0(true); CString text, tempStr; @@ -96,7 +96,7 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in Sounds->Play("Terrorist:", SoundMask_10, SoundFlags_10 | SoundFlags_10000, NULL, PlayMode_0, 100); if (DoDialog(inDoc, 8300, 8300, 2, text) == 8303) { - inDoc->towerDoc_vf270(mRansomFee, kFundGroup2); + inDoc->DoPay(mRansomFee, kFundGroup2); Sounds->Play("Terrorist:ThankYou", SoundMask_10, SoundFlags_10 | SoundFlags_10000, NULL, PlayMode_0, 100); DWORD time = timeGetTime(); @@ -105,12 +105,12 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in inDoc->towerDoc_vf1A0(false); } else { - inDoc->towerDoc_vf2A8(25); + inDoc->SetDrawSpeed(25); inDoc->SetFireBurning(true); inDoc->towerDoc_vf2A0()->EnableIcon(false); - inDoc->GetTowerMainView()->tmv_vf154(); + inDoc->GetMainView()->HideToolSprite(); inDoc->towerDoc_vf2B0(true); - ((T2MainWindow *) AfxGetMainWnd())->mCtrlPalette->vf108(0); + T2_MAIN_WINDOW->mCtrlPalette->vf108(0); do { mBombHidePos.x = UT2Utils::Randomize(URect::Width(theIteratorArea)) + theIteratorArea.left; @@ -120,10 +120,10 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in mBombHideRoomID = theTenant->GetEquipID(); - inDoc->towerDoc_vf1B4(); - inDoc->GetTowerMainView()->tmv_vf120(); + inDoc->BreakoutEmergency(); + inDoc->GetMainView()->tmv_vf120(); - T2TowerMainView *theView = inDoc->GetTowerMainView(); + T2TowerMainView *theView = inDoc->GetMainView(); text = LoadStringTable(GetWorldModuleHandle(), 8300, 4); DoAlert(inDoc, text, 0); @@ -133,11 +133,11 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in mAttach = new T2FireAttach(this, 0, true); theView->AddAttachment(mAttach, NULL, true); - inDoc->towerDoc_vf2A8(25); + inDoc->SetDrawSpeed(25); - T2EquipPtrList *theList = inDoc->towerDoc_vf174()->GetList(kTenantRegistID5); + T2EquipPtrList *theList = inDoc->GetRegistedTenantDB()->GetList(kTenantRegistID5); if (theList) { - T2FloorPtrList *theFloorList = inDoc->towerDoc_vf124()->GetFloorPtrList(); + T2FloorPtrList *theFloorList = inDoc->GetRouteNavi()->GetFloorPtrList(); LArrayIterator floorIterator(*theFloorList); T2Tenant *theFloor; while (floorIterator.Next(&theFloor)) @@ -146,7 +146,7 @@ T2Terrorist::T2Terrorist(T2TowerEvent* inTowerEvent, CResFile* inResFile, int in T2Tenant *iteratorTenant; LArrayIterator tenantIterator(*theList); while (tenantIterator.Next(&iteratorTenant)) { - T2Tenant *theCurrFloor = inDoc->towerDoc_vf12C()->GetTenant(iteratorTenant->GetExitFloorID()); + T2Tenant *theCurrFloor = inDoc->GetFloorInfo()->GetTenant(iteratorTenant->GetExitFloorID()); if (theCurrFloor) { CRect area; theCurrFloor->GetEquipArea(area); @@ -221,11 +221,11 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag); /*virtual*/ int T2Terrorist::Exec(T2TowerDoc* inDoc) { int result = IsExclusive() ? 1 : 0; - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); unsigned int nowMinutes = theNow->GetRawMinutes(); if (mStatus == kTerroristStatus1) { - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2People *theSearcher; LArrayIterator theIteratorL(*mSearcherL); @@ -282,10 +282,10 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag); text += LoadStringTable(GetWorldModuleHandle(), 8300, 9); if (DoDialog(inDoc, 8300, 8300, 2, text) == 1) { - inDoc->towerDoc_vf270(mHigherRansomFee, kFundGroup2); + inDoc->DoPay(mHigherRansomFee, kFundGroup2); result = 3; } else { - inDoc->towerDoc_vf2A8(25); + inDoc->SetDrawSpeed(25); } } else if (nowMinutes == mEndTime) { Sounds->Stop("Terrorist:Tick"); @@ -309,7 +309,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag); for (int vDir = 0; vDir < 2; vDir++) { int v = (vDir == 0) ? vA : vF; if (v > 0 && v < GetWorldDef()->mGroundLine) { - theTenant = inDoc->towerDoc_vf12C()->GetTenant(v, h); + theTenant = inDoc->GetFloorInfo()->GetTenant(v, h); if (theTenant && !theTenant->IsFire() && !theTenant->IsFireproof()) theTenant->BurntDown(inDoc); @@ -337,15 +337,15 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag); break; } - T2TowerMainView *theMainView = inDoc->GetTowerMainView(); + T2TowerMainView *theMainView = inDoc->GetMainView(); CRect theBombArea; UT2Coordinate::MakeRect(theBombArea, mBombHidePos, 1, 1); - theMainView->tmv_vf15C(theBombArea); + theMainView->CenterOnRect(theBombArea); - if (inDoc->towerDoc_vf140() != ViewMode_1) + if (inDoc->GetViewMode() != kOutView) inDoc->towerDoc_vf284(); else - ((T2MainWindow *) AfxGetMainWnd())->mCtrlPalette->vf108(false); + T2_MAIN_WINDOW->mCtrlPalette->vf108(false); text = LoadStringTable(GetWorldModuleHandle(), 8300, 10); DoAlert(inDoc, text, 0); @@ -382,7 +382,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { CRect theEquipRect; CPoint theNextPt; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2Tenant *theCurrFloor = theFloorInfo->GetTenant(inPeople->GetCurrEquipID()); CRect theSearchRect; @@ -449,7 +449,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { CRect theSilhouetteArea; inPeople->CalcWalkingSilhouetteArea(theSilhouetteArea); theFloorInfo->SetTenantDrawModeByRect(theSilhouetteArea, DrawMode1); - inDoc->GetTowerMainView()->tmv_vf128(theSilhouetteArea); + inDoc->GetMainView()->InvalUnitRect(theSilhouetteArea); if (theNextFloor) { theCurrFloor->Leave(inPeople); @@ -471,7 +471,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { } /*virtual*/ void T2Terrorist::StopEvent(T2TowerDoc* inDoc) { - T2TowerMainView *theMainView = inDoc->GetTowerMainView(); + T2TowerMainView *theMainView = inDoc->GetMainView(); if (theMainView && mAttach) { theMainView->RemoveAttachment(mAttach); delete mAttach; @@ -479,7 +479,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { } CRect theSilhouetteArea; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2People *theSecurityMan; LArrayIterator theIteratorL(*mSearcherL); @@ -501,7 +501,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { theSecurityMan->CalcWalkingSilhouetteArea(theSilhouetteArea); theFloorInfo->SetTenantDrawModeByRect(theSilhouetteArea, DrawMode1); - theMainView->tmv_vf128(theSilhouetteArea); + theMainView->InvalUnitRect(theSilhouetteArea); } } @@ -526,7 +526,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { theSecurityMan->CalcWalkingSilhouetteArea(theSilhouetteArea); theFloorInfo->SetTenantDrawModeByRect(theSilhouetteArea, DrawMode1); - theMainView->tmv_vf128(theSilhouetteArea); + theMainView->InvalUnitRect(theSilhouetteArea); } } @@ -537,8 +537,8 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { 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); @@ -546,7 +546,7 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { } /*virtual*/ unsigned int T2Terrorist::DialogHook(T2EventDialog* inDialog, unsigned int inResult, T2TowerDoc* inDoc) { - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); T2Tenant *theTenant = theFloorInfo->GetTenantByPID('KEBI'); BOOL isMissing = (theTenant == NULL); @@ -556,9 +556,9 @@ static void MoveNextFloor(T2TowerDoc *inDoc, T2People *inPeople, BOOL inFlag) { break; if (mStatus == kTerroristStatus1) { - inResult = (inDoc->towerDoc_vf26C() >= mHigherRansomFee) ? inResult : 0; + inResult = (inDoc->GetCurrentFunds() >= mHigherRansomFee) ? inResult : 0; } else { - inResult = (inDoc->towerDoc_vf26C() >= mRansomFee) ? inResult : 0; + inResult = (inDoc->GetCurrentFunds() >= mRansomFee) ? inResult : 0; } if (inResult == 0) { diff --git a/src/T2DLL/T2ToolCallback.h b/src/T2DLL/T2ToolCallback.h index 752bec5..60b2515 100644 --- a/src/T2DLL/T2ToolCallback.h +++ b/src/T2DLL/T2ToolCallback.h @@ -3,5 +3,5 @@ class AFX_CLASS_EXPORT T2ToolCallback { public: - virtual void toolCallback_vf00(int unkParam1, int unkParam2) = 0; + virtual void toolCallback_vf00(int unkParam1, T2ToolIconItem *inItem) = 0; }; diff --git a/src/T2DLL/T2ToolDef.cpp b/src/T2DLL/T2ToolDef.cpp index 1a0d264..6ea6fa1 100644 --- a/src/T2DLL/T2ToolDef.cpp +++ b/src/T2DLL/T2ToolDef.cpp @@ -81,7 +81,7 @@ T2ToolDef::T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile if (mEC) delete mEC; if (mToolQuietUntil) - delete mToolQuietUntil; // what type is this? + delete mToolQuietUntil; if (mSubPluginList) delete mSubPluginList; } @@ -92,18 +92,18 @@ T2ToolDef::T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile return key; } -/*virtual*/ CURSORTYPE T2ToolDef::QueryCursor(T2TowerDoc*, POINT inPt, CString& outStr, RECT& outRect, POINT& outPt, int factor, unsigned int, int) { - outStr = "Csr"; +/*virtual*/ CURSORTYPE T2ToolDef::QueryCursor(T2TowerDoc* inDoc, POINT inPt, CString& outSpriteName, RECT& outRect, POINT& outPt, int inZoomLevel, unsigned int inValiation, int) { + outSpriteName = "Csr"; - inPt.x -= ((mWidth * UT2Coordinate::UnitHSize(factor)) / 2 - UT2Coordinate::UnitHSize(factor) / 2); - inPt.y -= ((mHeight * UT2Coordinate::UnitVSize(factor)) / 2 - UT2Coordinate::UnitVSize(factor) / 2); + inPt.x -= ((mWidth * UT2Coordinate::UnitHSize(inZoomLevel)) / 2 - UT2Coordinate::UnitHSize(inZoomLevel) / 2); + inPt.y -= ((mHeight * UT2Coordinate::UnitVSize(inZoomLevel)) / 2 - UT2Coordinate::UnitVSize(inZoomLevel) / 2); - UT2Coordinate::QDToUnit(inPt, factor); + UT2Coordinate::QDToUnit(inPt, inZoomLevel); SetRect(&outRect, inPt.x, inPt.y, inPt.x + mWidth, inPt.y + mHeight); outPt.x = outRect.left; outPt.y = outRect.top; - UT2Coordinate::UnitToQD(outRect, factor); + UT2Coordinate::UnitToQD(outRect, inZoomLevel); return CursorType_0; } diff --git a/src/T2DLL/T2ToolDef.h b/src/T2DLL/T2ToolDef.h index b954d82..bb42d77 100644 --- a/src/T2DLL/T2ToolDef.h +++ b/src/T2DLL/T2ToolDef.h @@ -26,9 +26,9 @@ enum { kTenantAttrIsConcat = 0x20000, kTenantAttr40000 = 0x40000, // 80000 - // 100000 - // 200000 - // 400000 + kTenantAttrOnlyGroundFloor = 0x100000, + kTenantAttrOnlyAboveGround = 0x200000, + kTenantAttrOnlyUnderground = 0x400000, kTenantAttrIsPeopleAnime = 0x800000, kTenantAttrIsPeopleAnime2 = 0x1000000, kTenantAttrIsNeedToilet = 0x2000000, @@ -69,7 +69,7 @@ public: return 0; } - virtual CURSORTYPE QueryCursor(T2TowerDoc*, POINT, CString&, RECT&, POINT&, int, unsigned int, int); + virtual CURSORTYPE QueryCursor(T2TowerDoc* inDoc, POINT inPt, CString& outSpriteName, RECT& outRect, POINT& outPt, int inZoomLevel, unsigned int inValiation, int); virtual unsigned int IdleProc(T2HaveOutViewObject*, T2TowerDoc*) { return 0; @@ -93,8 +93,8 @@ public: virtual void LoadExtraData(T2Archive&, T2TowerDoc*, T2HaveOutViewObject*) {} virtual void SaveExtraData(T2Archive&, T2HaveOutViewObject*) {} - virtual void Add(T2AdvertisePlugin* plugin); virtual void Add(CResourcePlugin* plugin); + virtual void Add(T2AdvertisePlugin* plugin); virtual PROCCODE DrawHitMask(T2TowerDoc*, T2HaveOutViewObject*) { return ProcCode_0; } @@ -115,6 +115,7 @@ protected: friend class T2Settlement; friend class T2TemplatePluginList; friend class T2ToolHelpWnd; + friend class T2TowerDoc; int mToolType; int mWidth; diff --git a/src/T2DLL/T2ToolWindow.cpp b/src/T2DLL/T2ToolWindow.cpp index 346f1e8..7e65ac6 100644 --- a/src/T2DLL/T2ToolWindow.cpp +++ b/src/T2DLL/T2ToolWindow.cpp @@ -1,4 +1,4 @@ -#include "CT2App.h" +#include "T2.h" #include "T2DLL.h" #include "T2ImageObj.h" #include "T2MainWindow.h" @@ -140,7 +140,7 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { theItem->mToolDef = inToolDef; unsigned short mask = 1; - if (mDocument->mViewMode == ViewMode_1) + if (mDocument->mViewMode == kOutView) mask = 2; if (inSomeMask & mask) @@ -158,7 +158,7 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { } /*virtual*/ void T2ToolWindow::AddIcon(const char* inName, unsigned short inSomeMask, char* inStr2, T2ToolCallback* inToolCallback) { - AddIcon(inName, inStr2, 0, 0, NULL, 0, inSomeMask, inToolCallback); + AddIcon(inName, inStr2, 0, kToolOption0, NULL, 0, inSomeMask, inToolCallback); } /*virtual*/ void T2ToolWindow::RemoveIcon(const char* inName, unsigned int inValiation) { @@ -377,7 +377,7 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { theToolIconItem->m30 = flag; if (theToolIconItem->m24) { - if (theToolIconItem->mOption == 4 || theToolIconItem->mOption == 0) { + if (theToolIconItem->mOption == kToolOption4 || theToolIconItem->mOption == kToolOption0) { _D8[_118] = theToolIconItem; if (!flag) oldSelectedItem = theToolIconItem; @@ -388,7 +388,7 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { for (unsigned short what = 1; what < 16; what++) { if ((what & inMask) && _D8[what]) { theToolIconItem = _D8[what]; - if (theToolIconItem->mOption == 4 || theToolIconItem->mOption == 0) { + if (theToolIconItem->mOption == kToolOption4 || theToolIconItem->mOption == kToolOption0) { if (theToolIconItem->m30 && !theToolIconItem->m18) { theToolIconItem->m24 = true; selectedItem = theToolIconItem; @@ -401,12 +401,12 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { } } - if (oldSelectedItem && oldSelectedItem->mOption == 4) { + if (oldSelectedItem && oldSelectedItem->mOption == kToolOption4) { pos = mToolIconList->GetHeadPosition(); while (pos) { theToolIconItem = mToolIconList->GetNext(pos); - if (theToolIconItem->m30 && theToolIconItem->mOption == 4 && !theToolIconItem->m18) { + if (theToolIconItem->m30 && theToolIconItem->mOption == kToolOption4 && !theToolIconItem->m18) { theToolIconItem->m24 = true; selectedItem = theToolIconItem; oldSelectedItem->m24 = false; @@ -421,7 +421,7 @@ afx_msg int T2ToolWindow::OnCreate(LPCREATESTRUCT lpCreateStruct) { while (pos) { theToolIconItem = mToolIconList->GetNext(pos); - if (theToolIconItem->m30 && theToolIconItem->mOption == 0) { + if (theToolIconItem->m30 && theToolIconItem->mOption == kToolOption0) { theToolIconItem->m24 = true; selectedItem = theToolIconItem; oldSelectedItem->m24 = false; @@ -608,7 +608,7 @@ afx_msg void T2ToolWindow::OnClose() { if (!mDocument) return; - mDocument->towerDoc_vf198(2); + mDocument->towerDoc_vf198(kToolWindow); } /*virtual*/ BOOL T2ToolWindow::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { @@ -633,7 +633,7 @@ T2ToolIconItem::T2ToolIconItem() { mPlugin = NULL; mName = ""; mValiation = 0; - mOption = 0; + mOption = kToolOption0; mID = -1; m24 = false; mEnableCount = 0; diff --git a/src/T2DLL/T2ToolWindow.h b/src/T2DLL/T2ToolWindow.h index 7536377..368bad3 100644 --- a/src/T2DLL/T2ToolWindow.h +++ b/src/T2DLL/T2ToolWindow.h @@ -3,6 +3,19 @@ class T2ToolIconItem; +enum { + // General tools + kToolOption0 = 0, + // Tenants + kToolOption1 = 1, + // Movers + kToolOption2 = 2, + // OutObjs + kToolOption3 = 3, + // Categories + kToolOption4 = 4, +}; + class AFX_CLASS_EXPORT T2ToolWindow : public CFrameWnd { DECLARE_DYNCREATE(T2ToolWindow) DECLARE_MESSAGE_MAP() @@ -62,7 +75,9 @@ protected: afx_msg void OnDestroy(); afx_msg void OnClose(); - int _C0; + friend class T2TowerDoc; + + HINSTANCE mModule; T2TowerDoc *mDocument; T2WorldDef *mWorldDef; T2ToolIconList *mToolIconList; diff --git a/src/T2DLL/T2TowerEvent.cpp b/src/T2DLL/T2TowerEvent.cpp index 84dc878..11287d6 100644 --- a/src/T2DLL/T2TowerEvent.cpp +++ b/src/T2DLL/T2TowerEvent.cpp @@ -290,18 +290,18 @@ void T2TowerEvent::StopEvent() { int T2TowerEvent::Idle(T2TowerDoc* inDoc) { T2EventItem *theEvent; - T2DateTime *theNow = inDoc->towerDoc_vf120(); + T2DateTime *theNow = inDoc->GetNow(); int nowMinutes = theNow->GetRawMinutes(); - if ((nowMinutes == 0 && _8 != nowMinutes) || mLevel != inDoc->towerDoc_vf138()) { + if ((nowMinutes == 0 && _8 != nowMinutes) || mLevel != inDoc->GetLevel()) { #pragma var_order(day, eventIteratorWaiting, eventIteratorStandby, theLevelBit) - mLevel = inDoc->towerDoc_vf138(); + mLevel = inDoc->GetLevel(); unsigned int theLevelBit = (mLevel > 0) ? (1 << (mLevel - 1)) : 0; int day = theNow->CalcLapseDays(12) + 1; LArrayIterator eventIteratorStandby(mStandby); while (eventIteratorStandby.Next(&theEvent)) { - if (theEvent->_4 || ((theEvent->GetLevelBit() & theLevelBit) && theEvent->IsBeginDay(day))) { + if (theEvent->mForceStart || ((theEvent->GetLevelBit() & theLevelBit) && theEvent->IsBeginDay(day))) { mStandby.Remove(&theEvent); eventIteratorStandby.Reset(); StoreWaitSequence(theEvent); @@ -310,7 +310,7 @@ int T2TowerEvent::Idle(T2TowerDoc* inDoc) { LArrayIterator eventIteratorWaiting(mWaiting); while (eventIteratorWaiting.Next(&theEvent)) { - if (!theEvent->_4 && !(theEvent->GetLevelBit() & theLevelBit)) { + if (!theEvent->mForceStart && !(theEvent->GetLevelBit() & theLevelBit)) { mWaiting.Remove(&theEvent); eventIteratorWaiting.Reset(); mStandby.Add(&theEvent); @@ -488,12 +488,12 @@ void T2TowerEvent::DrawRubble(T2TowerDoc* inDoc, T2Tenant* inTenant) { CRect rect1, rect2; inTenant->GetEquipArea(rect1); - UT2Coordinate::UnitToQD(rect1, rect2, inDoc->towerDoc_vf108(), true); - rect2.bottom = rect2.top + UT2Coordinate::UnitVSize(inDoc->towerDoc_vf108()); + UT2Coordinate::UnitToQD(rect1, rect2, inDoc->GetZoomLevel(), true); + rect2.bottom = rect2.top + UT2Coordinate::UnitVSize(inDoc->GetZoomLevel()); for (int i = 0; i < rect1.Height(); i++) { - inDoc->mWorldDef->mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect2, inDoc->towerDoc_vf108()); - rect2.OffsetRect(0, UT2Coordinate::UnitVSize(inDoc->towerDoc_vf108())); + inDoc->mWorldDef->mImageObj->DrawObject(inDoc->GetImage(), objectID, rect2, inDoc->GetZoomLevel()); + rect2.OffsetRect(0, UT2Coordinate::UnitVSize(inDoc->GetZoomLevel())); } } } diff --git a/src/T2DLL/T2TowerMessage.cpp b/src/T2DLL/T2TowerMessage.cpp index c99ac63..3beea1d 100644 --- a/src/T2DLL/T2TowerMessage.cpp +++ b/src/T2DLL/T2TowerMessage.cpp @@ -24,7 +24,7 @@ T2TowerMessage::T2TowerMessage(HINSTANCE inModuleHandle, T2TowerDoc* inDoc) { mHasCapture = false; - inDoc->GetTowerMainView()->AddAttachment(this); + inDoc->GetMainView()->AddAttachment(this); } /*virtual*/ T2TowerMessage::~T2TowerMessage() { @@ -67,7 +67,7 @@ void T2TowerMessage::InfoBarMessage(const CString& inText, int inDelay, const ch void T2TowerMessage::SetInfoBarMsg(InfoBarMsgItem* inItem) { CString empty; CString *theString = inItem ? &inItem->mText : ∅ - mDocument->towerDoc_vf164(*theString); + mDocument->SetInfoBarText(*theString); if (inItem && inItem->mSoundID != "") Sounds->Play(inItem->mSoundID, SoundMask_10, SoundFlags_10, NULL, PlayMode_0, 100); @@ -109,7 +109,7 @@ void T2TowerMessage::EquipBalloonMessage(const CString& inText, POINT inPt) { } void T2TowerMessage::BuildErr(const CString& inText) { - POINT otherPt = mDocument->GetTowerMainView()->m7C; + POINT otherPt = mDocument->GetMainView()->m7C; (new T2Message)->ShowMessage(inText); } @@ -135,7 +135,7 @@ BOOL T2TowerMessage::GetBuildErrString(unsigned int inID, CString& outStr) { } void T2TowerMessage::ObjectBalloonMessage(const CString& inText, const RECT& inRect) { - T2TowerMainView *theView = mDocument->GetTowerMainView(); + T2TowerMainView *theView = mDocument->GetMainView(); CRect rect = inRect; UT2Coordinate::UnitToQD(rect, 0, true); @@ -257,7 +257,7 @@ void T2TowerMessage::SpendTime2() { CPoint pt; pt.x = LOWORD(pMsg->lParam); pt.y = HIWORD(pMsg->lParam); - pt += GetCurrentT2TowerDoc()->GetTowerMainView()->m64; + pt += GetCurrentT2TowerDoc()->GetMainView()->mScrollOffset; if (PtInRect(&mCaptureRect, pt)) { newExecuteHost = false; diff --git a/src/T2DLL/T2TrafficInfo.cpp b/src/T2DLL/T2TrafficInfo.cpp index 04722a4..2079015 100644 --- a/src/T2DLL/T2TrafficInfo.cpp +++ b/src/T2DLL/T2TrafficInfo.cpp @@ -70,13 +70,13 @@ void T2TrafficInfo::HourChanged(T2TowerDoc* inDoc) { int range = CalcRange(unt->x4); if (range != unt->range) { unt->range = range; - if (inDoc->towerDoc_vf140() == ViewMode_5) { + if (inDoc->GetViewMode() == kTransView) { RECT area; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); CalcUnitArea(i, area); theFloorInfo->SetTenantDrawModeByRect(area, DrawMode3); - inDoc->GetTowerMainView()->tmv_vf128(area); + inDoc->GetMainView()->InvalUnitRect(area); } } } diff --git a/src/T2DLL/T2Transport.cpp b/src/T2DLL/T2Transport.cpp index a3e1ac3..67adf7a 100644 --- a/src/T2DLL/T2Transport.cpp +++ b/src/T2DLL/T2Transport.cpp @@ -149,7 +149,7 @@ BOOL T2Transport::ChkStoppage() const { BOOL result = false; if (mFlag) { - T2DateTime *theNow = DoGetTowerDoc()->towerDoc_vf120(); + T2DateTime *theNow = DoGetTowerDoc()->GetNow(); int nowMinutes = theNow->GetRawMinutes(); int diff = nowMinutes - mArriveTime; result = (diff >= 0 && diff < (_2C + 1)); @@ -269,7 +269,7 @@ CLink* T2Transport::LeaveFirst() { do { thePeople = (T2People *) LeaveFirst(); if (thePeople) - inDoc->towerDoc_vf130()->Enter(thePeople); + inDoc->GetPool()->Enter(thePeople); } while (thePeople); diff --git a/src/T2DLL/T2VisitVIP.cpp b/src/T2DLL/T2VisitVIP.cpp index c411321..0b190d9 100644 --- a/src/T2DLL/T2VisitVIP.cpp +++ b/src/T2DLL/T2VisitVIP.cpp @@ -72,10 +72,10 @@ T2VisitVIP::T2VisitVIP(T2TowerEvent* inTowerEvent, int inSubID, int inLevelBit, mPeopleID = 0; mTenantID = 0; - if (mGrade <= theWorldDef->mNumOfGradeDef && inDoc->towerDoc_vf138() == mGrade) { + if (mGrade <= theWorldDef->mNumOfGradeDef && inDoc->GetLevel() == mGrade) { GradeDef *theGrade = &theWorldDef->mGradeDef[mGrade - 1]; if ((theGrade->m0 & mVisitFlag) != 0 && (inDoc->mA0 & mVisitFlag) == 0) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); if (thePool && thePool->GetPopulation() > (theGrade->m4 / 2)) { T2Tenant *theTenant = NULL; CFilePlugin *thePlugin = NULL; @@ -113,7 +113,7 @@ T2VisitVIP::T2VisitVIP(T2TowerEvent* inTowerEvent, int inSubID, int inLevelBit, RECT rect; theTenant->GetEquipArea(rect); - int floorNum = inDoc->towerDoc_vf12C()->UnitToFloor(rect.top); + int floorNum = inDoc->GetFloorInfo()->UnitToFloor(rect.top); if (floorNum < 0) { text += 'B'; floorNum = 0 - floorNum; @@ -123,7 +123,7 @@ T2VisitVIP::T2VisitVIP(T2TowerEvent* inTowerEvent, int inSubID, int inLevelBit, // "階" - floor text += "\x8A\x4B"; - int roomNum = theTenant->GetRoomNumber(inDoc->towerDoc_vf12C()); + int roomNum = theTenant->GetRoomNumber(inDoc->GetFloorInfo()); if (roomNum < 0) { text += 'B'; roomNum = 0 - roomNum; @@ -289,14 +289,14 @@ BOOL T2VisitVIP::DoReception(T2TowerDoc* inDoc) { } else { // "不満な様子です。\n\n「" - I'm dissatisfied. str += "\x95\x73\x96\x9E\x82\xC8\x97\x6C\x8E\x71\x82\xC5\x82\xB7\x81\x42\x0A\x0A\x81\x75"; - T2Tenant *theTenant = inDoc->towerDoc_vf12C()->GetTenant(mTenantID); + T2Tenant *theTenant = inDoc->GetFloorInfo()->GetTenant(mTenantID); if (theTenant) { CString tmp; RECT rect; theTenant->GetEquipArea(rect); - int floorNum = inDoc->towerDoc_vf12C()->UnitToFloor(rect.top); + int floorNum = inDoc->GetFloorInfo()->UnitToFloor(rect.top); if (floorNum < 0) { str += 'B'; floorNum = 0 - floorNum; @@ -327,7 +327,7 @@ BOOL T2VisitVIP::DoReception(T2TowerDoc* inDoc) { delete theName; } - thePool = inDoc->towerDoc_vf130(); + thePool = inDoc->GetPool(); thePool->DeadVIP(thePeople); return true; @@ -336,7 +336,7 @@ BOOL T2VisitVIP::DoReception(T2TowerDoc* inDoc) { if (mCheckedIn) { T2DateTime *theNow = inDoc->mNow; if (theNow && theNow->GetRawMinutes() == 600) { - T2Tenant *theTenant = inDoc->towerDoc_vf12C()->GetTenant(mTenantID); + T2Tenant *theTenant = inDoc->GetFloorInfo()->GetTenant(mTenantID); if (theTenant && theTenant->IsBelongPeople(thePeople)) { theTenant->SetStatus(kTenantStatus34); mCheckedIn = false; @@ -362,21 +362,21 @@ BOOL T2VisitVIP::GetDestinationTennant(DWORD inPluginID, T2Tenant*& outTenant, C while ((theSpecifier = theT2PluginLoader->GetNext(pos))) { if (theSpecifier->mID == inPluginID) { - outPlugin = theTowerDoc->mTenantPluginsListOther->GetItem(theSpecifier->mID); + outPlugin = theTowerDoc->mTenantPlugins->GetItem(theSpecifier->mID); outSpecifier = theSpecifier; break; } } if (outPlugin) { - T2FloorInfo *theFloorInfo = theTowerDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = theTowerDoc->GetFloorInfo(); if (theFloorInfo) { T2Tenant *theTenant = theFloorInfo->GetTenantByPID(inPluginID); if (theTenant) { unsigned int registID = theTenant->GetRegistID(); if (registID == kTenantRegistID1) { theTenant = NULL; - T2RegistedTenantDB *theDB = theTowerDoc->towerDoc_vf174(); + T2RegistedTenantDB *theDB = theTowerDoc->GetRegistedTenantDB(); if (theDB) { T2EquipPtrList *theList = theDB->GetList(kTenantRegistID1); if (theList) { diff --git a/src/T2DLL/T2WorldDef.cpp b/src/T2DLL/T2WorldDef.cpp index f9dbfbd..63358f3 100644 --- a/src/T2DLL/T2WorldDef.cpp +++ b/src/T2DLL/T2WorldDef.cpp @@ -89,9 +89,9 @@ T2WorldDef::T2WorldDef(DWORD inType, T2PluginSpecifier& inSpecifier, CResFile* i *inResFile >> m148[3]; *inResFile >> m148[4]; *inResFile >> m15C; - *inResFile >> mDustOnThreshold; - *inResFile >> mToiletVar1; - *inResFile >> mToiletVar2; + *inResFile >> mMinimumLevelForDust; + *inResFile >> mMinimumLevelForToilet; + *inResFile >> mToiletDenomi; *inResFile >> a; memset(mCashAmount, 0, sizeof(mCashAmount)); @@ -215,7 +215,7 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { RECT destRect = srcRect; - mImage->CopyImage(*inDoc->towerDoc_vf10C(), srcRect, destRect); + mImage->CopyImage(*inDoc->GetImage(), srcRect, destRect); } /*virtual*/ void T2WorldDef::DrawBkgnd(unsigned int inImageIndex, const RECT& inDestRect, T2TowerDoc* inDoc) { @@ -227,9 +227,9 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { OffsetRect(&srcRect, 0, inImageIndex * height); RECT destRect = inDestRect; - UT2Coordinate::BkgndToQD(destRect, inDoc->towerDoc_vf108()); + UT2Coordinate::BkgndToQD(destRect, inDoc->GetZoomLevel()); - mSkyOffscreen->CopyImage(*inDoc->towerDoc_vf10C(), srcRect, destRect); + mSkyOffscreen->CopyImage(*inDoc->GetImage(), srcRect, destRect); } /*virtual*/ void T2WorldDef::DrawBkgnd(const RECT& inRect, T2TowerDoc* inDoc) { @@ -252,9 +252,9 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { srcRect.right *= mBGHUnit; RECT destRect; - UT2Coordinate::BkgndToQD(inRect, destRect, inDoc->towerDoc_vf108()); + UT2Coordinate::BkgndToQD(inRect, destRect, inDoc->GetZoomLevel()); - mSkyOffscreen->CopyImage(*inDoc->towerDoc_vf10C(), srcRect, destRect); + mSkyOffscreen->CopyImage(*inDoc->GetImage(), srcRect, destRect); } } @@ -266,13 +266,13 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { if (inRoofAndFloor & RoofAndFloor_Roof) { UT2Coordinate::UnitToQDRoof(unitRect, qdRect, inDoc->mZoomLevel); id = mImageObj->FindObject("Roof"); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), id, qdRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), id, qdRect, inDoc->GetZoomLevel()); } if (inRoofAndFloor & RoofAndFloor_Floor) { UT2Coordinate::UnitToQDFloor(unitRect, qdRect, inDoc->mZoomLevel); id = mImageObj->FindObject("Floor"); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), id, qdRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), id, qdRect, inDoc->GetZoomLevel()); } } @@ -291,9 +291,9 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { name2 = "R"; int numPattern = 0; - if (inDoc->towerDoc_vf140() == ViewMode_1) { + if (inDoc->GetViewMode() == kOutView) { numPattern = 1; - if (inDoc->towerDoc_vf160()->IsSnow()) + if (inDoc->GetPaletteAnime()->IsSnow()) numPattern = 2; } @@ -318,7 +318,7 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { unitRect.bottom = inEquip->mArea.bottom; unitRect.top = unitRect.bottom - size.cy; UT2Coordinate::UnitToQD(unitRect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); objectID = mImageObj->FindObject("Side" + name2, numPattern); mImageObj->GetObjectSize(objectID, &size); @@ -339,28 +339,28 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { for (int v = inEquip->mArea.top; v < (inEquip->mArea.bottom - 1); v++) { UT2Coordinate::UnitToQD(unitRect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); unitRect.top++; unitRect.bottom++; } - } else if (((T2TenantDef *) inEquip->GetEquipDef())->m198 && !((T2TenantDef *) inEquip->GetEquipDef())->m194) { + } else if (((T2TenantDef *) inEquip->GetEquipDef())->mDrawFloor && !((T2TenantDef *) inEquip->GetEquipDef())->mDrawRoof) { unitRect.bottom = inEquip->mArea.bottom; unitRect.top = unitRect.bottom - size.cy; UT2Coordinate::UnitToQD(unitRect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); - } else if (!((T2TenantDef *) inEquip->GetEquipDef())->m198 && ((T2TenantDef *) inEquip->GetEquipDef())->m194) { + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); + } else if (!((T2TenantDef *) inEquip->GetEquipDef())->mDrawFloor && ((T2TenantDef *) inEquip->GetEquipDef())->mDrawRoof) { unitRect.top = inEquip->mArea.top; unitRect.bottom = unitRect.top + -size.cy; UT2Coordinate::UnitToQD(unitRect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); - } else if (((T2TenantDef *) inEquip->GetEquipDef())->m198 && ((T2TenantDef *) inEquip->GetEquipDef())->m194) { + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); + } else if (((T2TenantDef *) inEquip->GetEquipDef())->mDrawFloor && ((T2TenantDef *) inEquip->GetEquipDef())->mDrawRoof) { unitRect.top = inEquip->mArea.top; unitRect.bottom = unitRect.top + size.cy; for (int v = inEquip->mArea.top; v < inEquip->mArea.bottom; v++) { UT2Coordinate::UnitToQD(unitRect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); unitRect.top++; unitRect.bottom++; @@ -370,8 +370,8 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { } /*virtual*/ void T2WorldDef::DrawCrane(T2TowerDoc* inDoc, const RECT& inRect) { - T2FloorInfo *floorInfo = inDoc->towerDoc_vf12C(); - T2BitImage *theViewImage = inDoc->GetTowerMainView()->m60; + T2FloorInfo *floorInfo = inDoc->GetFloorInfo(); + T2BitImage *theViewImage = inDoc->GetMainView()->mImage; int theZoomLevel = inDoc->mZoomLevel; RECT craneArea; @@ -400,7 +400,7 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { int count = 0; POINT *array = (POINT *) malloc(GetWidth() * sizeof(POINT) / m190.x); - T2FloorInfo *floorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *floorInfo = inDoc->GetFloorInfo(); RECT rect; SetRect(&rect, 0, 0, GetWidth(), mGroundLine); @@ -505,7 +505,7 @@ T2ColdTableDef* T2WorldDef::MakeColdTableDef() { rect.bottom = rect.top + 1; UT2Coordinate::UnitToQD(rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objIndex, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objIndex, rect, inDoc->GetZoomLevel()); } } @@ -638,7 +638,7 @@ void T2WorldDef::DisposePalette() { DrawCalendar(inControl, *inDoc->mNow, inDoc); break; case 1002: - DrawFunds(inControl, inDoc->towerDoc_vf26C()); + DrawFunds(inControl, inDoc->GetCurrentFunds()); break; case 2000: DrawPauseButton(inControl); @@ -647,7 +647,7 @@ void T2WorldDef::DisposePalette() { DrawMessage(inControl); break; case 1003: - thePool = inDoc->towerDoc_vf130(); + thePool = inDoc->GetPool(); #line 755 _ASSERT(thePool != NULL); population = thePool->GetPopulation(); @@ -733,9 +733,9 @@ void T2WorldDef::DisposePalette() { if (newValue != inControl->GetData()) { inControl->SetData(newValue); if (newValue == 0) - inDoc->towerDoc_vf14C(-1); + inDoc->SetWalkRate(-1); else - inDoc->towerDoc_vf14C(7 - newValue); + inDoc->SetWalkRate(7 - newValue); } break; } @@ -781,9 +781,9 @@ void T2WorldDef::DisposePalette() { if (newValue != inControl->GetData()) { inControl->SetData(newValue); if (newValue == 0) - inDoc->towerDoc_vf14C(-1); + inDoc->SetWalkRate(-1); else - inDoc->towerDoc_vf14C(7 - newValue); + inDoc->SetWalkRate(7 - newValue); } break; } @@ -1315,26 +1315,26 @@ void T2WorldDef::DisposePalette() { strcpy(outStr, "\x8E\xC0\x8D\x73\x81\x5E\x92\xE2\x8E\x7E"); } -unsigned int T2WorldDef::GetToiletDenomi(unsigned int inVal) const { +unsigned int T2WorldDef::GetToiletDenomi(unsigned int inGameLevel) const { unsigned int result = 0; - if (mToiletVar1 > 0 && inVal >= mToiletVar1) - result = mToiletVar2; + if (mMinimumLevelForToilet > 0 && inGameLevel >= mMinimumLevelForToilet) + result = mToiletDenomi; return result; } -unsigned int T2WorldDef::GetColdDenomi(unsigned int inVal1, unsigned int inVal2) const { +unsigned int T2WorldDef::GetColdDenomi(unsigned int inGameLevel, unsigned int inMonth) const { unsigned int result = 0; if (mColdTableDef) - result = mColdTableDef->GetDenomi(inVal1, inVal2); + result = mColdTableDef->GetDenomi(inGameLevel, inMonth); return result; } -BOOL T2WorldDef::IsDustOn(unsigned int inVal) const { - return (mDustOnThreshold > 0) && (inVal >= mDustOnThreshold); +BOOL T2WorldDef::IsDustOn(unsigned int inGameLevel) const { + return (mMinimumLevelForDust > 0) && (inGameLevel >= mMinimumLevelForDust); } T2TowerVision* T2WorldDef::GetTowerVision() { @@ -1427,7 +1427,7 @@ BOOL T2WorldDef::IsBlackOut() { int result = 0; if (inDoc->mGameLevel <= mNumOfGradeDef) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); if (thePool) { GradeDef theDef = mGradeDef[inDoc->mGameLevel - 1]; int population = thePool->GetPopulation(); @@ -1450,8 +1450,8 @@ BOOL T2WorldDef::IsBlackOut() { } /*virtual*/ void T2WorldDef::CalcOptionObj(T2TowerDoc* inDoc, T2Equip* inEquip) { - T2TowerMainView *theView = inDoc->GetTowerMainView(); - T2FloorInfo *floorInfo = inDoc->towerDoc_vf12C(); + T2TowerMainView *theView = inDoc->GetMainView(); + T2FloorInfo *floorInfo = inDoc->GetFloorInfo(); if (inEquip) { RECT equipArea; @@ -1470,7 +1470,7 @@ BOOL T2WorldDef::IsBlackOut() { equipArea.left -= objectSize.cx; equipArea.right += objectSize.cx; - theView->tmv_vf128(equipArea, true); + theView->InvalUnitRect(equipArea, true); } } } @@ -1481,7 +1481,7 @@ BOOL T2WorldDef::IsBlackOut() { if (rect1.bottom > mGroundLine) rect1.bottom = mGroundLine; - T2FloorInfo *theFloorInfo = inDoc->towerDoc_vf12C(); + T2FloorInfo *theFloorInfo = inDoc->GetFloorInfo(); CString name = "Side"; int objectID = mImageObj->FindObject(name + "L"); @@ -1522,7 +1522,7 @@ BOOL T2WorldDef::IsBlackOut() { rect.right = rect.left; rect.left = rect.right - sideObjectSize.cx; UT2Coordinate::UnitToQD(rect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); } if (theFloorInfo->GetTenantID(theFloor->mArea.bottom - 1, theFloor->mArea.right) == 0) { @@ -1533,7 +1533,7 @@ BOOL T2WorldDef::IsBlackOut() { rect.left = rect.right; rect.right = rect.left + sideObjectSize.cx; UT2Coordinate::UnitToQD(rect, rect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, rect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, rect, inDoc->GetZoomLevel()); } } else { if (theFloorInfo->GetTenantID(theFloor->mArea.bottom - 1, theFloor->mArea.left - 1) == 0) { @@ -1549,7 +1549,7 @@ BOOL T2WorldDef::IsBlackOut() { for (int i = theFloor->mArea.top; i < (theFloor->mArea.bottom - 1); i++) { UT2Coordinate::UnitToQD(baseRect, workRect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, workRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, workRect, inDoc->GetZoomLevel()); OffsetRect(&baseRect, 0, 1); } @@ -1558,7 +1558,7 @@ BOOL T2WorldDef::IsBlackOut() { baseRect.left = baseRect.right - tentObjectSize.cx; UT2Coordinate::UnitToQD(baseRect, workRect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, workRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, workRect, inDoc->GetZoomLevel()); } if (theFloorInfo->GetTenantID(theFloor->mArea.bottom - 1, theFloor->mArea.right) == 0) { @@ -1574,7 +1574,7 @@ BOOL T2WorldDef::IsBlackOut() { for (int i = theFloor->mArea.top; i < (theFloor->mArea.bottom - 1); i++) { UT2Coordinate::UnitToQD(baseRect, workRect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, workRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, workRect, inDoc->GetZoomLevel()); OffsetRect(&baseRect, 0, 1); } @@ -1583,7 +1583,7 @@ BOOL T2WorldDef::IsBlackOut() { baseRect.right = baseRect.left + tentObjectSize.cx; UT2Coordinate::UnitToQD(baseRect, workRect, inDoc->mZoomLevel, true); - mImageObj->DrawObject(inDoc->towerDoc_vf10C(), objectID, workRect, inDoc->towerDoc_vf108()); + mImageObj->DrawObject(inDoc->GetImage(), objectID, workRect, inDoc->GetZoomLevel()); } } } diff --git a/src/T2DLL/T2WorldDef.h b/src/T2DLL/T2WorldDef.h index 6aa3ee6..d23bd97 100644 --- a/src/T2DLL/T2WorldDef.h +++ b/src/T2DLL/T2WorldDef.h @@ -84,9 +84,9 @@ public: } virtual unsigned long OptionProc(unsigned long, void*) { return 0; } - unsigned int GetToiletDenomi(unsigned int inVal) const; - unsigned int GetColdDenomi(unsigned int inVal1, unsigned int inVal2) const; - BOOL IsDustOn(unsigned int inVal) const; + unsigned int GetToiletDenomi(unsigned int inGameLevel) const; + unsigned int GetColdDenomi(unsigned int inGameLevel, unsigned int inMonth) const; + BOOL IsDustOn(unsigned int inGameLevel) const; T2TowerVision* GetTowerVision(); void SetLatestBuild(T2Equip* inEquip, BOOL inFlag); void SetLatestBuild(T2ToolDef* inToolDef, BOOL inFlag); @@ -155,6 +155,7 @@ protected: friend class T2Terrorist; friend class T2ToolDef; friend class T2ToolWindow; + friend class T2TowerDoc; friend class T2WorldPlugin; friend class T2VisitVIP; @@ -165,8 +166,8 @@ protected: POINT mInitPos; int mTopFloorLine; int mBottomFloorLine; - int m70; - int m74; + int m70; // starting level + int m74; // starting month int _78; int _7C; int _80; @@ -174,15 +175,15 @@ protected: GradeDef mGradeDef[8]; int m148[5]; char m15C[20]; - unsigned int mDustOnThreshold; - unsigned int mToiletVar1; - unsigned int mToiletVar2; + unsigned int mMinimumLevelForDust; + unsigned int mMinimumLevelForToilet; + unsigned int mToiletDenomi; int m17C; int mBGVUnit; int mBGHUnit; int mSkyVSize; int mSkyHSize; - POINT m190; + POINT m190; // crane size T2WordDefArray *mWordDefArray; T2BitImage *mSkyOffscreen; T2BitImage *m1A0; diff --git a/src/T2DLL/T2WorldPlugin.cpp b/src/T2DLL/T2WorldPlugin.cpp index afa7d1c..fc55a9c 100644 --- a/src/T2DLL/T2WorldPlugin.cpp +++ b/src/T2DLL/T2WorldPlugin.cpp @@ -90,7 +90,7 @@ void T2WorldPlugin::_DrawFunds(CWnd*, int) { int result = 0; if (inDoc->mGameLevel <= inWorldDef->mNumOfGradeDef) { - T2Pool *thePool = inDoc->towerDoc_vf130(); + T2Pool *thePool = inDoc->GetPool(); if (thePool) { GradeDef gradeDef = inWorldDef->mGradeDef[inDoc->mGameLevel - 1]; int population = thePool->GetPopulation(); diff --git a/src/T2DLL/TenantSearchDlg.cpp b/src/T2DLL/TenantSearchDlg.cpp index b0845c0..d2ec1bc 100644 --- a/src/T2DLL/TenantSearchDlg.cpp +++ b/src/T2DLL/TenantSearchDlg.cpp @@ -44,7 +44,7 @@ void TenantSearchDlg::DoFind() { return; T2Name *theName = (T2Name *) listBox->GetItemDataPtr(sel); - mDocument->towerDoc_vf238(theName); + mDocument->DoFind(theName); } void TenantSearchDlg::DoDelete() { diff --git a/src/T2DLL/WalkerDlg.cpp b/src/T2DLL/WalkerDlg.cpp index fdd7e63..4c2c842 100644 --- a/src/T2DLL/WalkerDlg.cpp +++ b/src/T2DLL/WalkerDlg.cpp @@ -1,4 +1,4 @@ -#include "CT2App.h" +#include "T2.h" #include "T2CtrlPalette.h" #include "T2DlgItem.h" #include "T2MainWindow.h" @@ -45,7 +45,7 @@ void WalkerDlg::Revert() { } void WalkerDlg::Save() { - T2CtrlPalette *theCtrlPalette = ((CT2App *) AfxGetApp())->mMainWindow->mCtrlPalette; + T2CtrlPalette *theCtrlPalette = T2_APP->mMainWindow->mCtrlPalette; if (!theCtrlPalette) return; @@ -59,13 +59,13 @@ void WalkerDlg::Save() { theSlider->SetData(value); if (mFC == 0) - mDocument->towerDoc_vf14C(-1); + mDocument->SetWalkRate(-1); else - mDocument->towerDoc_vf14C(mFC); + mDocument->SetWalkRate(mFC); } /*virtual*/ void WalkerDlg::OnT2Create() { - mFC = mDocument->towerDoc_vf148(); + mFC = mDocument->GetWalkRate(); if (mFC == -1) mFC = 0; |