Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
dllmain.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/* $Header: /Commando/Code/Tools/max2w3d/dllmain.cpp 8 7/24/01 5:11p Moumine_ballo $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G *
25 * *
26 * File Name : DLLMAIN.CPP *
27 * *
28 * Programmer : Greg Hjelstrom *
29 * *
30 * Start Date : 06/09/97 *
31 * *
32 * Last Update : June 9, 1997 [GH] *
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * DllMain -- Entry point for the dll *
37 * LibDescription -- Returns description of this library *
38 * LibNumberClasses -- Returns number of classes in this library *
39 * LibClassDesc -- Returns a ClassDesc for the specified class *
40 * LibVersion -- Returns the version number of this library *
41 * GetString -- Gets a string out of the resources *
42 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
43
44
45#include <stdio.h>
46#include <Max.h>
47#include "dllmain.h"
48#include "w3ddesc.h"
49#include "w3dexp.h"
50#include "w3dutil.h"
51#include "skin.h"
52#include "gamemtl.h"
53#include "gamemaps.h"
54#include "MeshDeform.H"
55#include "AlphaModifier.h"
56#include "gridsnapmodifier.h"
57
58#include "resource.h"
59
60#define DLLEXPORT __declspec(dllexport)
61
62
63/*****************************************************************************
64* Globals
65*****************************************************************************/
66
67HINSTANCE AppInstance = NULL;
68static int ControlsInit = FALSE;
69static W3dClassDesc W3d_Export_Class_Descriptor;
70
71
72
73/***********************************************************************************************
74 * DllMain -- Entry point for the dll *
75 * *
76 * INPUT: *
77 * *
78 * OUTPUT: *
79 * *
80 * WARNINGS: *
81 * *
82 * HISTORY: *
83 * 06/09/1997 GH : Created. *
84 *=============================================================================================*/
85BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG /*fdwReason*/,LPVOID /*lpvReserved*/)
86{
87 AppInstance = hinstDLL;
88
89 if ( !ControlsInit )
90 {
91 ControlsInit = TRUE;
92 InitCustomControls(AppInstance);
93 InitCommonControls();
94 }
95
96 return TRUE;
97}
98
99
100/***********************************************************************************************
101 * LibDescription -- Returns description of this library *
102 * *
103 * INPUT: *
104 * *
105 * OUTPUT: *
106 * *
107 * WARNINGS: *
108 * *
109 * HISTORY: *
110 * 06/09/1997 GH : Created. *
111 *=============================================================================================*/
113{
115}
116
117/***********************************************************************************************
118 * LibNumberClasses -- Returns number of classes in this library *
119 * *
120 * INPUT: *
121 * *
122 * OUTPUT: *
123 * *
124 * WARNINGS: *
125 * *
126 * HISTORY: *
127 * 06/09/1997 GH : Created. *
128 *=============================================================================================*/
130{
131 return 9; //Moumine 7/24/2001 4:38:27 PM was 10. Removed Mesh_Deformation(#6)
132}
133
134
135/***********************************************************************************************
136 * LibClassDesc -- Returns a ClassDesc for the specified class *
137 * *
138 * INPUT: *
139 * *
140 * OUTPUT: *
141 * *
142 * WARNINGS: *
143 * *
144 * HISTORY: *
145 * 06/09/1997 GH : Created. *
146 *=============================================================================================*/
147DLLEXPORT ClassDesc * LibClassDesc(int i)
148{
149 switch(i)
150 {
151 case 0: return & W3d_Export_Class_Descriptor; break;
152 case 1: return Get_W3D_Utility_Desc(); break;
153 case 2: return Get_Skin_Obj_Desc(); break;
154 case 3: return Get_Skin_Mod_Desc(); break;
155 case 4: return Get_Game_Material_Desc(); break;
156 case 5: return Get_Game_Maps_Desc(); break;
157 case 6: return Get_PS2_Game_Material_Desc(); break;
158 case 7: return Get_PS2_Material_Conversion(); break;
159 case 8: return Get_Alpha_Desc(); break;
160 //case 6: return Get_Mesh_Deform_Desc(); break;
161 //Moumine 7/24/2001 4:33:52 PM Removed #6 and shifted up instead of returning NULL
162 // NULL causes a crash in "File->Summary info->Plug-in ifo..."
163 default: return NULL; break;
164 }
165}
166
167
168/***********************************************************************************************
169 * LibVersion -- Returns the version number of this library *
170 * *
171 * INPUT: *
172 * *
173 * OUTPUT: *
174 * *
175 * WARNINGS: *
176 * *
177 * HISTORY: *
178 * 06/09/1997 GH : Created. *
179 *=============================================================================================*/
181{
182 return VERSION_3DSMAX;
183}
184
185
186/***********************************************************************************************
187 * Get_String -- Gets a string out of the resources *
188 * *
189 * INPUT: *
190 * *
191 * OUTPUT: *
192 * *
193 * WARNINGS: *
194 * *
195 * HISTORY: *
196 * 06/09/1997 GH : Created. *
197 *=============================================================================================*/
198TCHAR * Get_String( int id )
199{
200 static TCHAR buf[256];
201 if (AppInstance)
202 return LoadString(AppInstance, id, buf, sizeof(buf)) ? buf : NULL;
203 return NULL;
204}
205
206
ClassDesc * Get_Alpha_Desc()
#define NULL
Definition BaseType.h:92
#define TRUE
Definition BaseType.h:109
#define FALSE
Definition BaseType.h:113
ClassDesc * Get_Game_Material_Desc()
Definition GameMtl.cpp:97
unsigned long ULONG
Definition bittype.h:64
LPVOID(__stdcall *SnmpUtilMemAllocPtr)(IN DWORD bytes)
#define IDS_LIB_DESCRIPTION
Definition resource.h:29
#define BOOL
Definition Wnd_File.h:57
DLLEXPORT ClassDesc * LibClassDesc(int i)
Definition dllmain.cpp:147
HINSTANCE AppInstance
Definition dllmain.cpp:67
DLLEXPORT ULONG LibVersion()
Definition dllmain.cpp:180
DLLEXPORT int LibNumberClasses()
Definition dllmain.cpp:129
DLLEXPORT const TCHAR * LibDescription()
Definition dllmain.cpp:112
#define DLLEXPORT
Definition dllmain.cpp:60
BOOL WINAPI DllMain(HINSTANCE hinstDLL, ULONG, LPVOID)
Definition dllmain.cpp:85
TCHAR * Get_String(int id)
Definition dllmain.cpp:198
ClassDesc * Get_Game_Maps_Desc()
Definition gamemaps.cpp:101
ClassDesc * Get_PS2_Material_Conversion()
ClassDesc * Get_PS2_Game_Material_Desc()
ClassDesc * Get_Skin_Mod_Desc()
Definition skin.cpp:114
ClassDesc * Get_Skin_Obj_Desc()
Definition skin.cpp:93
ClassDesc * Get_W3D_Utility_Desc(void)
Definition w3dutil.cpp:323