forked from BoyC/GW2TacO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrailLogger.h
109 lines (79 loc) · 2.89 KB
/
TrailLogger.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
#pragma once
#include "Bedrock/WhiteBoard/whiteboard.h"
#include "MumbleLink.h"
#include "gw2tactical.h"
void GlobalDoTrailLogging( TS32 mapID, CVector3 charPos );
struct GW2TrailVertex
{
CVector4 Pos;
CVector2 UV;
CVector4 CenterPos;
CColor Color;
};
class GW2Trail
{
friend class GW2TrailDisplay;
CArray<CVector3> positions;
void Reset( TS32 _mapID = 0 );
TBOOL SaveToFile( const CString& fname );
public:
virtual ~GW2Trail();
TS32 length = 0;
CCoreVertexBuffer* trailMesh = nullptr;
CCoreDevice* dev = nullptr;
CCoreIndexBuffer* idxBuf = nullptr;
TS32 map = 0;
void Build( CCoreDevice* dev, TS32 mapID, float* points, int pointCount );
void Draw();
void Update();
void SetupAndDraw( CCoreConstantBuffer* constBuffer, CCoreTexture* texture, CMatrix4x4& cam, CMatrix4x4& persp, float& one, bool scaleData, TS32 fadeoutBubble, float* data, float fadeAlpha, float width, float uvScale, float width2d );
MarkerTypeData typeData;
CString Type;
GUID guid;
TBOOL External = false;
CString zipFile;
GW2TacticalCategory *category = nullptr;
void SetCategory( CWBApplication *App, GW2TacticalCategory *t );
TBOOL Import( CStreamReaderMemory& file, TBOOL keepPoints = false );
TBOOL Import( CString& fileName, const CString& zipFile, TBOOL keepPoints = false );
};
class GW2TrailDisplay : public CWBItem
{
TF32 asp;
CMatrix4x4 cam;
CMatrix4x4 persp;
CRect drawrect;
virtual void OnDraw( CWBDrawAPI *API );
void DrawMinimap( CWBDrawAPI *API );
CCoreVertexFormat *vertexFormat = nullptr;
CCoreVertexShader* vxShader = nullptr;
CCorePixelShader* pxShader = nullptr;
CCoreConstantBuffer* constBuffer = nullptr;
CCoreTexture2D* trailTexture = nullptr;
CCoreSamplerState* trailSampler = nullptr;
CCoreRasterizerState* trailRasterizer1 = nullptr;
CCoreRasterizerState* trailRasterizer2 = nullptr;
CCoreRasterizerState* trailRasterizer3 = nullptr;
CCoreDepthStencilState* trailDepthStencil = nullptr;
GW2Trail* editedTrail = nullptr;
void ClearEditedTrail();
TBOOL trailBeingRecorded = false;
TBOOL trailRecordPaused = false;
LIGHTWEIGHT_CRITICALSECTION critsec;
CCoreTexture2D* GetTexture( const CString& fname, const CString& zipFile, const CString& categoryZip);
CDictionary<CString, CCoreTexture2D*> textureCache;
public:
GW2TrailDisplay( CWBItem *Parent, CRect Position );
virtual ~GW2TrailDisplay();
static CWBItem *Factory( CWBItem *Root, CXMLNode &node, CRect &Pos );
WB_DECLARE_GUIITEM( _T( "gw2Trails" ), CWBItem );
virtual TBOOL IsMouseTransparent( CPoint &ClientSpacePoint, WBMESSAGE MessageType );
void DoTrailLogging( TS32 mapID, CVector3 charPos );
void StartStopTrailRecording( TBOOL start );
void PauseTrail( TBOOL pause, TBOOL newSection = false );
void DeleteLastTrailSegment();
void DeleteTrailSegment();
void ExportTrail();
void ImportTrail();
void DrawProxy( CWBDrawAPI *API, bool miniMaprender );
};