summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2WorldDef.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-05 19:04:06 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-05 19:04:06 +0100
commit5e61c1280c15ab9969b94cd360cafd4a11b2dd30 (patch)
tree1fdb60d771c4351b5aa5dcf1a43376c0558625a4 /src/T2DLL/T2WorldDef.cpp
parentc2efba6907fab934a04959b9bb644cf7141cc955 (diff)
downloadt2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz
t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip
matched T2.exe
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2WorldDef.cpp96
1 files changed, 48 insertions, 48 deletions
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());
}
}
}