-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflasher.h
148 lines (124 loc) · 4.89 KB
/
flasher.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Flasher.h: Definition of the Flasher class
//
//////////////////////////////////////////////////////////////////////
#pragma once
#if !defined(AFX_FLASHER_H__87DAB93E_7D6F_4fe4_A5F9_632FD82BDB4A__INCLUDED_)
#define AFX_FLASHER_H__87DAB93E_7D6F_4fe4_A5F9_632FD82BDB4A__INCLUDED_
#include "resource.h" // main symbols
class FlasherData
{
public:
Vertex2D m_vCenter;
float m_sizeX;
float m_sizeY;
float m_height;
COLORREF m_color;
TimerDataRoot m_tdr;
char m_szImage[MAXTOKEN];
float m_rotX,m_rotY,m_rotZ;
long m_fAlpha;
bool m_IsVisible;
bool m_fAddBlend;
BOOL m_fDisplayTexture;
float m_depthBias; // for determining depth sorting
};
/////////////////////////////////////////////////////////////////////////////
// Flasher
class Flasher :
public IDispatchImpl<IFlasher, &IID_IFlasher, &LIBID_VPinballLib>,
public ISupportErrorInfo,
public CComObjectRoot,
public CComCoClass<Flasher,&CLSID_Flasher>,
#ifdef VBA
public CApcProjectItem<Flasher>,
#endif
public EventProxy<Flasher, &DIID_IFlasherEvents>,
public IConnectionPointContainerImpl<Flasher>,
public IProvideClassInfo2Impl<&CLSID_Flasher, &DIID_IFlasherEvents, &LIBID_VPinballLib>,
public ISelect,
public IEditable,
public Hitable,
public IScriptable,
public IFireEvents,
public IPerPropertyBrowsing // Ability to fill in dropdown in property browser
{
public:
Flasher();
virtual ~Flasher();
BEGIN_COM_MAP(Flasher)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IFlasher)
//COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
COM_INTERFACE_ENTRY(IPerPropertyBrowsing)
COM_INTERFACE_ENTRY(IProvideClassInfo)
COM_INTERFACE_ENTRY(IProvideClassInfo2)
END_COM_MAP()
BEGIN_CONNECTION_POINT_MAP(Flasher)
CONNECTION_POINT_ENTRY(DIID_IFlasherEvents)
END_CONNECTION_POINT_MAP()
STANDARD_DISPATCH_DECLARE
STANDARD_EDITABLE_DECLARES(eItemFlasher)
//DECLARE_NOT_AGGREGATABLE(Flasher)
// Remove the comment from the line above if you don't want your object to
// support aggregation.
DECLARE_REGISTRY_RESOURCEID(IDR_Flasher)
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
//virtual HRESULT GetTypeName(BSTR *pVal);
virtual void GetDialogPanes(Vector<PropertyPane> *pvproppane);
virtual void RenderBlueprint(Sur *psur);
virtual void MoveOffset(const float dx, const float dy);
virtual void SetObjectPos();
virtual int GetMinimumPoints() {return 2;}
virtual void GetCenter(Vertex2D * const pv) const {*pv = m_d.m_vCenter;}
virtual void PutCenter(const Vertex2D * const pv) {m_d.m_vCenter = *pv; m_ptable->SetDirtyDraw();}
virtual bool IsTransparent() { return true; }
virtual float GetDepth(const Vertex3Ds& viewDir)
{ return m_d.m_depthBias + viewDir.x * m_d.m_vCenter.x + viewDir.y * m_d.m_vCenter.y + viewDir.z * m_d.m_height; }
void WriteRegDefaults();
PinTable *m_ptable;
FlasherData m_d;
VertexBuffer *dynamicVertexBuffer;
Material solidMaterial;
Material textureMaterial;
Vertex3D_NoLighting vertices[4];
bool dynamicVertexBufferRegenerate;
// IFlasher
public:
STDMETHOD(get_Image)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(put_Image)(/*[in]*/ BSTR newVal);
STDMETHOD(get_Color)(/*[out, retval]*/ OLE_COLOR *pVal);
STDMETHOD(put_Color)(/*[in]*/ OLE_COLOR newVal);
STDMETHOD(get_SizeX)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_SizeX)(/*[in]*/ float newVal);
STDMETHOD(get_SizeY)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_SizeY)(/*[in]*/ float newVal);
STDMETHOD(get_Height)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_Height)(/*[in]*/ float newVal);
STDMETHOD(get_X)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_X)(/*[in]*/ float newVal);
STDMETHOD(get_Y)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_Y)(/*[in]*/ float newVal);
STDMETHOD(get_RotX)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_RotX)(/*[in]*/ float newVal);
STDMETHOD(get_RotY)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_RotY)(/*[in]*/ float newVal);
STDMETHOD(get_RotZ)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_RotZ)(/*[in]*/ float newVal);
STDMETHOD(get_Alpha)(/*[out, retval]*/ long *pVal);
STDMETHOD(put_Alpha)(/*[in]*/ long newVal);
STDMETHOD(get_IsVisible)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_IsVisible)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_DisplayTexture)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_DisplayTexture)(/*[in]*/ VARIANT_BOOL newVal);
//!! deprecated
STDMETHOD(get_UpdateRegions)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_UpdateRegions)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(TriggerSingleUpdate)();
STDMETHOD(get_AddBlend)(/*[out, retval]*/ VARIANT_BOOL *pVal);
STDMETHOD(put_AddBlend)(/*[in]*/ VARIANT_BOOL newVal);
STDMETHOD(get_DepthBias)(/*[out, retval]*/ float *pVal);
STDMETHOD(put_DepthBias)(/*[in]*/ float newVal);
};
#endif // !defined(AFX_FLASHER_H__87DAB93E_7D6F_4fe4_A5F9_632FD82BDB4A__INCLUDED_)