| 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/TextureGrWnd.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:39 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Texture View Window |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 5 3/02/99 6:03p Jason |
| 30 | * added opengl prototypes |
| 31 | * |
| 32 | * 4 12/21/98 11:30p Matt |
| 33 | * Added names for objects |
| 34 | * |
| 35 | * 3 1/06/98 1:27p Matt |
| 36 | * Cleaned up interfaces to rendering routines, deleted unused code, etc. |
| 37 | * |
| 38 | * 2 9/03/97 8:00p Samir |
| 39 | * Implemented most of the fixes for the object moving system. |
| 40 | * |
| 41 | * 14 6/30/97 12:48p Jeff |
| 42 | * Added right-click popup menu stufff |
| 43 | * |
| 44 | * 13 6/30/97 11:34a Jeff |
| 45 | * |
| 46 | * 12 6/05/97 6:58p Jason |
| 47 | * added more megacell functionality |
| 48 | * |
| 49 | * 11 4/09/97 2:00p Jason |
| 50 | * moved DrawAllPaths function to gamepath where it belongs |
| 51 | * |
| 52 | * 10 4/08/97 10:42a Jason |
| 53 | * implemented path following interface |
| 54 | * |
| 55 | * 9 3/20/97 11:55a Jason |
| 56 | * changes for terrain editing/drawing |
| 57 | * |
| 58 | * 8 2/19/97 11:06a Samir |
| 59 | * Only flip screen if we rendered but did not hit the left button down |
| 60 | * key to prevent green screen flash. |
| 61 | * |
| 62 | * 7 2/18/97 7:57p Matt |
| 63 | * Added code to select a segment by clicking on it in the texture-mapped |
| 64 | * window |
| 65 | * |
| 66 | * 6 1/30/97 6:44p Samir |
| 67 | * Added handlers for Caption bar drawing |
| 68 | * |
| 69 | * $NoKeywords: $ |
| 70 | */ |
| 71 | |
| 72 | // TextureGrWnd.h : header file |
| 73 | // |
| 74 | |
| 75 | #ifndef M_TEXTUREGRWND_H |
| 76 | #define M_TEXTUREGRWND_H |
| 77 | |
| 78 | #include "GrWnd.h" |
| 79 | #include "vecmat.h" |
| 80 | |
| 81 | ///////////////////////////////////////////////////////////////////////////// |
| 82 | // CTextureGrWnd window |
| 83 | |
| 84 | class CTextureGrWnd : public CGrWnd { |
| 85 | // Construction |
| 86 | public: |
| 87 | CTextureGrWnd(); |
| 88 | |
| 89 | // Attributes |
| 90 | public: |
| 91 | // Operations |
| 92 | public: |
| 93 | // note RECT is not const. This means that the rect we get back will be changed |
| 94 | // to the actual rect encompassing the window |
| 95 | BOOL Create(RECT &rect, BOOL movable, CWnd *pParent); |
| 96 | void Render(); |
| 97 | bool SetupPopup(CMenu *popup, char *title); |
| 98 | |
| 99 | // Overrides |
| 100 | // ClassWizard generated virtual function overrides |
| 101 | //{{AFX_VIRTUAL(CTextureGrWnd) |
| 102 | protected: |
| 103 | virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); |
| 104 | //}}AFX_VIRTUAL |
| 105 | |
| 106 | // Implementation |
| 107 | public: |
| 108 | virtual ~CTextureGrWnd(); |
| 109 | |
| 110 | private: |
| 111 | int CTextureGrWnd::TGWFindRoomFace(int x, int y, int *roomnum, int *facenum); |
| 112 | int CTextureGrWnd::TGWFindLightmapFace(int x, int y, int *roomnum, int *facenum, int *lumel_num); |
| 113 | void CTextureGrWnd::TGWRenderMine(vector *pos, matrix *orient, float zoom, int start_roomnum); |
| 114 | |
| 115 | // Generated message map functions |
| 116 | protected: |
| 117 | //{{AFX_MSG(CTextureGrWnd) |
| 118 | afx_msg void OnSize(UINT nType, int cx, int cy); |
| 119 | afx_msg void OnPaint(); |
| 120 | afx_msg void OnDestroy(); |
| 121 | afx_msg void OnMove(int x, int y); |
| 122 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); |
| 123 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam); |
| 124 | afx_msg BOOL OnNcActivate(BOOL bActive); |
| 125 | afx_msg void OnNcPaint(); |
| 126 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); |
| 127 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); |
| 128 | afx_msg void OnRButtonDown(UINT nFlags, CPoint point); |
| 129 | //}}AFX_MSG |
| 130 | DECLARE_MESSAGE_MAP() |
| 131 | |
| 132 | private: |
| 133 | BOOL m_Movable; // is this floating? |
| 134 | BOOL m_StartFlip; // shall we flip the screen when getting to OnPaint. |
| 135 | |
| 136 | vector m_ViewPos; |
| 137 | matrix m_ViewMatrix; // these are used by the object mover. |
| 138 | |
| 139 | // for FindRoomFace() |
| 140 | vector m_last_viewer_eye; |
| 141 | matrix m_last_viewer_orient; |
| 142 | float m_last_zoom; |
| 143 | int m_last_start_room; |
| 144 | void TexGrStartOpenGL(); |
| 145 | void TexGrStopOpenGL(); |
| 146 | }; |
| 147 | |
| 148 | ///////////////////////////////////////////////////////////////////////////// |
| 149 | #endif |