Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
presetexportoptionsdialog.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/presetexportoptionsdialog.cpp $*
26 * *
27 * Original Author:: Patrick Smith *
28 * *
29 * $Author:: Greg_h $*
30 * *
31 * $Modtime:: 11/10/00 2:26p $*
32 * *
33 * $Revision:: 5 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39
41#include "dllmain.h"
42#include "resource.h"
43#include "w3dexp.h"
45
46
48// Constants
50
51static const char *BROWSE_FILTER = "W3D Files (*.W3D)\0*.W3D\0WHT Files (*.WHT)\0*.WHT\0\0";
52
53
55//
56// PresetExportOptionsDialogClass
57//
59PresetExportOptionsDialogClass::PresetExportOptionsDialogClass (Interface *maxinterface, HWND parent_wnd) :
60 MaxInterface (maxinterface),
61 Options (NULL),
62 Wnd (NULL),
63 ParentWnd (parent_wnd),
64 CurrentPane (-1)
65{
66 ::memset (PaneWnds, 0, sizeof (PaneWnds));
67 return ;
68}
69
70
72//
73// ~PresetExportOptionsDialogClass
74//
80
81
83//
84// Do_Modal
85//
87int
89{
90 int retval = ::DialogBoxParam (AppInstance, MAKEINTRESOURCE (IDD_W3D_PRESET_EXPORT_OPTIONS),
91 ParentWnd, Real_Message_Proc, (LPARAM)this);
92 return retval;
93}
94
95
97//
98// Real_Message_Proc
99//
101BOOL CALLBACK
102PresetExportOptionsDialogClass::Real_Message_Proc
103(
104 HWND wnd,
105 UINT message,
106 WPARAM wparam,
107 LPARAM lparam
108)
109{
111
112 //
113 // Setup the framework we need so that the instance
114 // can process the messages instead of this static callback.
115 //
116 if (message == WM_INITDIALOG) {
117 dialog_obj = (PresetExportOptionsDialogClass *)lparam;
118 dialog_obj->Wnd = wnd;
119 ::SetProp (wnd, "DIALOG_OBJ", (HANDLE)dialog_obj);
120 } else {
121 dialog_obj = (PresetExportOptionsDialogClass *)::GetProp (wnd, "DIALOG_OBJ");
122 }
123
124 //
125 // Allow the instance to handle the call
126 //
127 BOOL retval = FALSE;
128 if (dialog_obj != NULL) {
129 retval = dialog_obj->Message_Proc (message, wparam, lparam);
130 }
131
132 //
133 // Cleanup the framework
134 //
135 if (message == WM_DESTROY) {
136 ::RemoveProp (wnd, "DIALOG_OBJ");
137 }
138
139 return retval;
140}
141
142
144//
145// Settings_Pane_Message_Proc
146//
148BOOL CALLBACK
149PresetExportOptionsDialogClass::Settings_Pane_Message_Proc
150(
151 HWND wnd,
152 UINT message,
153 WPARAM wparam,
154 LPARAM lparam
155)
156{
158
159 //
160 // Setup the framework we need so that the instance
161 // can process the messages instead of this static callback.
162 //
163 if (message == WM_INITDIALOG) {
164 dialog_obj = (PresetExportOptionsDialogClass *)lparam;
165 ::SetProp (wnd, "DIALOG_OBJ", (HANDLE)dialog_obj);
166 } else {
167 dialog_obj = (PresetExportOptionsDialogClass *)::GetProp (wnd, "DIALOG_OBJ");
168 }
169
170 //
171 // Allow the instance to handle the call
172 //
173 BOOL retval = FALSE;
174 if (dialog_obj != NULL) {
175 retval = dialog_obj->Pane_Message_Proc (message, wparam, lparam);
176 }
177
178 //
179 // Cleanup the framework
180 //
181 if (message == WM_DESTROY) {
182 ::RemoveProp (wnd, "DIALOG_OBJ");
183 }
184
185 return retval;
186}
187
188
190//
191// Pane_Message_Proc
192//
194BOOL
195PresetExportOptionsDialogClass::Pane_Message_Proc
196(
197 UINT message,
198 WPARAM wparam,
199 LPARAM lparam
200)
201{
202 BOOL retval = FALSE;
203
204 switch (message)
205 {
206 case WM_CUSTEDIT_ENTER:
207
208 switch (wparam)
209 {
211 {
212 //
213 // Update the start frame
214 //
215 ICustEdit *edit_ctrl = GetICustEdit ((HWND)lparam);
216 if (edit_ctrl != NULL) {
217 Options->StartFrame = edit_ctrl->GetInt ();
218
219 //
220 // Bounds check the value
221 //
222 if (Options->StartFrame > Options->EndFrame) {
223 Options->StartFrame = Options->EndFrame;
224 }
225
226 Update_Controls ();
227 }
228 }
229 break;
230
232 {
233 //
234 // Update the end frame
235 //
236 ICustEdit *edit_ctrl = GetICustEdit ((HWND)lparam);
237 if (edit_ctrl != NULL) {
238 Options->EndFrame = edit_ctrl->GetInt ();
239
240 //
241 // Bounds check the value
242 //
243 if (Options->EndFrame < Options->StartFrame) {
244 Options->EndFrame = Options->StartFrame;
245 }
246
247 Update_Controls ();
248 }
249 }
250 break;
251 }
252
253 break;
254
255 case CC_SPINNER_BUTTONUP:
256 {
257 ISpinnerControl *spin_ctrl = (ISpinnerControl *)lparam;
258 if (spin_ctrl != NULL) {
259
260 switch (LOWORD (wparam))
261 {
262 //
263 // Update the start frame
264 //
266 Options->StartFrame = spin_ctrl->GetIVal ();
267
268 //
269 // Bounds check the value
270 //
271 if (Options->StartFrame > Options->EndFrame) {
272 Options->StartFrame = Options->EndFrame;
273 }
274 Update_Controls ();
275 break;
276
277 //
278 // Update the end frame
279 //
281 Options->EndFrame = spin_ctrl->GetIVal ();
282
283 //
284 // Bounds check the value
285 //
286 if (Options->EndFrame < Options->StartFrame) {
287 Options->EndFrame = Options->StartFrame;
288 }
289
290 Update_Controls ();
291 break;
292 }
293 }
294 }
295 break;
296
297 case WM_COMMAND:
298 {
299 HWND control_wnd = reinterpret_cast <HWND> (lparam);
300 bool update_controls = true;
301
302 switch (LOWORD (wparam))
303 {
305 Options->SmoothBetweenMeshes = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) == 1);
306 break;
307
309 Options->DisableExportAABTrees = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) != 1);
310 break;
311
312#if 0
314 Options->EnableOptimizeMeshData = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) == 1);
315 break;
316#endif
317
319 Options->LoadHierarchy = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) == 1);
320 break;
321
323 Options->CompressAnimation = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) == 1);
324 break;
325
327 {
328 OPENFILENAME ofn = { sizeof (OPENFILENAME), 0 };
329 ofn.lpstrFilter = BROWSE_FILTER;
330 ofn.nMaxFile = _MAX_PATH;
331 ofn.nMaxFileTitle = _MAX_FNAME + _MAX_EXT;
332 ofn.Flags = OFN_HIDEREADONLY | OFN_CREATEPROMPT;
333 ofn.lpstrDefExt = "wht";
334 ofn.hwndOwner = Wnd;
335 ofn.lpstrFile = Options->HierarchyFilename;
336
337 if (::GetOpenFileName (&ofn)) {
338
339 //
340 // Get the relative path between the current export path
341 // and the full file path to the hierarchy file:
342 //
343 Create_Relative_Path (Options->RelativeHierarchyFilename,
345 ofn.lpstrFile);
346 }
347 }
348 break;
349
351 {
352 //
353 // Display the compression options dialog
354 //
355 AnimationCompressionSettingsDialogClass dialog (MaxInterface, Wnd);
356 dialog.Set_Options (Options);
357 dialog.Do_Modal ();
358 }
359 break;
360
362 Options->EnableMaterialColorToTextureConversion = (SendMessage (control_wnd, BM_GETCHECK, 0, 0L) == 1);
363 break;
364
365 default:
366 update_controls = false;
367 break;
368 }
369
370 if (update_controls) {
371 Update_Controls ();
372 }
373 }
374 break;
375 }
376
377 return retval;
378}
379
380
382//
383// Message_Proc
384//
386BOOL
387PresetExportOptionsDialogClass::Message_Proc
388(
389 UINT message,
390 WPARAM wparam,
391 LPARAM lparam
392)
393{
394 BOOL retval = FALSE;
395
396 switch (message)
397 {
398 case WM_INITDIALOG:
399 {
400 //
401 // Center the dialog
402 //
403 RECT parent_rect = { 0 };
404 RECT rect = { 0 };
405 ::GetWindowRect (ParentWnd, &parent_rect);
406 ::GetWindowRect (Wnd, &rect);
407 int width = parent_rect.right - parent_rect.left;
408 int height = parent_rect.bottom - parent_rect.top;
409 ::SetWindowPos ( Wnd, NULL,
410 parent_rect.left + (width / 2) - ((rect.right - rect.left) / 2),
411 parent_rect.top + (height / 2) - ((rect.bottom - rect.top) / 2),
412 0, 0, SWP_NOZORDER | SWP_NOSIZE);
413
414 //
415 // Initialize the controls
416 //
417 Create_Settings_Panes ();
418 Initialize_Controls ();
419 Update_Controls ();
420 Determine_Preset_Type ();
421 retval = TRUE;
422 }
423 break;
424
425 case WM_COMMAND:
426 retval = On_Command (wparam, lparam);
427 break;
428 }
429
430 return retval;
431}
432
433
435//
436// On_Command
437//
439BOOL
440PresetExportOptionsDialogClass::On_Command (WPARAM wparam, LPARAM lparam)
441{
442 BOOL retval = FALSE;
443
444 switch (LOWORD (wparam))
445 {
446 case IDC_HLOD_RADIO:
447 Show_Settings_Pane (PANE_HLOD);
448 break;
449
451 Show_Settings_Pane (PANE_ANIM_HLOD);
452 break;
453
454 case IDC_ANIM_RADIO:
455 Show_Settings_Pane (PANE_ANIM);
456 break;
457
459 Show_Settings_Pane (PANE_TERRAIN);
460 break;
461
463 Show_Settings_Pane (PANE_SKELETON);
464 break;
465
466 case IDC_MESH_RADIO:
467 Show_Settings_Pane (PANE_MESH);
468 break;
469
470 case IDCANCEL:
471 ::memcpy (Options, &OrigOptions, sizeof (OrigOptions));
472 EndDialog (Wnd, IDCANCEL);
473 break;
474
475 case IDOK:
476 Save_Settings ();
477 EndDialog (Wnd, IDOK);
478 break;
479 }
480
481 return retval;
482}
483
484
486//
487// Show_Settings_Pane
488//
490void
491PresetExportOptionsDialogClass::Show_Settings_Pane (int pane_id)
492{
493 if (pane_id != CurrentPane) {
494
495 //
496 // Show the new pane and hide the old pane
497 //
498 ::ShowWindow (PaneWnds[pane_id], SW_SHOW);
499 if (CurrentPane >= 0) {
500 ::ShowWindow (PaneWnds[CurrentPane], SW_HIDE);
501 }
502 CurrentPane = pane_id;
503 }
504
505 return ;
506}
507
508
510//
511// Create_Settings_Panes
512//
514void
515PresetExportOptionsDialogClass::Create_Settings_Panes (void)
516{
517 PaneWnds[PANE_HLOD] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_HLOD),
518 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
519
520 PaneWnds[PANE_ANIM_HLOD] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_ANIMATED_HLOD),
521 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
522
523 PaneWnds[PANE_ANIM] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_ANIMATION),
524 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
525
526 PaneWnds[PANE_TERRAIN] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_TERRAIN),
527 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
528
529 PaneWnds[PANE_SKELETON] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_SKELETON),
530 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
531
532 PaneWnds[PANE_MESH] = ::CreateDialogParam (AppInstance, MAKEINTRESOURCE (IDD_EXPORT_PANE_MESH),
533 Wnd, Settings_Pane_Message_Proc, (LPARAM)this);
534
535
536 //
537 // Get the position and size of the group box the settings panes will be
538 // displayed inside
539 //
540 RECT group_rect = { 0 };
541 ::GetWindowRect (::GetDlgItem (Wnd, IDC_GROUP_BOX), &group_rect);
542 ::ScreenToClient (Wnd, (LPPOINT)&group_rect);
543 ::ScreenToClient (Wnd, ((LPPOINT)&group_rect) + 1);
544 int width = group_rect.right - group_rect.left;
545 int height = group_rect.bottom - group_rect.top;
546
547 //
548 // Loop over all the panes and make sure they are in the proper location
549 //
550 for (int index = 0; index < PANE_MAX; index ++) {
551 HWND pane_wnd = PaneWnds[index];
552
553 //
554 // Get the size of this pane
555 //
556 RECT rect = { 0 };
557 ::GetWindowRect (pane_wnd, &rect);
558
559 //
560 // Center the pane inside of the group box
561 //
562 ::SetWindowPos ( pane_wnd, ::GetDlgItem (Wnd, IDC_GROUP_BOX),
563 group_rect.left + (width / 2) - ((rect.right - rect.left) / 2),
564 group_rect.top + (height / 2) - ((rect.bottom - rect.top) / 2),
565 0, 0, SWP_NOSIZE);
566 }
567
568 return ;
569}
570
571
573//
574// Destroy_Settings_Panes
575//
577void
578PresetExportOptionsDialogClass::Destroy_Settings_Panes (void)
579{
580 //
581 // Loop over all the panes and destroy them
582 //
583 for (int index = 0; index < PANE_MAX; index ++) {
584 ::DestroyWindow (PaneWnds[index]);
585 PaneWnds[index] = NULL;
586 }
587
588 return ;
589}
590
591
593//
594// Determine_Preset_Type
595//
597void
598PresetExportOptionsDialogClass::Determine_Preset_Type (void)
599{
600 //
601 // Examine the current options and try to determine which
602 // preset best matches this configuration.
603 //
604
605 if (Options->EnableTerrainMode) {
606
607 //
608 // Select the terrain UI
609 //
610 Show_Settings_Pane (PANE_TERRAIN);
611 SendDlgItemMessage (Wnd, IDC_TERRAIN_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
612
613 } else if (Options->ExportGeometry == false) {
614
615 if (Options->ExportAnimation == false) {
616
617 //
618 // Select the skeleton UI
619 //
620 Show_Settings_Pane (PANE_SKELETON);
621 SendDlgItemMessage (Wnd, IDC_SKELETON_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
622 } else {
623
624 //
625 // Select the anim UI
626 //
627 Show_Settings_Pane (PANE_ANIM);
628 SendDlgItemMessage (Wnd, IDC_ANIM_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
629 }
630
631 } else if (Options->ExportHierarchy == false && Options->LoadHierarchy == false) {
632
633 //
634 // Select the mesh UI
635 //
636 Show_Settings_Pane (PANE_MESH);
637 SendDlgItemMessage (Wnd, IDC_MESH_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
638
639 } else if (Options->ExportAnimation == false) {
640
641 //
642 // Select the HLOD UI
643 //
644 Show_Settings_Pane (PANE_HLOD);
645 SendDlgItemMessage (Wnd, IDC_HLOD_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
646
647 } else {
648
649 //
650 // Select the HLOD anim UI
651 //
652 Show_Settings_Pane (PANE_ANIM_HLOD);
653 SendDlgItemMessage (Wnd, IDC_ANIM_HLOD_RADIO, BM_SETCHECK, (WPARAM)TRUE, 0L);
654 }
655
656 return ;
657}
658
659
661//
662// Initialize_Controls
663//
665void
666PresetExportOptionsDialogClass::Initialize_Controls (void)
667{
668 //
669 // Check the review log file button if necessary
670 //
671 CheckDlgButton (Wnd, IDC_REVIEW_LOG, Options->ReviewLog);
672
673 //
674 // Precompute some of the animation data
675 //
676 int ticksperframe = ::GetTicksPerFrame();
677 int startframe = MaxInterface->GetAnimRange ().Start () / ticksperframe;
678 int endframe = MaxInterface->GetAnimRange ().End () / ticksperframe;
679
680 //
681 // Clamp the real options the same way the displayed values are clamped
682 //
683 if (startframe > Options->StartFrame) {
684 Options->StartFrame = startframe;
685 }
686 if (endframe < Options->EndFrame) {
687 Options->EndFrame = endframe;
688 }
689
690 //
691 // Loop over all the panes and update any of the controls therein
692 //
693 for (int index = 0; index < PANE_MAX; index ++) {
694 HWND pane_wnd = PaneWnds[index];
695
696 //
697 // Are there any animation controls on this pane to initialize?
698 //
699 if (::GetDlgItem (pane_wnd, IDC_RANGE_LOW_SPIN) != NULL) {
700
701 ISpinnerControl *low_spin = NULL;
702 ISpinnerControl *high_spin = NULL;
703
704 low_spin = ::SetupIntSpinner (pane_wnd, IDC_RANGE_LOW_SPIN, IDC_RANGE_LOW_EDIT,
705 startframe, endframe, 0);
706
707 high_spin = ::SetupIntSpinner (pane_wnd, IDC_RANGE_HIGH_SPIN, IDC_RANGE_HIGH_EDIT,
708 startframe, endframe, 0);
709
710 ::SetProp (::GetDlgItem (pane_wnd, IDC_RANGE_LOW_SPIN), "ISpinnerControl", (HANDLE)low_spin);
711 ::SetProp (::GetDlgItem (pane_wnd, IDC_RANGE_HIGH_SPIN), "ISpinnerControl", (HANDLE)high_spin);
712 }
713 }
714
715 return ;
716}
717
718
720//
721// Update_Controls
722//
724void
725PresetExportOptionsDialogClass::Update_Controls (void)
726{
727 //
728 // Loop over all the panes and update any of the controls therein
729 //
730 for (int index = 0; index < PANE_MAX; index ++) {
731 HWND pane_wnd = PaneWnds[index];
732
733 //
734 // Handle the check boxes
735 //
736 CheckDlgButton (pane_wnd, IDC_EXPORT_MESH_SMOOTH_CHECK, Options->SmoothBetweenMeshes);
737 CheckDlgButton (pane_wnd, IDC_EXPORT_MESH_AABTREES, !Options->DisableExportAABTrees);
738#if ENABLE_MESH_OPTIMIZING
739 CheckDlgButton (pane_wnd, IDC_EXPORT_MESH_OPTIMIZE, Options->EnableOptimizeMeshData);
740#endif
741 CheckDlgButton (pane_wnd, IDC_USE_SKELETON_CHECK, Options->LoadHierarchy);
742 CheckDlgButton (pane_wnd, IDC_COMPRESS_ANIMATION_CHECK, Options->CompressAnimation);
743 CheckDlgButton (pane_wnd, IDC_EXPORT_MESH_MAT_TO_TEXTURE, Options->EnableMaterialColorToTextureConversion);
744
745 //
746 // Enable/disable the compression settings button
747 //
748 HWND compress_settings_btn = ::GetDlgItem (pane_wnd, IDC_COMPRESSION_SETTINGS);
749 if (compress_settings_btn != NULL) {
750 ::EnableWindow (compress_settings_btn, Options->CompressAnimation);
751 }
752
753 //
754 // Setup the skeleton browse button
755 //
756 HWND skeleten_browse_btn = ::GetDlgItem (pane_wnd, IDC_WHT_BROWSE_BUTTON);
757 if (skeleten_browse_btn != NULL) {
758
759 //
760 // Honor the relative path if it is present
761 //
762 if (Options->RelativeHierarchyFilename[0] != 0) {
763 SetWindowText (skeleten_browse_btn, Options->RelativeHierarchyFilename);
764 ::Create_Full_Path (Options->HierarchyFilename,
766 Options->RelativeHierarchyFilename);
767
768 } else if (Options->HierarchyFilename[0] != 0) {
769 SetWindowText (skeleten_browse_btn, Options->HierarchyFilename);
770 ::Create_Relative_Path (Options->RelativeHierarchyFilename,
772 Options->HierarchyFilename);
773 }
774
775 //
776 // Set the enable state of the window
777 //
778 ::EnableWindow (skeleten_browse_btn, Options->LoadHierarchy);
779 }
780
781 //
782 // Are there any animation controls on this pane to update?
783 //
784 HWND low_spin_wnd = ::GetDlgItem (pane_wnd, IDC_RANGE_LOW_SPIN);
785 HWND high_spin_wnd = ::GetDlgItem (pane_wnd, IDC_RANGE_HIGH_SPIN);
786 if (low_spin_wnd != NULL && high_spin_wnd != NULL) {
787
788 //
789 // Peek at the spinner control objects
790 //
791 ISpinnerControl *low_spin = NULL;
792 ISpinnerControl *high_spin = NULL;
793 low_spin = (ISpinnerControl *)::GetProp (low_spin_wnd, "ISpinnerControl");
794 high_spin = (ISpinnerControl *)::GetProp (high_spin_wnd, "ISpinnerControl");
795
796 //
797 // Update the spin controls
798 //
799 low_spin->SetValue (Options->StartFrame, FALSE);
800 high_spin->SetValue (Options->EndFrame, FALSE);
801 }
802 }
803
804 return ;
805}
806
807
809//
810// Save_Settings
811//
813void
814PresetExportOptionsDialogClass::Save_Settings (void)
815{
816 //
817 // Force settings that certain preset types need
818 //
819 if (::IsDlgButtonChecked (Wnd, IDC_TERRAIN_RADIO)) {
820
821 //
822 // Force some settings for the "Renegade Terrain" preset
823 //
824 Options->ExportHierarchy = true;
825 Options->LoadHierarchy = false;
826 Options->ExportAnimation = false;
827 Options->ExportGeometry = true;
828 Options->CompressAnimation = false;
829 Options->ReduceAnimation = false;
830 Options->EnableTerrainMode = true;
831 Options->DisableExportAABTrees = false;
832 Options->EnableMaterialColorToTextureConversion = false;
833 } else if (::IsDlgButtonChecked (Wnd, IDC_SKELETON_RADIO)) {
834
835 //
836 // Force some settings for the "Skeleton" preset
837 //
838 Options->ExportHierarchy = true;
839 Options->LoadHierarchy = false;
840 Options->ExportAnimation = false;
841 Options->ExportGeometry = false;
842 Options->CompressAnimation = false;
843 Options->ReduceAnimation = false;
844 Options->EnableTerrainMode = false;
845 Options->EnableOptimizeMeshData = false;
846 Options->DisableExportAABTrees = true;
847 Options->SmoothBetweenMeshes = false;
848 Options->EnableTerrainMode = false;
849 Options->EnableMaterialColorToTextureConversion = false;
850 } else if (::IsDlgButtonChecked (Wnd, IDC_MESH_RADIO)) {
851
852 //
853 // Force some settings for the "Simple Mesh" preset
854 //
855 Options->ExportHierarchy = false;
856 Options->LoadHierarchy = false;
857 Options->ExportAnimation = false;
858 Options->ExportGeometry = true;
859 Options->CompressAnimation = false;
860 Options->ReduceAnimation = false;
861 Options->EnableTerrainMode = false;
862 Options->EnableOptimizeMeshData = false;
863 Options->SmoothBetweenMeshes = false;
864 Options->EnableTerrainMode = false;
865 } else if (::IsDlgButtonChecked (Wnd, IDC_HLOD_RADIO)) {
866
867 //
868 // Force some settings for the "Hierarchical Model" preset
869 //
870 Options->ExportHierarchy = !Options->LoadHierarchy;
871 Options->ExportAnimation = false;
872 Options->ExportGeometry = true;
873 Options->CompressAnimation = false;
874 Options->ReduceAnimation = false;
875 Options->EnableTerrainMode = false;
876 } else if (::IsDlgButtonChecked (Wnd, IDC_ANIM_HLOD_RADIO)) {
877
878 //
879 // Force some settings for the "Hierarchical Animated Model" preset
880 //
881 Options->ExportHierarchy = !Options->LoadHierarchy;
882 Options->ExportAnimation = true;
883 Options->ExportGeometry = true;
884 Options->EnableTerrainMode = false;
885 } else if (::IsDlgButtonChecked (Wnd, IDC_ANIM_RADIO)) {
886
887 //
888 // Force some settings for the "Pure Animation" preset
889 //
890 Options->ExportHierarchy = !Options->LoadHierarchy;
891 Options->ExportAnimation = true;
892 Options->ExportGeometry = false;
893 Options->EnableTerrainMode = false;
894 Options->EnableOptimizeMeshData = false;
895 Options->DisableExportAABTrees = true;
896 Options->SmoothBetweenMeshes = false;
897 Options->EnableMaterialColorToTextureConversion = false;
898 }
899
900 //
901 // Record the "Review Log File" option
902 //
903 Options->ReviewLog = (::IsDlgButtonChecked (Wnd, IDC_REVIEW_LOG) == 1);
904
905 //
906 // Check to see if anything has changed
907 //
908 if (::memcmp (Options, &OrigOptions, sizeof (OrigOptions)) != 0) {
909 SetSaveRequiredFlag (true);
910 }
911
912 return ;
913}
914
#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_EXPORT_PANE_SKELETON
Definition resource.h:108
#define IDD_EXPORT_PANE_ANIMATED_HLOD
Definition resource.h:105
#define IDD_EXPORT_PANE_ANIMATION
Definition resource.h:106
#define IDC_RANGE_HIGH_EDIT
Definition resource.h:151
#define IDC_MESH_RADIO
Definition resource.h:376
#define IDC_COMPRESS_ANIMATION_CHECK
Definition resource.h:353
#define IDC_ANIM_RADIO
Definition resource.h:374
#define IDC_REVIEW_LOG
Definition resource.h:385
#define IDC_RANGE_HIGH_SPIN
Definition resource.h:203
#define IDC_HLOD_RADIO
Definition resource.h:371
#define IDD_EXPORT_PANE_MESH
Definition resource.h:107
#define IDC_EXPORT_MESH_SMOOTH_CHECK
Definition resource.h:317
#define IDC_EXPORT_MESH_AABTREES
Definition resource.h:319
#define IDC_GROUP_BOX
Definition resource.h:379
#define IDC_RANGE_LOW_EDIT
Definition resource.h:149
#define IDD_W3D_PRESET_EXPORT_OPTIONS
Definition resource.h:103
#define IDC_COMPRESSION_SETTINGS
Definition resource.h:373
#define IDC_USE_SKELETON_CHECK
Definition resource.h:382
#define IDD_EXPORT_PANE_TERRAIN
Definition resource.h:109
#define IDC_EXPORT_MESH_MAT_TO_TEXTURE
Definition resource.h:321
#define IDC_TERRAIN_RADIO
Definition resource.h:381
#define IDC_ANIM_HLOD_RADIO
Definition resource.h:384
#define IDD_EXPORT_PANE_HLOD
Definition resource.h:104
#define IDC_RANGE_LOW_SPIN
Definition resource.h:200
#define IDC_WHT_BROWSE_BUTTON
Definition resource.h:136
#define IDC_EXPORT_MESH_OPTIMIZE
Definition resource.h:323
#define IDC_SKELETON_RADIO
Definition resource.h:378
#define BOOL
Definition Wnd_File.h:57
PresetExportOptionsDialogClass(Interface *maxinterface, HWND parent_wnd=NULL)
static char CurrentExportPath[_MAX_DRIVE+_MAX_DIR+1]
Definition w3dexp.h:81
HINSTANCE AppInstance
Definition dllmain.cpp:67
else return(RetVal)
void Create_Relative_Path(char *rel_path, const char *curr, const char *full_path)
Definition util.cpp:285
void Create_Full_Path(char *full_path, const char *curr, const char *rel_path)
Definition util.cpp:251