summaryrefslogtreecommitdiff
path: root/src/T2CtrlPalette.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/T2CtrlPalette.cpp
parentc2efba6907fab934a04959b9bb644cf7141cc955 (diff)
downloadt2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.tar.gz
t2win-5e61c1280c15ab9969b94cd360cafd4a11b2dd30.zip
matched T2.exe
Diffstat (limited to '')
-rw-r--r--src/T2CtrlPalette.cpp66
1 files changed, 35 insertions, 31 deletions
diff --git a/src/T2CtrlPalette.cpp b/src/T2CtrlPalette.cpp
index ee01d9a..d751a9c 100644
--- a/src/T2CtrlPalette.cpp
+++ b/src/T2CtrlPalette.cpp
@@ -4,19 +4,25 @@
#include "T2TowerDoc.h"
#include "T2WorldDef.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
// T2.exe 44795C
/*static*/ int T2CtrlPalette::sUnknown = 0;
T2CtrlPalette::T2CtrlPalette() {
#line 19
- mPauseControl = DEBUG_NEW T2MWControl;
- mInViewControl = DEBUG_NEW T2MWControl;
- mOutViewControl = DEBUG_NEW T2MWControl;
- mMaintControl = DEBUG_NEW T2MWControl;
- mEvalControl = DEBUG_NEW T2MWControl;
- mTransControl = DEBUG_NEW T2MWControl;
- mPriceControl = DEBUG_NEW T2MWControl;
- mSliderControl = DEBUG_NEW T2MWControl;
+ mPauseControl = new T2MWControl;
+ mInViewControl = new T2MWControl;
+ mOutViewControl = new T2MWControl;
+ mMaintControl = new T2MWControl;
+ mEvalControl = new T2MWControl;
+ mTransControl = new T2MWControl;
+ mPriceControl = new T2MWControl;
+ mSliderControl = new T2MWControl;
mDocument = NULL;
mWorldDef = NULL;
@@ -42,7 +48,7 @@ BEGIN_MESSAGE_MAP(T2CtrlPalette, CFrameWnd)
ON_WM_CLOSE()
END_MESSAGE_MAP()
-/*virtual*/ void T2CtrlPalette::Setup(T2TowerDoc *inDoc) {
+/*virtual*/ void T2CtrlPalette::SetDocument(T2TowerDoc *inDoc) {
mDocument = inDoc;
mWorldDef = inDoc->mWorldDef;
@@ -87,7 +93,7 @@ END_MESSAGE_MAP()
InvalidateRect(NULL);
}
-/*virtual*/ void T2CtrlPalette::vf100(int which) {
+/*virtual*/ void T2CtrlPalette::vf100(int inViewMode) {
mInViewControl->SetData(0);
mOutViewControl->SetData(0);
mMaintControl->SetData(0);
@@ -95,30 +101,30 @@ END_MESSAGE_MAP()
mTransControl->SetData(0);
mPriceControl->SetData(0);
- int walkRate = mDocument->towerDoc_vf148();
+ int walkRate = mDocument->GetWalkRate();
if (walkRate == -1)
walkRate = 0;
else
walkRate = 7 - walkRate;
mSliderControl->SetData(walkRate);
- switch (which) {
- case 0:
+ switch (inViewMode) {
+ case kInView:
mInViewControl->SetData(100);
break;
- case 1:
+ case kOutView:
mOutViewControl->SetData(100);
break;
- case 4:
+ case kMaintView:
mMaintControl->SetData(100);
break;
- case 2:
+ case kEvalView:
mEvalControl->SetData(100);
break;
- case 5:
+ case kTransView:
mTransControl->SetData(100);
break;
- case 3:
+ case kPriceView:
mPriceControl->SetData(100);
break;
}
@@ -126,34 +132,35 @@ END_MESSAGE_MAP()
InvalidateRect(NULL);
}
-/*virtual*/ void T2CtrlPalette::vf104(int which) {
+/*virtual*/ void T2CtrlPalette::vf104(int inViewMode) {
+#pragma var_order(windowRect, y, clientRect, flag)
RECT windowRect;
RECT clientRect;
int flag = 0;
int y;
- switch (which) {
- case 0:
- case 6:
+ switch (inViewMode) {
+ case kInView:
+ case ViewMode_6:
y = 0;
break;
- case 1:
+ case kOutView:
y = 0;
flag = 1;
break;
- case 4:
+ case kMaintView:
y = 21;
mE0 = "Maint";
break;
- case 2:
+ case kEvalView:
y = 21;
mE0 = "Eval";
break;
- case 5:
+ case kTransView:
y = 21;
mE0 = "Trans";
break;
- case 3:
+ case kPriceView:
y = 21;
mE0 = "Price";
break;
@@ -226,8 +233,5 @@ afx_msg void T2CtrlPalette::OnClose() {
if (!mDocument)
return;
- mDocument->towerDoc_vf198(kTowerDocWindowType0);
-}
-
-/*virtual*/ void T2CtrlPalette::vf108() {
+ mDocument->towerDoc_vf198(kControlWindow);
}