summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2ArrowWnd.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2ArrowWnd.cpp
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2ArrowWnd.cpp58
1 files changed, 33 insertions, 25 deletions
diff --git a/src/T2DLL/T2ArrowWnd.cpp b/src/T2DLL/T2ArrowWnd.cpp
index 0271881..6c60c08 100644
--- a/src/T2DLL/T2ArrowWnd.cpp
+++ b/src/T2DLL/T2ArrowWnd.cpp
@@ -3,17 +3,11 @@
#include "T2TowerDoc.h"
#include "T2TowerMainView.h"
-CObject* PASCAL T2ArrowWnd::CreateObject() {
-#line 33
- return DEBUG_NEW T2ArrowWnd;
-}
-IMPLEMENT_DYNAMIC(T2ArrowWnd, CFrameWnd);
-
-T2ArrowWnd::T2ArrowWnd() {
-}
-
-/*virtual*/ T2ArrowWnd::~T2ArrowWnd() {
-}
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
static POINT rgnPoints[7] = {
{20,35},
@@ -25,27 +19,36 @@ static POINT rgnPoints[7] = {
{40,15}
};
+#line 33
+IMPLEMENT_DYNCREATE(T2ArrowWnd, CFrameWnd);
+
+T2ArrowWnd::T2ArrowWnd() {
+}
+
+/*virtual*/ T2ArrowWnd::~T2ArrowWnd() {
+}
+
void T2ArrowWnd::Show(int inX, int inY, T2TowerDoc* inDoc) {
mWndClass = AfxRegisterWndClass(CS_NOCLOSE, NULL, (HBRUSH) GetStockObject(WHITE_BRUSH));
- CRect rect1(0, 0, 50, 50);
- Create(mWndClass, "ArrowWnd", WS_CHILD, rect1, inDoc->GetTowerMainView(), NULL, WS_EX_TOPMOST);
+ CRect rect(0, 0, 50, 50);
+ Create(mWndClass, "ArrowWnd", WS_CHILD, rect, inDoc->GetTowerMainView(), NULL, WS_EX_TOPMOST);
mRgn.CreatePolygonRgn(rgnPoints, 7, ALTERNATE);
- CRect rect2;
- GetClientRect(rect2);
+ CRect clientRect;
+ GetClientRect(clientRect);
- CPoint pt;
- pt.x = ((rect1.right - rect1.left) - (rect2.right - rect2.left)) / 2;
- pt.y = ((rect1.bottom - rect1.top) - (rect2.bottom - rect2.top)) / 2;
+ CPoint center;
+ center.x = ((rect.right - rect.left) - (clientRect.right - clientRect.left)) / 2;
+ center.y = ((rect.bottom - rect.top) - (clientRect.bottom - clientRect.top)) / 2;
- CRgn rgn;
- rgn.CreateRectRgn(0, 0, 1, 1);
- rgn.CopyRgn(&mRgn);
- rgn.OffsetRgn(pt.x, pt.y);
- SetWindowRgn(rgn, true);
- rgn.Detach();
+ CRgn region;
+ region.CreateRectRgn(0, 0, 1, 1);
+ region.CopyRgn(&mRgn);
+ region.OffsetRgn(center.x, center.y);
+ SetWindowRgn(region, true);
+ region.Detach();
SetWindowPos(NULL, inX - 20, inY - 45, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
GetCurrentT2TowerDoc()->towerDoc_vf290(true);
@@ -67,7 +70,12 @@ afx_msg BOOL T2ArrowWnd::OnEraseBkgnd(CDC* pDC) {
CRect rect;
GetClientRect(rect);
- pDC->FillSolidRect(rect, (mCounter & 1) ? RGB(255, 0, 0) : RGB(255, 255, 0));
+ COLORREF bkColor;
+ if (mCounter & 1)
+ bkColor = RGB(255, 0, 0);
+ else
+ bkColor = RGB(255, 255, 0);
+ pDC->FillSolidRect(rect, bkColor);
CBrush brush;
brush.CreateStockObject(BLACK_BRUSH);