Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/GEDebugger/TabVertices.h
3186 views
1
// Copyright (c) 2012- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <vector>
21
#include "GPU/Common/GPUDebugInterface.h"
22
#include "Windows/W32Util/DialogManager.h"
23
#include "Windows/W32Util/Misc.h"
24
25
class VertexDecoder;
26
27
class CtrlVertexList: public GenericListControl {
28
public:
29
CtrlVertexList(HWND hwnd);
30
~CtrlVertexList();
31
32
void SetRaw(bool raw) {
33
raw_ = raw;
34
Update();
35
}
36
37
protected:
38
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override { return false; }
39
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
40
int GetRowCount() override;
41
42
private:
43
std::vector<GPUDebugVertex> vertices;
44
std::vector<u16> indices;
45
int rowCount_;
46
bool raw_;
47
VertexDecoder *decoder;
48
};
49
50
class TabVertices : public Dialog {
51
public:
52
TabVertices(HINSTANCE _hInstance, HWND _hParent);
53
~TabVertices();
54
55
void Update() override {
56
values->Update();
57
}
58
59
protected:
60
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
61
62
private:
63
void UpdateSize(WORD width, WORD height);
64
65
CtrlVertexList *values;
66
};
67
68
class CtrlMatrixList: public GenericListControl {
69
public:
70
CtrlMatrixList(HWND hwnd);
71
72
protected:
73
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override {
74
return false;
75
}
76
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
77
int GetRowCount() override;
78
void OnDoubleClick(int row, int column) override;
79
void OnRightClick(int row, int column, const POINT &point) override;
80
81
bool ListenColPrePaint() override { return true; }
82
bool OnColPrePaint(int row, int col, LPNMLVCUSTOMDRAW msg) override;
83
84
private:
85
bool GetValue(const GPUgstate &state, int row, int col, float &val);
86
bool ColChanged(const GPUgstate &lastState, const GPUgstate &state, int row, int col);
87
void ToggleBreakpoint(int row);
88
void PromptBreakpointCond(int row);
89
};
90
91
class TabMatrices : public Dialog {
92
public:
93
TabMatrices(HINSTANCE _hInstance, HWND _hParent);
94
~TabMatrices();
95
96
void Update() override {
97
values->Update();
98
}
99
100
protected:
101
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
102
103
private:
104
void UpdateSize(WORD width, WORD height);
105
106
CtrlMatrixList *values;
107
};
108
109