Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
genlodextensiondialog.cpp
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
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/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : Max2W3D *
24 * *
25 * $Archive:: /Commando/Code/Tools/max2w3d/genlodextensiondialog.cpp $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * $Author:: Greg_h $*
30 * *
31 * $Modtime:: 10/10/00 11:14a $*
32 * *
33 * $Revision:: 1 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * GenLodExtensionDialogClass::GenLodExtensionDialogClass -- Constructor *
38 * GenLodExtensionDialogClass::~GenLodExtensionDialogClass -- Destructor *
39 * GenLodExtensionDialogClass::Get_Options -- Presents the dialog, gets user input *
40 * GenLodExtensionDialogClass::Dialog_Proc -- Windows message handling *
41 * _gen_lod_ext_dialog_proc -- windows dialog proc *
42 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
43
44
46#include "dllmain.h"
47#include "resource.h"
48#include <Max.h>
49
50
51/**********************************************************************************************
52**
53** GenLodExtensionDialogClass Implementation
54**
55**********************************************************************************************/
56
57
58/***********************************************************************************************
59 * GenLodExtensionDialogClass::GenLodExtensionDialogClass -- Constructor *
60 * *
61 * INPUT: *
62 * *
63 * OUTPUT: *
64 * *
65 * WARNINGS: *
66 * *
67 * HISTORY: *
68 *=============================================================================================*/
70 Hwnd(NULL),
71 Options(NULL),
72 MaxInterface(maxinterface),
73 LodIndexSpin(NULL)
74{
75}
76
77
78/***********************************************************************************************
79 * GenLodExtensionDialogClass::~GenLodExtensionDialogClass -- Destructor *
80 * *
81 * INPUT: *
82 * *
83 * OUTPUT: *
84 * *
85 * WARNINGS: *
86 * *
87 * HISTORY: *
88 * 10/10/2000 gth : Created. *
89 *=============================================================================================*/
91{
92 ReleaseISpinner(LodIndexSpin);
93}
94
95
96/***********************************************************************************************
97 * GenLodExtensionDialogClass::Get_Options -- Presents the dialog, gets user input *
98 * *
99 * INPUT: *
100 * *
101 * OUTPUT: *
102 * *
103 * WARNINGS: *
104 * *
105 * HISTORY: *
106 * 10/10/2000 gth : Created. *
107 *=============================================================================================*/
109{
110 Options = options;
111
112 // Put up the options dialog box.
113 BOOL result = DialogBoxParam
114 (
116 MAKEINTRESOURCE (IDD_GENERATE_LOD_EXTENSION_DIALOG),
117 MaxInterface->GetMAXHWnd(),
118 (DLGPROC) _gen_lod_ext_dialog_proc,
119 (LPARAM) this
120 );
121
122 if (result == TRUE) {
123 return true;
124 } else {
125 return false;
126 }
127}
128
129
130/***********************************************************************************************
131 * GenLodExtensionDialogClass::Dialog_Proc -- Windows message handling *
132 * *
133 * INPUT: *
134 * *
135 * OUTPUT: *
136 * *
137 * WARNINGS: *
138 * *
139 * HISTORY: *
140 * 10/10/2000 gth : Created. *
141 *=============================================================================================*/
142bool GenLodExtensionDialogClass::Dialog_Proc(HWND hWnd,UINT message,WPARAM wParam,LPARAM)
143{
144 switch (message ) {
145
146 case WM_INITDIALOG:
147
148 // Setup the LOD spinner control.
149 LodIndexSpin = SetupIntSpinner
150 (
151 Hwnd,
154 MIN_LOD_INDEX,MAX_LOD_INDEX,INITIAL_LOD_INDEX
155 );
156
157 return 1;
158
159 case WM_COMMAND:
160
161 switch (LOWORD(wParam))
162 {
163 case IDOK:
164 Options->LodIndex = LodIndexSpin->GetIVal();
165 EndDialog(Hwnd, 1);
166 break;
167
168 case IDCANCEL:
169 EndDialog(Hwnd, 0);
170 break;
171 }
172 return 1;
173 }
174 return 0;
175}
176
177
178/***********************************************************************************************
179 * _gen_lod_ext_dialog_proc -- windows dialog proc *
180 * *
181 * INPUT: *
182 * *
183 * OUTPUT: *
184 * *
185 * WARNINGS: *
186 * *
187 * HISTORY: *
188 * 10/10/2000 gth : Created. *
189 *=============================================================================================*/
190static BOOL CALLBACK _gen_lod_ext_dialog_proc(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam)
191{
192 static GenLodExtensionDialogClass * dialog = NULL;
193
194 if (message == WM_INITDIALOG) {
195 dialog = (GenLodExtensionDialogClass *)lparam;
196 dialog->Hwnd = hwnd;
197 }
198
199 if (dialog) {
200 return dialog->Dialog_Proc(hwnd, message, wparam, lparam);
201 } else {
202 return FALSE;
203 }
204}
205
206
207
208
#define NULL
Definition BaseType.h:92
#define TRUE
Definition BaseType.h:109
#define FALSE
Definition BaseType.h:113
unsigned int UINT
Definition bittype.h:63
#define IDD_GENERATE_LOD_EXTENSION_DIALOG
Definition resource.h:91
#define IDC_LOD_INDEX_SPIN
Definition resource.h:298
#define IDC_LOD_INDEX_EDIT
Definition resource.h:297
#define BOOL
Definition Wnd_File.h:57
friend BOOL CALLBACK _gen_lod_ext_dialog_proc(HWND Hwnd, UINT message, WPARAM wParam, LPARAM lParam)
bool Dialog_Proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM)
bool Get_Options(OptionsStruct *options)
GenLodExtensionDialogClass(Interface *maxinterface)
HINSTANCE AppInstance
Definition dllmain.cpp:67