| 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/WireframeGrWnd.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:39 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Wireframe view of mine |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 2 2/05/98 3:18p Matt |
| 30 | * Renamed GetSegmentFromPoint() to GetCellFromPoint() |
| 31 | * |
| 32 | * 13 5/22/97 5:16p Jason |
| 33 | * added "drawing" on the topo map |
| 34 | * |
| 35 | * 12 5/15/97 3:27a Jason |
| 36 | * implemented terrain magnification |
| 37 | * |
| 38 | * 11 4/11/97 4:20p Jason |
| 39 | * now draws the player on the wireframe terrain window |
| 40 | * |
| 41 | * 10 3/20/97 3:02p Samir |
| 42 | * Implemented Selection Manager in Wireframe window. |
| 43 | * |
| 44 | * 9 2/28/97 2:21p Samir |
| 45 | * You can drag a box within the wireframe window. |
| 46 | * |
| 47 | * 8 2/19/97 5:37p Matt |
| 48 | * Added code to set curseg from clicking in wireframe window |
| 49 | * |
| 50 | * 7 1/30/97 6:48p Samir |
| 51 | * Added some NC_xxx message handlers |
| 52 | * |
| 53 | * 6 1/23/97 4:56p Samir |
| 54 | * Handles saving screen positions of windows and tileability. |
| 55 | * |
| 56 | * 5 1/21/97 12:44p Samir |
| 57 | * Floatable-resizable views |
| 58 | * |
| 59 | * $NoKeywords: $ |
| 60 | */ |
| 61 | |
| 62 | #ifndef M_WIREFRAMEGRWND_H |
| 63 | #define M_WIREFRAMEGRWND_H |
| 64 | |
| 65 | #include "GrWnd.h" |
| 66 | #include "3d.h" |
| 67 | |
| 68 | ///////////////////////////////////////////////////////////////////////////// |
| 69 | // CWireframeGrWnd window |
| 70 | |
| 71 | class CWireframeGrWnd : public CGrWnd { |
| 72 | // Construction |
| 73 | public: |
| 74 | CWireframeGrWnd(); |
| 75 | |
| 76 | // Attributes |
| 77 | public: |
| 78 | // Operations |
| 79 | public: |
| 80 | BOOL Create(RECT &rect, BOOL movable, CWnd *pParent); |
| 81 | void Render(); |
| 82 | |
| 83 | void GetHighlightedRect(int *left, int *top, int *right, int *bottom); |
| 84 | void DrawPlayerOnTerrain(); |
| 85 | |
| 86 | // Overrides |
| 87 | // ClassWizard generated virtual function overrides |
| 88 | //{{AFX_VIRTUAL(CWireframeGrWnd) |
| 89 | //}}AFX_VIRTUAL |
| 90 | |
| 91 | // Implementation |
| 92 | public: |
| 93 | virtual ~CWireframeGrWnd(); |
| 94 | void GetMagCoords(int *, int *, int *, int *); |
| 95 | void SetMagCoords(int, int, int, int); |
| 96 | int m_x1, m_x2, m_y1, m_y2; // min,max of topographical map magnification |
| 97 | void DrawTerrainWorld(grViewport *vp, vector *view_target, matrix *view_orient, float view_dist); |
| 98 | int GetCellFromPoint(int x, int y); |
| 99 | void DrawTerrainCell(int seg); |
| 100 | |
| 101 | // Generated message map functions |
| 102 | protected: |
| 103 | //{{AFX_MSG(CWireframeGrWnd) |
| 104 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); |
| 105 | afx_msg void OnDestroy(); |
| 106 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 107 | afx_msg void OnPaint(); |
| 108 | afx_msg void OnMove(int x, int y); |
| 109 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam); |
| 110 | afx_msg BOOL OnNcActivate(BOOL bActive); |
| 111 | afx_msg void OnNcPaint(); |
| 112 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); |
| 113 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); |
| 114 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); |
| 115 | afx_msg void OnRButtonDown(UINT nFlags, CPoint point); |
| 116 | //}}AFX_MSG |
| 117 | DECLARE_MESSAGE_MAP() |
| 118 | |
| 119 | private: |
| 120 | BOOL m_Movable; // is this a floating window? |
| 121 | RECT m_HighlightedRect; |
| 122 | |
| 123 | void draw_tile_caption(CDC *dc); // special caption for tiled windows. |
| 124 | }; |
| 125 | |
| 126 | ///////////////////////////////////////////////////////////////////////////// |
| 127 | #endif |