Debian Codegraph @

editor/TextureDialog.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/editor/TextureDialog.h $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003-08-26 03:57:39 $
23 * $Author: kevinb $
24 *
25 * Texture dialog keypad
26 *
27 * $Log: not supported by cvs2svn $
28 *
29 * 13 4/08/99 5:47p Jason
30 * added face finding function
31 *
32 * 12 12/04/98 1:14p Jason
33 * added "Currently Used" texture flag
34 *
35 * 11 8/20/98 4:09p Jason
36 * added facemap feature
37 *
38 * 10 8/05/98 8:44p Jason
39 * added uniform scaling of textures
40 *
41 * 9 6/15/98 4:00p Jason
42 * replaced monochromatic polymodel lighting with rgb lighting
43 *
44 * 8 3/03/98 5:39p Jason
45 * added swatch to texture tab
46 *
47 * 7 11/14/97 12:41p Jason
48 * Added ReplaceTexture function
49 *
50 * 6 9/15/97 1:18p Jason
51 * got selectable tmap2s working
52 *
53 * 5 9/14/97 9:48p Matt
54 * Made CEditorView a friend class
55 *
56 * 4 8/29/97 1:52p Samir
57 * Added bitmap buttons for Texture Keypad.
58 *
59 * 3 8/25/97 7:39p Samir
60 * Using new GrListBox from old editorPictListBox
61 *
62 * 10 6/03/97 4:55p Mark
63 *
64 * 9 5/27/97 3:11p Samir
65 * Allow 'masking' of textures to be displayed in listbox.
66 *
67 * 8 4/11/97 4:53p Samir
68 * Grab texture button works for tmap 1s
69 *
70 * 7 2/26/97 4:00p Samir
71 * Added most keypad functions.
72 *
73 * 6 2/21/97 5:09p Samir
74 * Uses new PictListBox class for texture listbox here.
75 *
76 * 5 2/19/97 7:30p Samir
77 * Got scrolling texture view to work.
78 *
79 * 4 1/27/97 11:38a Samir
80 * Added horizontal scrolling of keypad modeless dialog.
81 *
82 * $NoKeywords: $
83 */
84
85 #ifndef M_TEXTUREDIALOG_H
86 #define M_TEXTUREDIALOG_H
87
88 #include "KeypadDialog.h"
89 #include "GrListBox.h"
90
91 class CGrTextureListBox : public CGrListBox {
92 protected:
93 // enumerates items maximum in the list box. this is here to insure that any changes in
94 // the user-managed list.
95 virtual int ListEnumerate();
96
97 // Specify the first item to be drawn in the box by DrawItem. returns the item #
98 // return -1 if there is no first item (list is empty, maybe)
99 virtual int ListFirstItem(int firsttex);
100
101 // Specify the next/prev item to be drawn in the box by DrawItem.
102 // Returns the item # following or preceding the passed the item #
103 virtual int ListNextItem(int curtex);
104 virtual int ListPrevItem(int curtex);
105
106 // draw the item
107 virtual void DrawItem(int x, int y, grHardwareSurface *itemsurf, int item);
108
109 // if item was selected from the list box, this function is invoked.
110 virtual void OnItemSelected(int tex);
111 };
112
113 /////////////////////////////////////////////////////////////////////////////
114 // CTextureDialog dialog
115
116 class CTextureDialog : public CKeypadDialog {
117 // Construction
118 public:
119 CTextureDialog(CWnd *pParent = NULL); // standard constructor
120
121 // selects a texture in the texture dialog
122 void SelectTexture(int texnum);
123 void DrawSwatch(int handle, float r, float g, float b);
124
125 // Dialog Data
126 //{{AFX_DATA(CTextureDialog)
127 enum { IDD = IDD_TEXTUREKEYPAD };
128 // NOTE: the ClassWizard will add data members here
129 //}}AFX_DATA
130
131 // Overrides
132 // ClassWizard generated virtual function overrides
133 //{{AFX_VIRTUAL(CTextureDialog)
134 protected:
135 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
136 //}}AFX_VIRTUAL
137
138 public:
139 virtual void RunKeypadFunction(int code);
140
141 // Implementation
142 protected:
143 // Generated message map functions
144 //{{AFX_MSG(CTextureDialog)
145 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
146 afx_msg void OnSize(UINT nType, int cx, int cy);
147 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar);
148 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar);
149 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
150 afx_msg void OnPaint();
151 virtual BOOL OnInitDialog();
152 afx_msg void OnTexpadFlipX();
153 afx_msg void OnTexpadFlipY();
154 afx_msg void OnTexpadSlideLeft();
155 afx_msg void OnTexpadSlideRight();
156 afx_msg void OnTexpadRotLeft();
157 afx_msg void OnTexpadRotRight();
158 afx_msg void OnTexpadRotate90();
159 afx_msg void OnTexpadStretchLess();
160 afx_msg void OnTexpadStretchMore();
161 afx_msg void OnTexpadSlideUp();
162 afx_msg void OnTexpadSlideDown();
163 afx_msg void OnTexpadSetDefault();
164 afx_msg void OnTexpadNextEdge();
165 afx_msg void OnTexpadGrab();
166 afx_msg void OnShowMineTextures2();
167 afx_msg void OnShowObjTextures();
168 afx_msg void OnShowLightTextures();
169 afx_msg void OnShowTerrainTextures();
170 afx_msg BOOL OnHelpInfo(HELPINFO *pHelpInfo);
171 afx_msg void OnResetAllTextures();
172 afx_msg void OnDestroy();
173 afx_msg void OnShowTmap2Textures();
174 afx_msg void OnReplaceTexture();
175 afx_msg void OnKillfocusTexscaleEdit();
176 afx_msg void OnTexpadExpandU();
177 afx_msg void OnTexpadExpandV();
178 afx_msg void OnTexpadContractU();
179 afx_msg void OnTexpadContractV();
180 afx_msg void OnFaceMap();
181 afx_msg void OnCurrentUsed();
182 afx_msg void OnFindTexture();
183 //}}AFX_MSG
184 DECLARE_MESSAGE_MAP()
185
186 private:
187 CGrTextureListBox m_TexLB;
188
189 CBitmap m_bmUp;
190 CBitmap m_bmDown;
191 CBitmap m_bmLeft;
192 CBitmap m_bmRight;
193 CBitmap m_bmRotLeft;
194 CBitmap m_bmRotRight;
195 CBitmap m_bmStretchLess;
196 CBitmap m_bmStretchMore;
197
198 friend class CEditorView;
199 };
200
201 #endif