Debian Codegraph @

editor/BriefEdit.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
19 #if !defined(AFX_BRIEFEDIT_H__839B53D1_41D6_11D2_B359_006008BF0B09__INCLUDED_)
20 #define AFX_BRIEFEDIT_H__839B53D1_41D6_11D2_B359_006008BF0B09__INCLUDED_
21
22 #if _MSC_VER >= 1000
23 #pragma once
24 #endif // _MSC_VER >= 1000
25 // BriefEdit.h : header file
26 //
27
28 #include "pstypes.h"
29 #include "telcomefxstructs.h"
30 #include "telcom.h"
31 #include "gr.h"
32 #include "resource.h"
33
34 /////////////////////////////////////////////////////////////////////////////
35 // CBriefEdit dialog
36
37 #define MAX_EFFECTS_PER_SCREEN 32
38
39 // BriefGlobalValues
40 //
41 // struct for global variables for a telcom briefing
42 struct BriefGlobalValues {
43 char title[128];
44 float static_val, glitch_val;
45 };
46
47 #define BE_NONE -1
48 #define BE_TEXT 0
49 #define BE_BMP 1
50 #define BE_MOVIE 2
51 #define BE_BKG 3
52 #define BE_POLY 4
53 #define BE_SND 5
54 #define BE_BUTTON 6
55 // tBriefEffect
56 //
57 // struct for a briefing effect
58 struct tBriefEffect {
59 uint8_t type; // type of effect (for union)
60 bool used; // is the effect being used
61 int id; // ID# used
62 char *text; // buffer of text
63 char description[128];
64 int w, h; // used for bitmaps
65 union {
66 TCTEXTDESC text_desc;
67 TCBMPDESC bmp_desc;
68 TCMOVIEDESC movie_desc;
69 TCBKGDESC bkg_desc;
70 TCPOLYDESC poly_desc;
71 TCSNDDESC snd_desc;
72 TCBUTTONDESC button_desc;
73 };
74 int next, prev; // next/prev effect in list
75 };
76
77 struct tBriefScreen {
78 bool used; // is screen being used
79 int root_effect; // root effect to start the list
80 char layout[_MAX_PATH]; // layout screen to use
81 tBriefEffect effects[MAX_EFFECTS_PER_SCREEN]; // the effects for the screen
82 uint32_t mission_mask_set, mission_mask_unset;
83 int next, prev; // next/prev screen in list
84 };
85
86 extern int Briefing_root_screen;
87 extern tBriefScreen Briefing_screens[MAX_TELCOM_SCREENS];
88
89 /*
90 ****************************************************************************
91 * Functions to manipulate effects/screens in briefing editor *
92 ****************************************************************************
93 *
94 */
95
96 // BriefEditInitScreens
97 //
98 // Initializes the briefing screens so they are empty
99 void BriefEditInitScreens(void);
100
101 // BriefEditInitEffect
102 //
103 // Initializes an effect to empty
104 void BriefEditInitEffect(tBriefEffect *efx);
105
106 // BriefEditFreeScreens
107 //
108 // Closes down all the briefing screens, freeing memory
109 void BriefEditFreeScreens(void);
110
111 // BriefEditFreeEffect
112 //
113 // Frees up any memory allocated in an effect
114 void BriefEditFreeEffect(tBriefEffect *efx);
115
116 // BriefEditSaveScreens
117 //
118 // Saves out the screens to a briefing file
119 uint8_t BriefEditSaveScreens(char *filename, CComboBox *screen_combo, BriefGlobalValues *glob);
120
121 // BriefEditLoadScreens
122 //
123 // Loads in screens from a briefing file
124 uint8_t BriefEditLoadScreens(char *filename, CComboBox *screen_combo, CComboBox *effect_combo, BriefGlobalValues *glob);
125
126 #define MAX_LAYOUT_PREDEFS 10
127 struct tLayoutScreen {
128 char filename[_MAX_PATH];
129 int num_texts, num_bmps;
130 struct {
131 int lx, rx, ty, by;
132 } texts[MAX_LAYOUT_PREDEFS];
133 struct {
134 int x, y;
135 } bmps[MAX_LAYOUT_PREDEFS];
136 };
137
138 extern tLayoutScreen *PBlayouts;
139 extern int *PBnum_layouts;
140
141 class CBriefEdit : public CDialog {
142 // Construction
143 public:
144 BriefGlobalValues m_GlobalValues;
145 tLayoutScreen *layouts;
146 int num_layouts;
147 CBriefEdit(CWnd *pParent = NULL); // standard constructor
148 void ParseLayoutScreenFile(char *filename);
149 void SetLayoutBitmap(char *filename);
150 bool has_changed;
151 // BriefEditAllocateEffect
152 //
153 // Allocates an effect (links it and all) to be edited. Returns false on error
154 bool BriefEditAllocateEffect(int *screen, int *eff);
155 // BriefEditGetCurScreenEffect
156 //
157 // Fills in the current screen and effect that is being worked on
158 void BriefEditGetCurScreenEffect(int *ret_screen, int *ret_effect);
159
160 // Dialog Data
161 //{{AFX_DATA(CBriefEdit)
162 enum { IDD = IDD_BRIEF_MAIN };
163 float m_fGlitch;
164 float m_fStatic;
165 CString m_sTitle;
166 //}}AFX_DATA
167
168 // Overrides
169 // ClassWizard generated virtual function overrides
170 //{{AFX_VIRTUAL(CBriefEdit)
171 protected:
172 virtual void DoDataExchange(CDataExchange *pDX); // DDX/DDV support
173 //}}AFX_VIRTUAL
174
175 // Implementation
176 protected:
177 int layout_bmp;
178 void UpdateView();
179 void UpdateInfo();
180 void UpdateLayoutBitmap(void);
181 void DrawRect(ddgr_color color, int lx, int ty, int rx, int by, grViewport *vport);
182
183 grHardwareSurface m_ObjectSurf;
184
185 // Generated message map functions
186 //{{AFX_MSG(CBriefEdit)
187 virtual void OnOK();
188 afx_msg void OnBriefEffectBitmap();
189 afx_msg void OnBriefEffectButton();
190 afx_msg void OnBriefEffectDel();
191 afx_msg void OnBriefEffectEdit();
192 afx_msg void OnBriefEffectMovie();
193 afx_msg void OnBriefEffectSound();
194 afx_msg void OnBriefEffectText();
195 afx_msg void OnBriefScreenAdd();
196 afx_msg void OnBriefScreenDel();
197 afx_msg void OnBriefScreenEdit();
198 virtual BOOL OnInitDialog();
199 afx_msg void OnDestroy();
200 afx_msg void OnSelchangeBriefScreenList();
201 afx_msg void OnBriefSave();
202 afx_msg void OnLoad();
203 afx_msg void OnTimer(UINT nIDEvent);
204 afx_msg void OnManage();
205 //}}AFX_MSG
206 DECLARE_MESSAGE_MAP()
207 };
208
209 //{{AFX_INSERT_LOCATION}}
210 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
211
212 #endif // !defined(AFX_BRIEFEDIT_H__839B53D1_41D6_11D2_B359_006008BF0B09__INCLUDED_)