-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCShotAngleIndicator.h
76 lines (66 loc) · 1.51 KB
/
CShotAngleIndicator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef H_SHOT_ANGLE_INDICATOR___
#define H_SHOT_ANGLE_INDICATOR___
// ===================================================================
// CShotAngleIndicator.h
// 角度の目安線を表示するクラス
// ===================================================================
#include <windows.h>
#include <TCHAR.h>
#include "util.h"
#include "../lib/DXUT/dxstdafx.h"
#include "../lib/DXUT/DXUT.h"
#include "resource.h"
#define SHOT_ANGLE_INDICATOR_COLOR (0xDD00FF00)
class CShotAngleIndicator
{
public:
CShotAngleIndicator()
{
m_bVisible = true;
m_nID = -1;
p_pDialog = NULL;
m_pLine = NULL;
};
virtual ~CShotAngleIndicator() { Destroy(); };
virtual BOOL Create(CDXUTDialog* pDialog, int nID, int nPosX, int nPosY, int nLineLength);
virtual void Destroy()
{
if (m_bCreated)
{
CDXUTControl* pControl = p_pDialog->GetControl(m_nID);
if (pControl)
p_pDialog->RemoveControl(m_nID);
m_bCreated = FALSE;
}
m_nID = -1;
p_pDialog = NULL;
m_pLine = NULL;
};
virtual void OnRender(IDirect3DDevice9* pd3dDevice, float fElapsedTime);
virtual void OnMouseClick(int nX, int nY);
virtual void SetVisible(bool value)
{
m_bVisible = value;
if (m_bCreated)
m_pLine->SetVisible(value);
};
virtual bool GetVisible()
{
return m_bVisible;
};
virtual int GetCurrentAngle()
{
return m_nAngle;
}
protected:
BOOL m_bCreated;
CDXUTDialog* p_pDialog;
CDXUTAngleLine* m_pLine; // 地面前;
int m_nID;
bool m_bVisible;
int m_nAngle;
// int m_nCenterPosX;
// int m_nCenterPosY;
// int m_nLength;
};
#endif