Basic Shapes 1.9 Assimp Loader 120120
@@ -32,6 +32,8 @@ | ||
32 | 32 | Cl_ImGui = nullptr; |
33 | 33 | Cl_Grid = nullptr; |
34 | 34 | Cl_Assimp = nullptr; |
35 | + Cl_Importer = nullptr; | |
36 | + Cl_FileIO = nullptr; | |
35 | 37 | |
36 | 38 | Fdlg = nullptr; |
37 | 39 | hInst = nullptr; |
@@ -106,6 +108,8 @@ | ||
106 | 108 | Cl_ImGui = new GD_ImGui(); |
107 | 109 | Cl_Grid = new GD19_Grid(); |
108 | 110 | Cl_Assimp = new GD_Assimp(); |
111 | + Cl_Importer = new GD_Importer(); | |
112 | + Cl_FileIO = new GD_FileIO(); | |
109 | 113 | |
110 | 114 | SetBrushes_Fonts(); |
111 | 115 |
@@ -28,6 +28,8 @@ | ||
28 | 28 | #include "GD_ImGui.h" |
29 | 29 | #include "GD19_Grid.h" |
30 | 30 | #include "GD_Assimp.h" |
31 | +#include "GD_Importer.h" | |
32 | +#include "GD_FileIO.h" | |
31 | 33 | |
32 | 34 | |
33 | 35 | class GD19_App |
@@ -40,6 +42,8 @@ | ||
40 | 42 | GD_ImGui* Cl_ImGui; |
41 | 43 | GD19_Grid* Cl_Grid; |
42 | 44 | GD_Assimp* Cl_Assimp; |
45 | + GD_Importer* Cl_Importer; | |
46 | + GD_FileIO* Cl_FileIO; | |
43 | 47 | |
44 | 48 | GD19_App(void); |
45 | 49 | ~GD19_App(void); |
@@ -65,6 +65,7 @@ | ||
65 | 65 | { |
66 | 66 | char buf[1024]; |
67 | 67 | strcpy(buf,aiGetErrorString()); |
68 | + App->Say(buf); | |
68 | 69 | /// App->Cl_Ogre->Loading_Text(buf,1); |
69 | 70 | return false; |
70 | 71 | } |
@@ -86,11 +87,11 @@ | ||
86 | 87 | |
87 | 88 | /// if (App->Cl_Importer->Is_RFEditPro == 1) |
88 | 89 | { |
89 | - LoadTextures_RFEditPro(); | |
90 | + ///LoadTextures_RFEditPro(); | |
90 | 91 | } |
91 | 92 | /// else |
92 | 93 | { |
93 | - LoadTextures(); | |
94 | + ///LoadTextures(); | |
94 | 95 | } |
95 | 96 | |
96 | 97 | /// App->Cl_Ogre->Loading_Text("Loading Creating BBox",1); |
@@ -0,0 +1,650 @@ | ||
1 | +/* | |
2 | + Copyright (c) Equity10 2016 HGT Software W.T.Flanigan B.Parkin H.C.Flanigan | |
3 | + | |
4 | + This software is provided 'as-is', without any express or implied | |
5 | + warranty. In no event will the authors be held liable for any damages | |
6 | + arising from the use of this software. | |
7 | + | |
8 | + Permission is granted to anyone to use this software for any purpose, | |
9 | + including commercial applications, and to alter it and redistribute it | |
10 | + freely, subject to the following restrictions: | |
11 | + | |
12 | + 1. The origin of this software must not be misrepresented; you must not | |
13 | + claim that you wrote the original software. If you use this software | |
14 | + in a product, an acknowledgment in the product documentation would be | |
15 | + appreciated but is not required. | |
16 | + | |
17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
18 | + misrepresented as being the original software. | |
19 | + | |
20 | + 3. This notice may not be removed or altered from any source | |
21 | + distribution. | |
22 | +*/ | |
23 | + | |
24 | +#include "StdAfx.h" | |
25 | +#include "resource.h" | |
26 | +#include "GD19_App.h" | |
27 | +#include <tchar.h> | |
28 | +#include <shellapi.h> | |
29 | +#include "Shlobj.h" | |
30 | +#include "io.h" | |
31 | +#include "GD_FileIO.h" | |
32 | + | |
33 | + | |
34 | +GD_FileIO::GD_FileIO(void) | |
35 | +{ | |
36 | + strcpy(Model_FileName,""); | |
37 | + strcpy(Model_Path_FileName,""); | |
38 | + | |
39 | + OutputFolder[0]=0; | |
40 | + MotionFolder[0]=0; | |
41 | + TextureFolder[0]=0; | |
42 | +} | |
43 | + | |
44 | + | |
45 | +GD_FileIO::~GD_FileIO(void) | |
46 | +{ | |
47 | +} | |
48 | + | |
49 | +// ************************************************************************* | |
50 | +// * OpenTextureFile Terry Bernie * | |
51 | +// ************************************************************************* | |
52 | +bool GD_FileIO::OpenTextureFile(char* Title,char* StartDirectory,bool SaveLocation) | |
53 | +{ | |
54 | + strcpy(Texture_FileName,""); | |
55 | + strcpy(Texture_Path_FileName,""); | |
56 | + | |
57 | + ZeroMemory(&ofn, sizeof(ofn)); | |
58 | + ofn.lStructSize = sizeof(ofn); | |
59 | + ofn.hwndOwner = App->Fdlg; | |
60 | + ofn.hInstance = App->hInst; | |
61 | + ofn.lpstrFile = Texture_Path_FileName; // full path and file name | |
62 | + ofn.nMaxFile = sizeof(Texture_Path_FileName); | |
63 | + ofn.lpstrFilter = "Available Formats\0*.bmp;*.tga;*.jpg;*.png;*.dds;*.pcx;*.tif;*.tiff;\0Windows Bitmap (*.bmp)\0*.bmp\0Truevision Targa (*.tga) \0*.tga\0JPEG (*.jpg) \0*.jpg\0Portable Network Graphics (*.png) \0*.png\0Direct Draw (*.dds) \0*.dds\0ZSoft PCX (*.pcx) \0*.pcx\0Tagged Image File Format (*.tif) \0*.tif\0Tagged Image File Format (*.tiff) \0*.tiff\0"; | |
64 | + | |
65 | + ofn.nFilterIndex = 1; | |
66 | + ofn.lpstrFileTitle = Texture_FileName; // Just File Name | |
67 | + ofn.nMaxFileTitle = sizeof(Texture_FileName); | |
68 | + ofn.lpstrInitialDir = StartDirectory; | |
69 | + ofn.lpstrTitle = Title; | |
70 | + ofn.Flags = OFN_PATHMUSTEXIST | | |
71 | + OFN_FILEMUSTEXIST | | |
72 | + OFN_EXPLORER | | |
73 | + OFN_HIDEREADONLY | | |
74 | + OFN_FILEMUSTEXIST; | |
75 | + if (GetOpenFileName(&ofn) == TRUE) | |
76 | + { | |
77 | + if (SaveLocation == 1) | |
78 | + { | |
79 | + //_getcwd(S_Folders[0]->TempLoadLocation,1024); | |
80 | + } | |
81 | + | |
82 | + return 1; | |
83 | + } | |
84 | + | |
85 | +return 0; | |
86 | +} | |
87 | +// ************************************************************************* | |
88 | +// * OpenFile Terry Bernie * | |
89 | +// ************************************************************************* | |
90 | +bool GD_FileIO::OpenFile(char* Extension,char* Title,char* StartDirectory) | |
91 | +{ | |
92 | + strcpy(Model_FileName,""); | |
93 | + strcpy(Model_Path_FileName,""); | |
94 | + | |
95 | + ZeroMemory(&ofn, sizeof(ofn)); | |
96 | + ofn.lStructSize = sizeof(ofn); | |
97 | + ofn.hwndOwner = App->MainHwnd; | |
98 | + ofn.hInstance = App->hInst; | |
99 | + ofn.lpstrFile = Model_Path_FileName; // full path and file name | |
100 | + ofn.nMaxFile = sizeof(Model_Path_FileName); | |
101 | + ofn.lpstrFilter = Extension; | |
102 | + | |
103 | + ofn.nFilterIndex = 1; | |
104 | + ofn.lpstrFileTitle = Model_FileName; // Just File Name | |
105 | + ofn.nMaxFileTitle = sizeof(Model_FileName);; | |
106 | + ofn.lpstrInitialDir = StartDirectory; | |
107 | + ofn.lpstrTitle = Title; | |
108 | + ofn.Flags = OFN_PATHMUSTEXIST | | |
109 | + OFN_FILEMUSTEXIST | | |
110 | + OFN_EXPLORER | | |
111 | + OFN_HIDEREADONLY | | |
112 | + OFN_FILEMUSTEXIST; | |
113 | + | |
114 | + if (GetOpenFileName(&ofn) == TRUE) | |
115 | + { | |
116 | + return 1; | |
117 | + } | |
118 | + return 0; | |
119 | +} | |
120 | + | |
121 | +// ************************************************************************* | |
122 | +// * Open_ResourceFile Terry Bernie * | |
123 | +// ************************************************************************* | |
124 | +bool GD_FileIO::Open_ResourceFile(char* Extension,char* Title,char* StartDirectory) | |
125 | +{ | |
126 | + strcpy(Model_FileName,""); | |
127 | + strcpy(Model_Path_FileName,""); | |
128 | + strcpy(Model_Path_FileName,StartDirectory); | |
129 | + | |
130 | + ZeroMemory(&ofn, sizeof(ofn)); | |
131 | + ofn.lStructSize = sizeof(ofn); | |
132 | + ofn.hwndOwner = App->MainHwnd; | |
133 | + ofn.hInstance = App->hInst; | |
134 | + ofn.lpstrFile = Model_Path_FileName; // full path and file name | |
135 | + ofn.nMaxFile = sizeof(Model_Path_FileName); | |
136 | + ofn.lpstrFilter = Extension; | |
137 | + | |
138 | + ofn.nFilterIndex = 1; | |
139 | + ofn.lpstrFileTitle = Model_FileName; // Just File Name | |
140 | + ofn.nMaxFileTitle = sizeof(Model_FileName);; | |
141 | + ofn.lpstrInitialDir = StartDirectory; | |
142 | + ofn.lpstrTitle = Title; | |
143 | + ofn.Flags = OFN_PATHMUSTEXIST | | |
144 | + OFN_FILEMUSTEXIST | | |
145 | + OFN_EXPLORER | | |
146 | + OFN_HIDEREADONLY | | |
147 | + OFN_FILEMUSTEXIST; | |
148 | + | |
149 | + if (GetOpenFileName(&ofn) == TRUE) | |
150 | + { | |
151 | + return 1; | |
152 | + } | |
153 | + return 0; | |
154 | +} | |
155 | + | |
156 | +// ************************************************************************* | |
157 | +// * SaveActorFile Terry Bernie * | |
158 | +// ************************************************************************* | |
159 | +bool GD_FileIO::SaveActorFile(char* Extension) | |
160 | +{ | |
161 | + /*char mFilename[1024]; | |
162 | + strcpy(mFilename,App->CL_Model_Data->JustName); | |
163 | + strcat(mFilename,".act"); | |
164 | + | |
165 | + | |
166 | + ZeroMemory(&ofn, sizeof(ofn)); | |
167 | + ofn.lStructSize = sizeof(ofn); | |
168 | + ofn.hwndOwner = App->MainHwnd; | |
169 | + ofn.hInstance = App->hInst; | |
170 | + ofn.lpstrFile = mFilename; | |
171 | + ofn.nMaxFile = sizeof(mFilename); | |
172 | + ofn.lpstrFilter = Extension; | |
173 | + | |
174 | + ofn.nFilterIndex = 1; | |
175 | + ofn.lpstrFileTitle = mFilename; | |
176 | + ofn.nMaxFileTitle = sizeof(mFilename);; | |
177 | + ofn.lpstrInitialDir = ""; | |
178 | + ofn.lpstrTitle = "Export Actor"; | |
179 | + | |
180 | + ofn.Flags = OFN_PATHMUSTEXIST | | |
181 | + OFN_FILEMUSTEXIST | | |
182 | + OFN_EXPLORER | | |
183 | + OFN_HIDEREADONLY | | |
184 | + OFN_OVERWRITEPROMPT ; | |
185 | + if (GetSaveFileName(&ofn) == TRUE) | |
186 | + { | |
187 | + strcpy(App->CL_Export_Actor->ExportName,mFilename); | |
188 | + return 1; | |
189 | + | |
190 | + }*/ | |
191 | + | |
192 | +return 0; | |
193 | +} | |
194 | + | |
195 | +// ************************************************************************* | |
196 | +// * StartBrowser * | |
197 | +// ************************************************************************* | |
198 | +bool GD_FileIO::StartBrowser(char* szInitDir) | |
199 | +{ | |
200 | + TCHAR dname[MAX_PATH*2]; | |
201 | + IMalloc *imalloc; SHGetMalloc(&imalloc); | |
202 | + BROWSEINFO bi; ZeroMemory(&bi,sizeof(bi)); | |
203 | + bi.hwndOwner = App->Fdlg; | |
204 | + bi.pszDisplayName=dname; | |
205 | + bi.lpszTitle = BrowserMessage; | |
206 | + bi.lParam = (LPARAM) szInitDir; | |
207 | + bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI; | |
208 | + bi.lpfn = BrowseCallbackProc; | |
209 | + | |
210 | + CoInitialize(NULL); | |
211 | + ITEMIDLIST *pidl = SHBrowseForFolder(&bi); | |
212 | + | |
213 | + if (pidl) | |
214 | + { | |
215 | + imalloc->Free(pidl); | |
216 | + imalloc->Release(); | |
217 | + return 1; | |
218 | + } | |
219 | + | |
220 | + imalloc->Free(pidl); | |
221 | + imalloc->Release(); | |
222 | + | |
223 | + return 0; | |
224 | +} | |
225 | +// ************************************************************************* | |
226 | +// * BrowseCallbackProc * | |
227 | +// ************************************************************************* | |
228 | +int __stdcall GD_FileIO::BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM lpData) | |
229 | +{ | |
230 | + ////Initialization callback message | |
231 | + //if(uMsg==BFFM_INITIALIZED) | |
232 | + //{ | |
233 | + // //SendMessage(hWnd, BFFM_SETSELECTION, 1, (LPARAM) szInitialPathName); | |
234 | + // SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData); | |
235 | + | |
236 | + //} | |
237 | + | |
238 | + ////Selection change message - store the selected directory | |
239 | + //if(uMsg==BFFM_SELCHANGED) | |
240 | + //{ | |
241 | + // TCHAR szDir[MAX_PATH*2] = { 0 }; | |
242 | + | |
243 | + // // fail if non-filesystem | |
244 | + // BOOL bRet = SHGetPathFromIDList((LPITEMIDLIST) lParam, szDir); | |
245 | + // if (bRet) | |
246 | + // { | |
247 | + // //If the folder cannot be "read" then fail | |
248 | + // if (_taccess(szDir, 00) != 0) | |
249 | + // { | |
250 | + // bRet = FALSE; | |
251 | + // } | |
252 | + // else | |
253 | + // { | |
254 | + // SHFILEINFO sfi; | |
255 | + // ::SHGetFileInfo((LPCTSTR)lParam, 0, &sfi, sizeof(sfi), | |
256 | + // SHGFI_PIDL | SHGFI_ATTRIBUTES); | |
257 | + | |
258 | + // // fail if pidl is a link | |
259 | + // if (sfi.dwAttributes & SFGAO_LINK) | |
260 | + // bRet = FALSE; | |
261 | + // } | |
262 | + // } | |
263 | + | |
264 | + // // if invalid selection, disable the OK button | |
265 | + // if (!bRet) | |
266 | + // { | |
267 | + // ::EnableWindow(GetDlgItem(hwnd, IDOK), FALSE); | |
268 | + // /// strcpy(App->CL_FileIO->szSelectedDir,""); | |
269 | + // } | |
270 | + // else | |
271 | + // /// strcpy(App->CL_FileIO->szSelectedDir, szDir); | |
272 | + // } | |
273 | + | |
274 | + return 0; | |
275 | +} | |
276 | + | |
277 | +// ************************************************************************* | |
278 | +// * SaveFile * | |
279 | +// ************************************************************************* | |
280 | +bool GD_FileIO::SaveFile(char* Extension,char* Title,char* FileName) | |
281 | +{ | |
282 | + char mFilename[1024]; | |
283 | + mFilename[0] = 0; | |
284 | + Save_Path_FileName[0] = 0; | |
285 | + Save_FileName[0] = 0; | |
286 | + | |
287 | + strcpy(mFilename,FileName); | |
288 | + | |
289 | + ZeroMemory(&ofn, sizeof(ofn)); | |
290 | + ofn.lStructSize = sizeof(ofn); | |
291 | + ofn.hwndOwner = App->MainHwnd; | |
292 | + ofn.hInstance = App->hInst; | |
293 | + ofn.lpstrFile = mFilename; | |
294 | + ofn.nMaxFile = sizeof(mFilename); | |
295 | + ofn.lpstrFilter = Extension; | |
296 | +; | |
297 | + ofn.nFilterIndex = 1; | |
298 | + ofn.lpstrFileTitle = mFilename; | |
299 | + ofn.nMaxFileTitle = sizeof(mFilename);; | |
300 | + ofn.lpstrInitialDir = ""; | |
301 | + ofn.lpstrTitle = Title; | |
302 | + ofn.Flags = OFN_PATHMUSTEXIST | | |
303 | + OFN_FILEMUSTEXIST | | |
304 | + OFN_EXPLORER | | |
305 | + OFN_HIDEREADONLY | | |
306 | + OFN_OVERWRITEPROMPT ; | |
307 | + | |
308 | + if (GetSaveFileName(&ofn) == TRUE) | |
309 | + { | |
310 | + strcpy(Save_Path_FileName,mFilename); | |
311 | + return 1; | |
312 | + } | |
313 | + | |
314 | +return 0; | |
315 | +} | |
316 | + | |
317 | +// ************************************************************************* | |
318 | +// * SearchFolders Terry Bernie * | |
319 | +// ************************************************************************* | |
320 | +bool GD_FileIO::SearchFolders(char* Path,char* File) | |
321 | +{ | |
322 | + char pSearchPath[1024]; | |
323 | + | |
324 | + WIN32_FIND_DATA FindFileData; | |
325 | + HANDLE hFind; | |
326 | + | |
327 | + strcpy(pSearchPath,Path); | |
328 | + strcat(pSearchPath,File); | |
329 | + | |
330 | + hFind = FindFirstFile(pSearchPath, &FindFileData); | |
331 | + if(hFind == INVALID_HANDLE_VALUE) | |
332 | + { | |
333 | + return 0; | |
334 | + } | |
335 | + else | |
336 | + { | |
337 | + FindClose(hFind); | |
338 | + return 1; | |
339 | + } | |
340 | + | |
341 | + return 0; | |
342 | +} | |
343 | + | |
344 | +// ************************************************************************* | |
345 | +// * Search_For_Folder Terry Bernie * | |
346 | +// ************************************************************************* | |
347 | +bool GD_FileIO::Search_For_Folder(char* FolderPath) | |
348 | +{ | |
349 | + char pSearchPath[1024]; | |
350 | + | |
351 | + WIN32_FIND_DATA FindFileData; | |
352 | + HANDLE hFind; | |
353 | + | |
354 | + strcpy(pSearchPath,FolderPath); | |
355 | + | |
356 | + hFind = FindFirstFile(pSearchPath, &FindFileData); | |
357 | + if(hFind == INVALID_HANDLE_VALUE) | |
358 | + { | |
359 | + return 0; | |
360 | + } | |
361 | + else | |
362 | + { | |
363 | + FindClose(hFind); | |
364 | + return 1; | |
365 | + } | |
366 | + | |
367 | + return 0; | |
368 | +} | |
369 | + | |
370 | +// ************************************************************************* | |
371 | +// * SaveFileCom Terry Bernie * | |
372 | +// ************************************************************************* | |
373 | +bool GD_FileIO::SaveFileCom(char* Extension,char* Title,char* StartDirectory) | |
374 | +{ | |
375 | + ZeroMemory(&ofn, sizeof(ofn)); | |
376 | + ofn.lStructSize = sizeof(ofn); | |
377 | + ofn.hwndOwner = App->MainHwnd; | |
378 | + ofn.hInstance = App->hInst; | |
379 | + ofn.lpstrFile = mSavePathFileCom; | |
380 | + ofn.nMaxFile = sizeof(mSavePathFileCom); | |
381 | + ofn.lpstrFilter =Extension; | |
382 | + ofn.nFilterIndex = 1; | |
383 | + ofn.lpstrFileTitle = mSaveFileCom; | |
384 | + ofn.nMaxFileTitle = sizeof(mSaveFileCom); | |
385 | + ofn.lpstrInitialDir =StartDirectory; | |
386 | + ofn.lpstrTitle = Title; | |
387 | + ofn.Flags = //OFN_PATHMUSTEXIST | | |
388 | + OFN_NOCHANGEDIR | | |
389 | + //OFN_FILEMUSTEXIST | | |
390 | + OFN_EXPLORER | | |
391 | + OFN_HIDEREADONLY | | |
392 | + OFN_OVERWRITEPROMPT ; | |
393 | + | |
394 | + if (GetSaveFileName(&ofn) == TRUE) | |
395 | + { | |
396 | + return 1; | |
397 | + } | |
398 | + | |
399 | + return 0; | |
400 | +} | |
401 | + | |
402 | +// ************************************************************************* | |
403 | +// * GetSaveFolder 18/10/03 * | |
404 | +// ************************************************************************* | |
405 | +bool GD_FileIO::GetSaveFolder() | |
406 | +{ | |
407 | + | |
408 | + //strcpy(Model_FileName,""); | |
409 | + //strcpy(Model_Path_FileName,""); | |
410 | + // | |
411 | + //ZeroMemory(&ofn, sizeof(ofn)); | |
412 | + //ofn.lStructSize = sizeof(ofn); | |
413 | + //ofn.hwndOwner = App->MainHwnd; | |
414 | + //ofn.hInstance = App->hInst; | |
415 | + //ofn.lpstrFile = Model_Path_FileName; // full path and file name | |
416 | + //ofn.nMaxFile = sizeof(Model_Path_FileName); | |
417 | + //ofn.lpstrFilter = "*.ssss\0*.ssss\0"; | |
418 | + | |
419 | + //ofn.nFilterIndex = 1; | |
420 | + //ofn.lpstrFileTitle = Model_FileName; // Just File Name | |
421 | + //ofn.nMaxFileTitle = sizeof(Model_FileName);; | |
422 | + //ofn.lpstrInitialDir = NULL; | |
423 | + //ofn.lpstrTitle = "Test"; | |
424 | + //ofn.lpfnHook = OfnHookProc; | |
425 | + //ofn.lpTemplateName =MAKEINTRESOURCE(IDD_ACTORSPLITER); | |
426 | + //ofn.Flags = OFN_PATHMUSTEXIST | | |
427 | + // OFN_FILEMUSTEXIST | | |
428 | + // OFN_EXPLORER | | |
429 | + // OFN_ENABLETEMPLATE | | |
430 | + // OFN_ENABLEHOOK | | |
431 | + // OFN_HIDEREADONLY; | |
432 | + | |
433 | + //if (GetOpenFileName(&ofn) == TRUE) | |
434 | + //{ | |
435 | + // return 1; | |
436 | + //} | |
437 | + //////strcpy(SaveLoadMessage,S_File[0]->SaveMessage); | |
438 | + ////int Len=0; | |
439 | + | |
440 | + ////char szFile[260]; | |
441 | + | |
442 | + ////szFile[0] = 0; | |
443 | + | |
444 | + ////ZeroMemory(&ofn2, sizeof(ofn2)); | |
445 | + ////ofn2.lStructSize = sizeof(ofn2); | |
446 | + ////ofn2.hwndOwner = App->MainHwnd; // Should be Hwnd1 | |
447 | + ////ofn2.hInstance = App->hInst; | |
448 | + ////ofn2.lpstrFile = " "; | |
449 | + ////ofn2.nMaxFile = sizeof(szFile); | |
450 | + ////ofn2.lpstrDefExt=NULL; | |
451 | + ////ofn2.lpstrFilter ="Actor Files *.*\0*.*\0"; | |
452 | + ////ofn2.lpstrCustomFilter=NULL; | |
453 | + ////ofn2.nFileExtension=NULL; | |
454 | + ////ofn2.nFilterIndex =NULL; | |
455 | + ////ofn2.nFileExtension=NULL; | |
456 | + ////ofn2.nMaxFileTitle = NULL; | |
457 | + ////ofn2.lpstrInitialDir =NULL; | |
458 | + ////ofn2.lpstrTitle = "Equity 4.2.2 Select Folder For Decompile"; | |
459 | + //////ofn2.lpfnHook =(LPOFNHOOKPROC)OpenCommanFileProc2; | |
460 | + //////ofn2.lpTemplateName =MAKEINTRESOURCE(IDD_ACTORSPLITER); | |
461 | + ////ofn2.Flags = OFN_EXPLORER | | |
462 | + //// OFN_HIDEREADONLY | |
463 | + //// ; | |
464 | + ////if (GetOpenFileName(&ofn2) == TRUE) | |
465 | + ////{ | |
466 | + | |
467 | + //// //strcpy(ActorSplitter->FileName,FileName); | |
468 | + | |
469 | + //// // DialogBox(hInst,(LPCTSTR) IDD_DECOMPILESTATUS,Fdlg,(DLGPROC)DecompileStatusProc); | |
470 | + | |
471 | + | |
472 | + //// return 1; | |
473 | + | |
474 | + ////} | |
475 | + | |
476 | + return 0; | |
477 | +} | |
478 | + | |
479 | +UINT CALLBACK GD_FileIO::OfnHookProc(HWND hDlg, UINT uMsg, UINT /*wParam*/, LONG lParam) | |
480 | +{ | |
481 | + switch (uMsg) | |
482 | + { | |
483 | + case WM_CTLCOLORSTATIC: | |
484 | + { | |
485 | + //if(GetDlgItem(hDlg,IDC_MESSAGE) == (HWND)lParam) | |
486 | + //{ | |
487 | + // SetBkColor((HDC) wParam, RGB(213,222,242)); | |
488 | + // SetTextColor((HDC) wParam, RGB(0,255, 0)); | |
489 | + // //SetBkMode((HDC) wParam, TRANSPARENT); | |
490 | + // hBrushStatic = CreateSolidBrush(RGB(255,255,255)); | |
491 | + // return (UINT) hBrushStatic; | |
492 | + //} | |
493 | + //if(GetDlgItem(hDlg,IDC_MESSAGE2) == (HWND)lParam) | |
494 | + //{ | |
495 | + // // SetBkColor((HDC) wParam, RGB(213,222,242)); | |
496 | + // // SetTextColor((HDC) wParam, RGB(255,0, 0)); | |
497 | + // //SetBkMode((HDC) wParam, TRANSPARENT); | |
498 | + // hBrushStatic = CreateSolidBrush(RGB(255,255,255)); | |
499 | + // return (UINT) hBrushStatic; | |
500 | + //} | |
501 | + | |
502 | + //if(GetDlgItem(hDlg,IDC_FOLDERPATH) == (HWND)lParam) | |
503 | + //{ | |
504 | + // /*SetBkColor((HDC) , RGB(213,222,242)); | |
505 | + // SetTextColor((HDC) wParam, RGB(0,255, 0));*/ | |
506 | + // //SetBkMode((HDC) wParam, TRANSPARENT); | |
507 | + // return (UINT) App->Brush_White; | |
508 | + //} | |
509 | + break; | |
510 | + } | |
511 | + | |
512 | + case WM_NOTIFY: | |
513 | + OFNOTIFY* pofNotify = (OFNOTIFY*)lParam; | |
514 | + switch (pofNotify->hdr.code) | |
515 | + { | |
516 | + case CDN_INITDONE: | |
517 | + { | |
518 | + HWND temp=GetParent(hDlg); | |
519 | + CommDlg_OpenSave_SetControlText(GetParent(hDlg),IDOK, "Ok"); | |
520 | + | |
521 | + SendMessage(temp,CDM_HIDECONTROL,cmb1,0); | |
522 | + SendMessage(temp,CDM_HIDECONTROL,stc2,0); | |
523 | + SendMessage(temp,CDM_HIDECONTROL,stc3,0); | |
524 | + | |
525 | + return TRUE; | |
526 | + } | |
527 | + case CDN_FOLDERCHANGE: | |
528 | + { | |
529 | + LPTSTR pszPathName; | |
530 | + pszPathName = new TCHAR[_MAX_DIR]; | |
531 | + HWND hTrueDlg = GetParent(hDlg); | |
532 | + SendMessage(hTrueDlg, CDM_GETFOLDERPATH, _MAX_PATH, (LONG)pszPathName); | |
533 | + | |
534 | + CommDlg_OpenSave_SetControlText(GetParent(hDlg), edt1,pszPathName); | |
535 | + | |
536 | + //SetDlgItemText(hDlg, IDC_FOLDERPATH, pszPathName); | |
537 | + delete[] pszPathName; | |
538 | + return TRUE; | |
539 | + } | |
540 | + } | |
541 | + } | |
542 | + return FALSE; | |
543 | +} | |
544 | +// ************************************************************************* | |
545 | +// * OpenCommanFileNotify2 03/03/04 * | |
546 | +// ************************************************************************* | |
547 | +bool NEAR PASCAL GD_FileIO::OpenCommanFileNotify2(HWND hDlg, LPOFNOTIFY pofn) | |
548 | +{ | |
549 | + static char lpszNotification[64]; | |
550 | + | |
551 | + switch (pofn->hdr.code) | |
552 | + { | |
553 | + | |
554 | + | |
555 | + case CDN_SELCHANGE: | |
556 | + { | |
557 | + | |
558 | + // SetDlgItemText(hDlg, IDC_FOLDERPATH,pofn->pszFile); | |
559 | + | |
560 | + }break; | |
561 | + case CDN_FOLDERCHANGE: | |
562 | + { | |
563 | + HWND temp=GetParent(hDlg); | |
564 | + char Buf[1024]; | |
565 | + SendMessage(temp,CDM_GETFOLDERPATH ,1024,(LPARAM) (LPTSTR)Buf); | |
566 | + // SetDlgItemText(hDlg, IDC_FOLDERPATH,Buf); | |
567 | + CommDlg_OpenSave_SetControlText(GetParent(hDlg), edt1,Buf); | |
568 | + CommDlg_OpenSave_SetControlText(GetParent(hDlg),IDOK, "Ok"); | |
569 | + | |
570 | + SendMessage(temp,CDM_HIDECONTROL,edt1,0); | |
571 | + SendMessage(temp,CDM_HIDECONTROL,cmb1,0); | |
572 | + SendMessage(temp,CDM_HIDECONTROL,stc2,0); | |
573 | + SendMessage(temp,CDM_HIDECONTROL,stc3,0); | |
574 | + }break; | |
575 | + | |
576 | + case CDN_HELP: | |
577 | + { | |
578 | + }break; | |
579 | + | |
580 | + case CDN_FILEOK: | |
581 | + { | |
582 | + }break; | |
583 | + | |
584 | + } | |
585 | + return TRUE; | |
586 | +} | |
587 | + | |
588 | +// ************************************************************************* | |
589 | +// * Create_OutPut_Folder Terry Bernie * | |
590 | +// ************************************************************************* | |
591 | +bool GD_FileIO::Create_Output_Folder(char* Extension) | |
592 | +{ | |
593 | + strcpy(OutputFolder,""); | |
594 | + | |
595 | + ///strcpy(OutputFolder,App->CL_FileIO->szSelectedDir); | |
596 | + strcat(OutputFolder,"\\"); | |
597 | + ///strcat(OutputFolder,App->CL_Model_Data->JustName); | |
598 | + strcat(OutputFolder,Extension); | |
599 | + strcat(OutputFolder,"\\"); | |
600 | + | |
601 | + CreateDirectory(OutputFolder,NULL); | |
602 | + return 0; | |
603 | +} | |
604 | + | |
605 | +// ************************************************************************* | |
606 | +// * Create_Motion_Folder Terry Bernie * | |
607 | +// ************************************************************************* | |
608 | +bool GD_FileIO::Create_Motion_Folder() | |
609 | +{ | |
610 | + strcat(OutputFolder,"\\"); | |
611 | + ///strcat(OutputFolder,App->CL_Model_Data->JustName); | |
612 | + strcat(OutputFolder,"_Motions"); | |
613 | + | |
614 | + CreateDirectory(OutputFolder,NULL); | |
615 | + return 0; | |
616 | +} | |
617 | + | |
618 | +// ************************************************************************* | |
619 | +// * Create_Motion2_Folder Terry Bernie * | |
620 | +// ************************************************************************* | |
621 | +bool GD_FileIO::Create_Motion_Folder2() | |
622 | +{ | |
623 | + char Temp[1024]; | |
624 | + strcpy(Temp,OutputFolder); | |
625 | + strcat(Temp,"\\"); | |
626 | + ///strcat(Temp,App->CL_Model_Data->JustName); | |
627 | + strcat(Temp,"_Motions"); | |
628 | + | |
629 | + strcpy(MotionFolder,Temp); | |
630 | + | |
631 | + CreateDirectory(MotionFolder,NULL); | |
632 | + return 0; | |
633 | +} | |
634 | + | |
635 | +// ************************************************************************* | |
636 | +// * Create_Motion2_Folder Terry Bernie * | |
637 | +// ************************************************************************* | |
638 | +bool GD_FileIO::Create_Texture_Folder() | |
639 | +{ | |
640 | + char Temp[1024]; | |
641 | + strcpy(Temp,OutputFolder); | |
642 | + strcat(Temp,"\\"); | |
643 | + ///strcat(Temp,App->CL_Model_Data->JustName); | |
644 | + strcat(Temp,"_Textures"); | |
645 | + | |
646 | + strcpy(TextureFolder,Temp); | |
647 | + | |
648 | + CreateDirectory(TextureFolder,NULL); | |
649 | + return 0; | |
650 | +} |
@@ -0,0 +1,80 @@ | ||
1 | +/* | |
2 | + Copyright (c) Equity10 2016 HGT Software W.T.Flanigan B.Parkin H.C.Flanigan | |
3 | + | |
4 | + This software is provided 'as-is', without any express or implied | |
5 | + warranty. In no event will the authors be held liable for any damages | |
6 | + arising from the use of this software. | |
7 | + | |
8 | + Permission is granted to anyone to use this software for any purpose, | |
9 | + including commercial applications, and to alter it and redistribute it | |
10 | + freely, subject to the following restrictions: | |
11 | + | |
12 | + 1. The origin of this software must not be misrepresented; you must not | |
13 | + claim that you wrote the original software. If you use this software | |
14 | + in a product, an acknowledgment in the product documentation would be | |
15 | + appreciated but is not required. | |
16 | + | |
17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
18 | + misrepresented as being the original software. | |
19 | + | |
20 | + 3. This notice may not be removed or altered from any source | |
21 | + distribution. | |
22 | +*/ | |
23 | + | |
24 | +#pragma once | |
25 | +class GD_FileIO | |
26 | +{ | |
27 | +public: | |
28 | + GD_FileIO(void); | |
29 | + ~GD_FileIO(void); | |
30 | + | |
31 | + bool OpenFile(char* Extension,char* Title,char* StartDirectory); | |
32 | + bool OpenTextureFile(char* Title,char* StartDirectory,bool SaveLocation); | |
33 | + bool Open_ResourceFile(char* Extension,char* Title,char* StartDirectory); | |
34 | + | |
35 | + bool SaveActorFile(char* Extension); | |
36 | + bool SaveFile(char* Extension,char* Title,char* Filename); | |
37 | + bool SaveFileCom(char* Extension,char* Title,char* StartDirectory); | |
38 | + | |
39 | + bool SearchFolders(char* Path,char* File); | |
40 | + bool Search_For_Folder(char* FolderPath); | |
41 | + | |
42 | + char Model_FileName[255]; | |
43 | + char Model_Path_FileName[1024]; | |
44 | + | |
45 | + char Texture_FileName[255]; | |
46 | + char Texture_Path_FileName[1024]; | |
47 | + | |
48 | + char Save_FileName[255]; // General use File name for Saving | |
49 | + char Save_Path_FileName[1024]; // General use File and Path for Saving | |
50 | + | |
51 | + char mSaveFileCom[255]; | |
52 | + char mSavePathFileCom[255]; | |
53 | + | |
54 | + bool StartBrowser(char* szInitDir); | |
55 | + | |
56 | + bool GetSaveFolder(); | |
57 | + | |
58 | + bool Create_Output_Folder(char* Extension); | |
59 | + bool Create_Motion_Folder(); | |
60 | + bool Create_Motion_Folder2(); | |
61 | + bool Create_Texture_Folder(); | |
62 | + | |
63 | + bool __stdcall OpenCommanFileNotify2(HWND hDlg, LPOFNOTIFY pofn); | |
64 | + | |
65 | + static UINT CALLBACK OfnHookProc(HWND hDlg, UINT uMsg, UINT /*wParam*/, LONG lParam); | |
66 | + | |
67 | + OPENFILENAME ofn; | |
68 | + OPENFILENAME ofn2; | |
69 | + | |
70 | + char OutputFolder[1024]; | |
71 | + char MotionFolder[1024]; | |
72 | + char TextureFolder[1024]; | |
73 | + | |
74 | + char BrowserMessage[250]; | |
75 | + TCHAR szSelectedDir[500]; | |
76 | + | |
77 | +protected: | |
78 | + static int __stdcall BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM lpData); | |
79 | +}; | |
80 | + |
@@ -0,0 +1,1045 @@ | ||
1 | +/* | |
2 | + Copyright (c) Equity10 2016 Inflanite W.T.Flanigan B.Parkin H.C.Flanigan | |
3 | + | |
4 | + This software is provided 'as-is', without any express or implied | |
5 | + warranty. In no event will the authors be held liable for any damages | |
6 | + arising from the use of this software. | |
7 | + | |
8 | + Permission is granted to anyone to use this software for any purpose, | |
9 | + including commercial applications, and to alter it and redistribute it | |
10 | + freely, subject to the following restrictions: | |
11 | + | |
12 | + 1. The origin of this software must not be misrepresented; you must not | |
13 | + claim that you wrote the original software. If you use this software | |
14 | + in a product, an acknowledgment in the product documentation would be | |
15 | + appreciated but is not required. | |
16 | + | |
17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
18 | + misrepresented as being the original software. | |
19 | + | |
20 | + 3. This notice may not be removed or altered from any source | |
21 | + distribution. | |
22 | +*/ | |
23 | + | |
24 | +#include "StdAfx.h" | |
25 | +#include "resource.h" | |
26 | +#include "GD19_App.h" | |
27 | +#include "GD_Importer.h" | |
28 | + | |
29 | + | |
30 | +GD_Importer::GD_Importer(void) | |
31 | +{ | |
32 | + DefaultPresets = 8388936; | |
33 | + Set_FlipWindingOrder = 0; | |
34 | + Set_MakeLeftHanded = 0; | |
35 | + Set_FlipUVs = 0; | |
36 | + | |
37 | + WriteRecentFiles = NULL; | |
38 | + ReadRecentFiles = NULL; | |
39 | + mHistoryMenu = NULL; | |
40 | + | |
41 | + JustFileName[0] = 0; | |
42 | + | |
43 | + Is_RFEditPro = 0; | |
44 | +} | |
45 | + | |
46 | + | |
47 | +GD_Importer::~GD_Importer(void) | |
48 | +{ | |
49 | +} | |
50 | + | |
51 | +// ************************************************************************* | |
52 | +// * RFActor_Loader Terry Terry Berine * | |
53 | +// ************************************************************************* | |
54 | +bool GD_Importer::RFActor_Loader(void) | |
55 | +{ | |
56 | + /*int Result = App->CL_FileIO->OpenFile("RF Actor *.act\0*.act\0","RF Actor",NULL); | |
57 | + if (Result == 0) | |
58 | + { | |
59 | + return 1; | |
60 | + } | |
61 | + | |
62 | + App->Cl_Ogre->Loading_Text("Loading Data",1); | |
63 | + | |
64 | + Clear_Model(); | |
65 | + | |
66 | + App->CL_Model_Data->Set_Paths(); | |
67 | + | |
68 | + App->CL_Genesis_Import->LoadActor(); | |
69 | + | |
70 | + App->CL_Model_Data->Model_Type = LoadedFile_Actor; | |
71 | + | |
72 | + Set_Equity(); | |
73 | + | |
74 | + App->CL_Model_Data->Model_Loaded = 1; | |
75 | + | |
76 | + App->Cl_Grid->Zoom(); | |
77 | + | |
78 | + App->Cl_Ogre->Loading_Text("Loading Finished",0);*/ | |
79 | + | |
80 | + return 1; | |
81 | +} | |
82 | + | |
83 | +// ************************************************************************* | |
84 | +// * STL_Loader Terry Bernie * | |
85 | +// ************************************************************************* | |
86 | +bool GD_Importer::STL_Loader(char* Extension,char* Extension2) | |
87 | +{ | |
88 | + //int Result = App->CL_FileIO->OpenFile(Extension,Extension2,NULL); | |
89 | + //if (Result == 0) | |
90 | + //{ | |
91 | + // return 1; | |
92 | + //} | |
93 | + | |
94 | + //App->CL_Assimp = new Eq_Assimp(); | |
95 | + | |
96 | + //App->Cl_Ogre->Loading_Text("Loading Data",1); | |
97 | + | |
98 | + //Clear_Model(); | |
99 | + | |
100 | + //App->CL_Model_Data->Set_Paths(); | |
101 | + | |
102 | + | |
103 | + //App->CL_Assimp->SelectedPreset = 8 + 8388608+64+aiProcess_PreTransformVertices; | |
104 | + | |
105 | + //bool Test = App->CL_Assimp->LoadFile(App->CL_FileIO->Model_FileName); | |
106 | + //if (Test == 0) | |
107 | + //{ | |
108 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
109 | + // return 0; | |
110 | + //} | |
111 | + | |
112 | + //App->CL_Model_Data->Model_Type = LoadedFile_STL; | |
113 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
114 | + | |
115 | + //App->CL_Model_Data->Model_Loaded = 1; | |
116 | + | |
117 | + //App->Cl_Grid->Zoom(); | |
118 | + | |
119 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
120 | + | |
121 | + //Set_Equity(); | |
122 | + | |
123 | + //App->CL_ToolBar->Set_LightsOn(true); | |
124 | + // | |
125 | + //if (App->CL_Assimp) | |
126 | + //{ | |
127 | + // delete App->CL_Assimp; | |
128 | + // App->CL_Assimp = NULL; | |
129 | + //} | |
130 | + return 1; | |
131 | +} | |
132 | + | |
133 | +// ************************************************************************* | |
134 | +// * RFActor_Body Terry Terry Berine * | |
135 | +// ************************************************************************* | |
136 | +bool GD_Importer::RFActor_Body(void) | |
137 | +{ | |
138 | + /*int Result = App->CL_FileIO->OpenFile("RF Actor Body *.bdy\0*.bdy\0","RF Actor Body",NULL); | |
139 | + if (Result == 0) | |
140 | + { | |
141 | + return 1; | |
142 | + } | |
143 | + | |
144 | + App->Cl_Ogre->Loading_Text("Loading Data",1); | |
145 | + | |
146 | + Clear_Model(); | |
147 | + | |
148 | + App->CL_Model_Data->Set_Paths(); | |
149 | + | |
150 | + App->CL_Genesis_Import->LoadBody(); | |
151 | + | |
152 | + App->CL_Model_Data->Model_Type = LoadedFile_Actor; | |
153 | + | |
154 | + Set_Equity(); | |
155 | + | |
156 | + App->CL_Model_Data->Model_Loaded = 1; | |
157 | + | |
158 | + App->Cl_Grid->Zoom(); | |
159 | + | |
160 | + App->Cl_Ogre->Loading_Text("Loading Finished",0);*/ | |
161 | + | |
162 | + return 1; | |
163 | +} | |
164 | +// ************************************************************************* | |
165 | +// * Test_obj_Loader_Loader Terry Bernie * | |
166 | +// ************************************************************************* | |
167 | +bool GD_Importer::Test_obj_Loader(char* Extension,char* Extension2) | |
168 | +{ | |
169 | + //int Result = App->CL_FileIO->OpenFile(Extension,Extension2,NULL); | |
170 | + //if (Result == 0) | |
171 | + //{ | |
172 | + // return 1; | |
173 | + //} | |
174 | + | |
175 | + //App->Cl_Ogre->Loading_Text("Loading Data",1); | |
176 | + | |
177 | + //Clear_Model(); | |
178 | + | |
179 | + //App->CL_Model_Data->Set_Paths(); | |
180 | + | |
181 | + | |
182 | + //bool Test = App->Cl_Import_Obj->Load(App->CL_FileIO->Model_FileName); | |
183 | + //if (Test == 0) | |
184 | + //{ | |
185 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
186 | + // return 0; | |
187 | + //} | |
188 | + | |
189 | + /*App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
190 | + | |
191 | + App->CL_Model_Data->Model_Loaded = 1; | |
192 | + | |
193 | + App->Cl_Grid->Zoom();*/ | |
194 | + | |
195 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
196 | + | |
197 | + //Set_Equity(); | |
198 | + | |
199 | + return 1; | |
200 | +} | |
201 | + | |
202 | +// ************************************************************************* | |
203 | +// * Assimp_Loader Terry Bernie * | |
204 | +// ************************************************************************* | |
205 | +bool GD_Importer::Assimp_Loader(char* Extension,char* Extension2) | |
206 | +{ | |
207 | + int Result = App->Cl_FileIO->OpenFile(Extension,Extension2,NULL); | |
208 | + if (Result == 0) | |
209 | + { | |
210 | + return 1; | |
211 | + } | |
212 | + | |
213 | + //App->Cl_Assimp = new Eq_Assimp(); | |
214 | + | |
215 | + //App->Cl19_Ogre->Loading_Text("Loading Data",1); | |
216 | + | |
217 | + Clear_Model(); | |
218 | + | |
219 | +// App->CL_Model_Data->Set_Paths(); | |
220 | + | |
221 | + | |
222 | + App->Cl_Assimp->SelectedPreset = 8 + 8388608+64+aiProcess_PreTransformVertices; | |
223 | + | |
224 | + bool Test = App->Cl_Assimp->LoadFile(App->Cl_FileIO->Model_FileName); | |
225 | + if (Test == 0) | |
226 | + { | |
227 | + //App->CL_Dialogs->PleaseWaitEnd(); | |
228 | + return 0; | |
229 | + } | |
230 | + | |
231 | + /*App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
232 | + App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
233 | + | |
234 | + App->CL_Model_Data->Model_Loaded = 1; | |
235 | + | |
236 | + App->Cl_Grid->Zoom(); | |
237 | + | |
238 | + App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
239 | + | |
240 | + Set_Equity(); | |
241 | + | |
242 | + if (App->CL_Assimp) | |
243 | + { | |
244 | + delete App->CL_Assimp; | |
245 | + App->CL_Assimp = NULL; | |
246 | + }*/ | |
247 | + return 1; | |
248 | +} | |
249 | + | |
250 | +// ************************************************************************* | |
251 | +// * RFEditorPro_Loader Terry Bernie * | |
252 | +// ************************************************************************* | |
253 | +bool GD_Importer::RFEditorPro_Loader(char* Extension, char* Extension2) | |
254 | +{ | |
255 | + //int Result = App->CL_FileIO->OpenFile(Extension, Extension2, NULL); | |
256 | + //if (Result == 0) | |
257 | + //{ | |
258 | + // return 1; | |
259 | + //} | |
260 | + | |
261 | + //App->CL_Assimp = new Eq_Assimp(); | |
262 | + | |
263 | + //App->Cl_Ogre->Loading_Text("Loading Data", 1); | |
264 | + | |
265 | + //Clear_Model(); | |
266 | + | |
267 | + //App->CL_Model_Data->Set_Paths(); | |
268 | + | |
269 | + | |
270 | + //App->CL_Assimp->SelectedPreset = 8 + 8388608 + 64 + aiProcess_PreTransformVertices; | |
271 | + | |
272 | + //Is_RFEditPro = 1; | |
273 | + | |
274 | + //bool Test = App->CL_Assimp->LoadFile(App->CL_FileIO->Model_FileName); | |
275 | + //if (Test == 0) | |
276 | + //{ | |
277 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
278 | + // return 0; | |
279 | + //} | |
280 | + | |
281 | + //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
282 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
283 | + | |
284 | + //App->CL_Model_Data->Model_Loaded = 1; | |
285 | + | |
286 | + //App->Cl_Grid->Zoom(); | |
287 | + | |
288 | + //App->Cl_Ogre->Loading_Text("Loading Finished", 0); | |
289 | + | |
290 | + //Set_Equity(); | |
291 | + | |
292 | + //Is_RFEditPro = 0; | |
293 | + | |
294 | + //if (App->CL_Assimp) | |
295 | + //{ | |
296 | + // delete App->CL_Assimp; | |
297 | + // App->CL_Assimp = NULL; | |
298 | + //} | |
299 | + | |
300 | + //App->CL_Global_Model->Rotate_X_PLus(90); | |
301 | + //App->CL_Global_Model->Centre_Model_Mid(); | |
302 | + | |
303 | + | |
304 | + return 1; | |
305 | +} | |
306 | + | |
307 | +// ************************************************************************* | |
308 | +// * Truespace_Loader Terry Bernie * | |
309 | +// ************************************************************************* | |
310 | +bool GD_Importer::Truespace_Loader(char* Extension,char* Extension2) | |
311 | +{ | |
312 | + //int Result = App->CL_FileIO->OpenFile(Extension,Extension2,NULL); | |
313 | + //if (Result == 0) | |
314 | + //{ | |
315 | + // return 1; | |
316 | + //} | |
317 | + //App->CL_Assimp = new Eq_Assimp(); | |
318 | + | |
319 | + //App->Cl_Ogre->Loading_Text("Loading Data",1); | |
320 | + | |
321 | + ////App->CL_Dialogs->PleaseWait(); | |
322 | + | |
323 | + //Clear_Model(); | |
324 | + | |
325 | + //App->CL_Model_Data->Set_Paths(); | |
326 | + | |
327 | + //App->CL_Assimp->LoadFile(App->CL_FileIO->Model_FileName); | |
328 | + | |
329 | + //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
330 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
331 | + | |
332 | + //App->CL_Model_Data->Model_Loaded = 1; | |
333 | + | |
334 | + //App->Cl_Grid->Zoom(); | |
335 | + | |
336 | + ////App->CL_Dialogs->PleaseWaitEnd(); | |
337 | + | |
338 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
339 | + | |
340 | + //Set_Equity(); | |
341 | + | |
342 | + //if (App->CL_Assimp) | |
343 | + //{ | |
344 | + // delete App->CL_Assimp; | |
345 | + // App->CL_Assimp = NULL; | |
346 | + //} | |
347 | + | |
348 | + return 1; | |
349 | +} | |
350 | + | |
351 | +// ************************************************************************* | |
352 | +// * Milk_Loader Terry Bernie * | |
353 | +// ************************************************************************* | |
354 | +bool GD_Importer::Milk_Loader(bool UseWinDialogLoader) | |
355 | +{ | |
356 | + //int Result = App->CL_FileIO->OpenFile("MilkShape Files *.ms3d\0*.ms3d\0","Load MilkShape File",NULL); | |
357 | + //if (Result == 0) | |
358 | + //{ | |
359 | + // return 1; | |
360 | + //} | |
361 | + | |
362 | + //App->CL_Assimp = new Eq_Assimp(); | |
363 | + | |
364 | + //App->Cl_Ogre->Loading_Text("Loading Please Wait",1); | |
365 | + | |
366 | + //Clear_Model(); | |
367 | + | |
368 | + //App->CL_Model_Data->Set_Paths(); | |
369 | + | |
370 | + ///*App->CL_Milk_Import->LoadFromFile(App->CL_FileIO->Model_FileName); | |
371 | + | |
372 | + //App->CL_Milk_Import->Milk_StoreData();*/ | |
373 | + //App->CL_Assimp->SelectedPreset = 8 + 8388608+64; | |
374 | + //App->CL_Assimp->LoadFile(App->CL_FileIO->Model_FileName); | |
375 | + | |
376 | + ////Set_Equity(); | |
377 | + | |
378 | + //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
379 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
380 | + //App->CL_Model_Data->Model_Loaded = 1; | |
381 | + | |
382 | + //App->Cl_Grid->Zoom(); | |
383 | + | |
384 | + ////App->Cl_Importer->Show_PostDialog(); | |
385 | + | |
386 | + //Set_Equity(); | |
387 | + | |
388 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
389 | + | |
390 | + //if (App->CL_Assimp) | |
391 | + //{ | |
392 | + // delete App->CL_Assimp; | |
393 | + // App->CL_Assimp = NULL; | |
394 | + //} | |
395 | + return 1; | |
396 | +} | |
397 | + | |
398 | +// ************************************************************************* | |
399 | +// * Ogre_Skeleton Terry Bernie * | |
400 | +// ************************************************************************* | |
401 | +bool GD_Importer::Ogre_Skeleton(char* Extension,char* Extension2) | |
402 | +{ | |
403 | + //int Result = App->CL_FileIO->OpenFile(Extension,Extension2,NULL); | |
404 | + //if (Result == 0) | |
405 | + //{ | |
406 | + // return 1; | |
407 | + //} | |
408 | + | |
409 | + //App->CL_Dialogs->PleaseWait(); | |
410 | + | |
411 | + //Clear_Model(); | |
412 | + | |
413 | + //App->CL_Model_Data->Set_Paths(); | |
414 | + //// | |
415 | + | |
416 | + //App->CL_Import_Ogre->Load_Skeleton(); // Load Ogre Model | |
417 | + //// | |
418 | + ////App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
419 | + | |
420 | + //App->CL_Model_Data->HasMesh = 0; | |
421 | + | |
422 | + //App->CL_Model_Data->ItsAnOgreModel = 1; | |
423 | + | |
424 | + //App->CL_Model_Data->Model_Loaded = 1; | |
425 | + | |
426 | + ////App->Cl_Grid->Zoom(); | |
427 | + | |
428 | + //App->CL_Dialogs->PleaseWaitEnd(); | |
429 | + | |
430 | + //App->CL_FileView->ChangeModelName(); | |
431 | + ////Set_Equity(); | |
432 | + | |
433 | + ////Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
434 | + ////Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
435 | + | |
436 | + return 1; | |
437 | +} | |
438 | + | |
439 | +// ************************************************************************* | |
440 | +// * Ogre_Loader Terry Bernie * | |
441 | +// ************************************************************************* | |
442 | +bool GD_Importer::Ogre_Loader(char* Extension,char* Extension2) | |
443 | +{ | |
444 | + //int Result = App->CL_FileIO->OpenFile(Extension,Extension2,NULL); | |
445 | + //if (Result == 0) | |
446 | + //{ | |
447 | + // return 1; | |
448 | + //} | |
449 | + | |
450 | + //App->Cl_Ogre->Loading_Text("Loading Please Wait",1); | |
451 | + | |
452 | + //Clear_Model(); | |
453 | + | |
454 | + //App->CL_Model_Data->Set_Paths(); | |
455 | + | |
456 | + //// Just for Ogre3d | |
457 | + //strcpy(App->CL_Model_Data->JustName,App->CL_Model_Data->FileName); | |
458 | + //int Len=strlen(App->CL_Model_Data->JustName); | |
459 | + //App->CL_Model_Data->JustName[Len-5]=0; | |
460 | + // | |
461 | + | |
462 | + //App->CL_Import_Ogre->Load_OgreModel(); // Load Ogre Model | |
463 | + // | |
464 | + //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
465 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
466 | + | |
467 | + //App->CL_Model_Data->ItsAnOgreModel = 1; | |
468 | + | |
469 | + //App->CL_Model_Data->Model_Loaded = 1; | |
470 | + | |
471 | + //App->Cl_Grid->Zoom(); | |
472 | + | |
473 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
474 | + | |
475 | + //Set_Equity(); | |
476 | + | |
477 | + //Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
478 | + //Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
479 | + | |
480 | + ////------------------------------- | |
481 | + //if (App->CL_Import_Ogre->NoMaterialFileFound == 1) | |
482 | + //{ | |
483 | + // App->CL_Dialogs->YesNo("No Textures","Do you want to load an Ogre Config File now"); | |
484 | + // bool Doit = App->CL_Dialogs->Canceled; | |
485 | + // if (Doit == 0) | |
486 | + // { | |
487 | + // /*char LookBuf[1024]; | |
488 | + // strcpy(LookBuf,App->CL_Model_Data->Model_FullPath); | |
489 | + | |
490 | + // int test = App->CL_FileIO->SearchFolders(LookBuf,"resources.cfg"); | |
491 | + // if (test == 1)*/ | |
492 | + // { | |
493 | + // App->Cl_Importer->Ogre_ResourceFile_Loader("Ogre Config *.cfg\0*.cfg\0","Ogre Config"); | |
494 | + // } | |
495 | + // } | |
496 | + // else | |
497 | + // { | |
498 | + // return 1; | |
499 | + // } | |
500 | + //} | |
501 | + | |
502 | + return 1; | |
503 | +} | |
504 | + | |
505 | +// ************************************************************************* | |
506 | +// * Ogre_ResourceFile_Loader Terry Bernie * | |
507 | +// ************************************************************************* | |
508 | +bool GD_Importer::Ogre_ResourceFile_Loader(char* Extension,char* Extension2) | |
509 | +{ | |
510 | + /*int Result = App->CL_FileIO->Open_ResourceFile("Ogre Config *.cfg\0*.cfg\0","Ogre Config",App->CL_Model_Data->Path_FileName); | |
511 | + if (Result == 0) | |
512 | + { | |
513 | + return 1; | |
514 | + } | |
515 | + | |
516 | + App->CL_Import_Ogre->loadUserResources(App->CL_FileIO->Model_Path_FileName); | |
517 | + | |
518 | + if( App->Cl_Ogre->OgreModel_Ent ) | |
519 | + { | |
520 | + App->CL_Import_Ogre->Ogre_Reload(); | |
521 | + }*/ | |
522 | + | |
523 | + return 1; | |
524 | +} | |
525 | + | |
526 | +// ************************************************************************* | |
527 | +// * Reload_FromResentFiles Terry Bernie * | |
528 | +// ************************************************************************* | |
529 | +void GD_Importer::Reload_FromResentFiles(char* ResentPathAndFile) | |
530 | +{ | |
531 | + | |
532 | + //// Check Recent File Exsists | |
533 | + //bool Result = App->CL_FileIO->Search_For_Folder(ResentPathAndFile); | |
534 | + //if (Result == 0) | |
535 | + //{ | |
536 | + // App->CL_Dialogs->Message_Long(" Can Not Find File:- This may be due to it has been deleted or renamed"); | |
537 | + // return; | |
538 | + //} | |
539 | + | |
540 | + | |
541 | + //App->Cl_Ogre->Loading_Text("Loading Data",1); | |
542 | + | |
543 | + //Clear_Model(); | |
544 | + | |
545 | + //strcpy(App->CL_FileIO->Model_Path_FileName,ResentPathAndFile); | |
546 | + | |
547 | + //char mPathAndFile[1024]; | |
548 | + //char mJustFileName[1024]; | |
549 | + | |
550 | + //strcpy(mPathAndFile,ResentPathAndFile); // Full Path and File | |
551 | + | |
552 | + //CheckPath(mPathAndFile,mPathAndFile); | |
553 | + //strcpy(mJustFileName,JustFileName); // Just File Name | |
554 | + | |
555 | + //strcpy(App->CL_FileIO->Model_FileName,mJustFileName); | |
556 | + | |
557 | + //App->CL_Model_Data->Set_Paths(); | |
558 | + | |
559 | + ////_chdir(App->CL_Model_Data->Model_FullPath); | |
560 | + // | |
561 | + ////--------------------------------------------------------------- Genesis Actor | |
562 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-4,".act") == 0) | |
563 | + //{ | |
564 | + // App->CL_Genesis_Import->LoadActor(); | |
565 | + | |
566 | + // App->CL_Model_Data->Model_Type = LoadedFile_Actor; | |
567 | + | |
568 | + // App->CL_Model_Data->Model_Loaded = 1; | |
569 | + | |
570 | + // App->Cl_Grid->Zoom(); | |
571 | + // App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
572 | + // Set_Equity(); | |
573 | + // return; | |
574 | + //} | |
575 | + | |
576 | + ////--------------------------------------------------------------- Genesis Actor | |
577 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-4,".bdy") == 0) | |
578 | + //{ | |
579 | + // App->CL_Genesis_Import->LoadBody(); | |
580 | + | |
581 | + // App->CL_Model_Data->Model_Type = LoadedFile_Actor; | |
582 | + | |
583 | + // App->CL_Model_Data->Model_Loaded = 1; | |
584 | + | |
585 | + // App->Cl_Grid->Zoom(); | |
586 | + // App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
587 | + // Set_Equity(); | |
588 | + // return; | |
589 | + //} | |
590 | + | |
591 | + ////--------------------------------------------------------------- Orge3D Model | |
592 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-5,".mesh") == 0) | |
593 | + //{ | |
594 | + // App->CL_Import_Ogre->Load_OgreModel(); // Load Ogre Model | |
595 | + | |
596 | + // // Just for Ogre3d | |
597 | + // strcpy(App->CL_Model_Data->JustName,App->CL_Model_Data->FileName); | |
598 | + // int Len=strlen(App->CL_Model_Data->JustName); | |
599 | + // App->CL_Model_Data->JustName[Len-5]=0; | |
600 | + | |
601 | + // App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
602 | + // App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
603 | + | |
604 | + // App->CL_Model_Data->ItsAnOgreModel = 1; | |
605 | + | |
606 | + // App->CL_Model_Data->Model_Loaded = 1; | |
607 | + // App->Cl_Grid->Zoom(); | |
608 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
609 | + // App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
610 | + // Set_Equity(); | |
611 | + | |
612 | + // Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
613 | + // Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
614 | + | |
615 | + // //------------------------------- | |
616 | + // if (App->CL_Import_Ogre->NoMaterialFileFound == 1) | |
617 | + // { | |
618 | + // App->CL_Dialogs->YesNo("No Textures","Do you want to load an Ogre Config File now"); | |
619 | + // bool Doit = App->CL_Dialogs->Canceled; | |
620 | + // if (Doit == 0) | |
621 | + // { | |
622 | + // /*char LookBuf[1024]; | |
623 | + // strcpy(LookBuf,App->CL_Model_Data->Model_FullPath); | |
624 | + | |
625 | + // int test = App->CL_FileIO->SearchFolders(LookBuf,"resources.cfg"); | |
626 | + // if (test == 1)*/ | |
627 | + // { | |
628 | + // App->Cl_Importer->Ogre_ResourceFile_Loader("Ogre Config *.cfg\0*.cfg\0","Ogre Config"); | |
629 | + // } | |
630 | + // } | |
631 | + // else | |
632 | + // { | |
633 | + // return ; | |
634 | + // } | |
635 | + // } | |
636 | + // | |
637 | + // return; | |
638 | + //} | |
639 | + | |
640 | + ////--------------------------------------------------------------- Orge3D Model | |
641 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-9,".skeleton") == 0) | |
642 | + //{ | |
643 | + // App->CL_Import_Ogre->Load_Skeleton(); // Load Ogre Model | |
644 | + | |
645 | + // //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
646 | + | |
647 | + // App->CL_Model_Data->HasMesh = 0; | |
648 | + // App->CL_Model_Data->ItsAnOgreModel = 1; | |
649 | + // App->CL_Model_Data->Model_Loaded = 1; | |
650 | + | |
651 | + // //App->Cl_Grid->Zoom()*/; | |
652 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
653 | + // App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
654 | + // //Set_Equity(); | |
655 | + | |
656 | + // Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
657 | + // Ogre::Root::getSingletonPtr()->renderOneFrame(); | |
658 | + | |
659 | + // return; | |
660 | + //} | |
661 | + | |
662 | + //// Default Assimp Loader | |
663 | + //App->CL_Assimp = new Eq_Assimp(); | |
664 | + | |
665 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-5,".ms3d") == 0) | |
666 | + //{ | |
667 | + // App->CL_Assimp->SelectedPreset = 8 + 8388608+64; | |
668 | + //} | |
669 | + //else | |
670 | + //{ | |
671 | + // App->CL_Assimp->SelectedPreset = 8 + 8388608+64+aiProcess_PreTransformVertices; | |
672 | + //} | |
673 | + | |
674 | + //bool Test = App->CL_Assimp->LoadFile(ResentPathAndFile); | |
675 | + //if (Test == 0) | |
676 | + //{ | |
677 | + // //App->CL_Dialogs->PleaseWaitEnd(); | |
678 | + // return; | |
679 | + //} | |
680 | + // | |
681 | + //App->CL_Model_Data->Model_Type = LoadedFile_Assimp; | |
682 | + //App->CL_Model_Data->Render_Mode = Render_As_Assimp; | |
683 | + //App->CL_Model_Data->Model_Loaded = 1; | |
684 | + //App->Cl_Grid->Zoom(); | |
685 | + | |
686 | + //App->Cl_Ogre->Loading_Text("Loading Finished",0); | |
687 | + //Set_Equity(); | |
688 | + | |
689 | + //if (stricmp(mJustFileName+strlen(mJustFileName)-4,".stl") == 0) | |
690 | + //{ | |
691 | + // App->CL_ToolBar->Set_LightsOn(true); | |
692 | + //} | |
693 | + | |
694 | + //if (App->CL_Assimp) | |
695 | + //{ | |
696 | + // delete App->CL_Assimp; | |
697 | + // App->CL_Assimp = NULL; | |
698 | + //} | |
699 | +} | |
700 | + | |
701 | +// ************************************************************************* | |
702 | +// * Set_Equity Terry Bernie * | |
703 | +// ************************************************************************* | |
704 | +void GD_Importer::Set_Equity(void) | |
705 | +{ | |
706 | + //App->CL_FileView->ChangeModelName(); | |
707 | + //App->CL_FileView->ExpandRoot(); | |
708 | + | |
709 | + //App->CL_ToolBar->Set_TexturesOn(true); | |
710 | + | |
711 | + //App->CL_Right_Groups->Update_Dialog(0); | |
712 | + | |
713 | + //SetDlgItemText(App->ModelGlobal_Hwnd,IDC_STMODELNAME,(LPCTSTR)App->CL_Model_Data->FileName); | |
714 | + | |
715 | + ////----------------------------------------- | |
716 | + //char buf[10]; | |
717 | + //itoa(App->CL_Model_Data->VertCount,buf,10); | |
718 | + //SetDlgItemText(App->ModelGlobal_Hwnd,IDC_NUMVERTICECOUNT,(LPCTSTR)buf); | |
719 | + | |
720 | + //itoa(App->CL_Model_Data->FaceCount,buf,10); | |
721 | + //SetDlgItemText(App->ModelGlobal_Hwnd,IDC_NUFACECOUNT2,(LPCTSTR)buf); | |
722 | + | |
723 | + //itoa(App->CL_Model_Data->GroupCount,buf,10); | |
724 | + //SetDlgItemText(App->ModelGlobal_Hwnd,IDC_NUMGROUPS,(LPCTSTR)buf); | |
725 | + //ShowWindow(App->RightGroups_Hwnd,0); | |
726 | + | |
727 | + //itoa(App->CL_Model_Data->MotionCount,buf,10); | |
728 | + //SetDlgItemText(App->ModelGlobal_Hwnd,IDC_NUMMOTIONS,(LPCTSTR)buf); | |
729 | + ////----------------------------------------- | |
730 | + | |
731 | + //ShowWindow(App->ModelGlobal_Hwnd,1); | |
732 | + //App->CL_Global_Model->GlobalModel_Active = 1; | |
733 | + //App->Cl_Panels->Place_GlobalGroups(); | |
734 | + //CheckMenuItem(App->mMenu,ID_WINDOW_SHOWMODELGLBAL,MF_BYCOMMAND |MF_CHECKED); | |
735 | + | |
736 | + ////----------------------------------------- Motions Panel | |
737 | + ///*if (App->CL_Model_Data->Model_Type == LoadedFile_Actor && App->CL_Model_Data->MotionCount > 0) | |
738 | + //{ | |
739 | + // SetDlgItemText(App->CentralView_Hwnd,IDC_STMOTIONNAME,App->CL_Genesis_Import->MotionName); | |
740 | + | |
741 | + // App->CL_Motions->MotionsDialog_Active = 1; | |
742 | + // App->Cl_Panels->MoveCentralView(); | |
743 | + // ShowWindow(App->CentralView_Hwnd, 1); | |
744 | + // CheckMenuItem(App->mMenu,ID_WINDOW_SHOWMOTIONSPANEL,MF_BYCOMMAND |MF_CHECKED); | |
745 | + //}*/ | |
746 | + | |
747 | + //int Count = 0; | |
748 | + //while (Count < App->CL_Model_Data->GroupCount) | |
749 | + //{ | |
750 | + // App->CL_FileView->Add_MeshFile(App->CL_Model_Data->S_MeshGroup[Count]->GroupName,Count); | |
751 | + // App->CL_FileView->Add_FaceFile(App->CL_Model_Data->S_MeshGroup[Count]->GroupName,Count); | |
752 | + // App->CL_FileView->Add_TextureCordFile(App->CL_Model_Data->S_MeshGroup[Count]->GroupName,Count); | |
753 | + // App->CL_FileView->Add_NormalsFile(App->CL_Model_Data->S_MeshGroup[Count]->GroupName,Count); | |
754 | + // Count++; | |
755 | + //} | |
756 | + | |
757 | + //App->CL_FileView->Set_FolderActive(App->CL_FileView->HT_MeshFolder); | |
758 | + //App->CL_FileView->Set_FolderActive(App->CL_FileView->HT_PolygonsFolder); | |
759 | + //App->CL_FileView->Set_FolderActive(App->CL_FileView->HT_UVFolder); | |
760 | + //App->CL_FileView->Set_FolderActive(App->CL_FileView->HT_NormalsFolder); | |
761 | + | |
762 | + // //if (App->CL_Model_Data->ItsAnOgreModel == 1) | |
763 | + // //{ | |
764 | + // // App->CL_Global_Model->Block_Buttons_GM = 1; | |
765 | + // // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELSCALE),0); | |
766 | + // // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELPOSITION),0); | |
767 | + // // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELROTATION),0); | |
768 | + // //} | |
769 | + ///*if(App->CL_Model_Data->Model_Type == LoadedFile_Actor) | |
770 | + //{ | |
771 | + // App->CL_Global_Model->Block_Buttons_GM = 1; | |
772 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELSCALE),0); | |
773 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELPOSITION),0); | |
774 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELROTATION),0); | |
775 | + // | |
776 | + //} | |
777 | + //else*/ | |
778 | + //{ | |
779 | + // App->CL_Global_Model->Block_Buttons_GM = 0; | |
780 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELSCALE),1); | |
781 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELPOSITION),1); | |
782 | + // EnableWindow(GetDlgItem(App->ModelGlobal_Hwnd,IDC_MODELROTATION),1); | |
783 | + // | |
784 | + //} | |
785 | +} | |
786 | + | |
787 | +// ************************************************************************* | |
788 | +// * Clear_Model Terry Bernie * | |
789 | +// ************************************************************************* | |
790 | +void GD_Importer::Clear_Model(void) | |
791 | +{ | |
792 | + //App->CL_Model_Data->Model_Loaded = 0; | |
793 | + //App->CL_Model_Data->ItsAnOgreModel = 0; | |
794 | + | |
795 | + //App->CL_Right_Groups->Sel_BaseBitmap = NULL; | |
796 | + | |
797 | + //ShowWindow(App->RightGroups_Hwnd,0); | |
798 | + //SetWindowPos(App->RightGroups_Hwnd,NULL,920,125, 0,0, SWP_NOSIZE); | |
799 | + | |
800 | + ///*if(App->Cl_Motion_Mgr->Motion_Mger_Active == 1) | |
801 | + //{ | |
802 | + // App->Cl_Motion_Mgr->End_DlgMotionMgr(); | |
803 | + //}*/ | |
804 | + | |
805 | + //App->CL_FileView->Clear_FileView(); // Reset Fileview to App Start | |
806 | + // | |
807 | + //App->CL_Model_Data->Clear_ModelData(); // Clear all model data and settings | |
808 | + // | |
809 | + //App->CL_ToolBar->Set_TexturesOn(false); | |
810 | + //App->CL_ToolBar->Set_LightsOn(false); | |
811 | + //App->CL_ToolBar->Set_FacesOn(false); | |
812 | + //App->CL_ToolBar->Set_PointsOn(false); | |
813 | + //App->CL_ToolBar->Set_NormalsOn(false); | |
814 | + //App->CL_ToolBar->Set_BoundingBoxOn(false); | |
815 | + //App->CL_ToolBar->Set_JointsOn(false); | |
816 | + | |
817 | + //App->Cl_Grid->Reset_View(); | |
818 | +} | |
819 | +// ************************************************************************* | |
820 | +// * Init_History() Terry Bernie * | |
821 | +// ************************************************************************* | |
822 | +void GD_Importer::Init_History() | |
823 | +{ | |
824 | + //char DirCheck[1024]; | |
825 | + //strcpy(DirCheck,App->UserData_Folder); | |
826 | + //strcat(DirCheck,"\\"); | |
827 | + //strcat(DirCheck,"Inflanite"); | |
828 | + | |
829 | + //bool check = 0; | |
830 | + //check = App->CL_FileIO->Search_For_Folder(DirCheck); | |
831 | + //if (check == 0) | |
832 | + //{ | |
833 | + // mPreviousFiles.resize(EQUITY_NUM_RECENT_FILES); | |
834 | + | |
835 | + // CreateDirectory(DirCheck,NULL); | |
836 | + // ResentHistory_Clear(); // Set all slots to Empty | |
837 | + // Save_FileHistory(); | |
838 | + // LoadHistory(); | |
839 | + //} | |
840 | + //else | |
841 | + //{ | |
842 | + // LoadHistory(); | |
843 | + //} | |
844 | +} | |
845 | +// ************************************************************************* | |
846 | +// * LoadHistory() Terry Bernie * | |
847 | +// ************************************************************************* | |
848 | +void GD_Importer::LoadHistory() | |
849 | +{ | |
850 | + //mPreviousFiles.resize(EQUITY_NUM_RECENT_FILES); | |
851 | + | |
852 | + //char buffer[1024]; | |
853 | + //char buf[1024]; | |
854 | + | |
855 | + //strcpy(buf,App->UserData_Folder); | |
856 | + //strcat(buf,"\\Inflanite\\RecentFiles.ini"); | |
857 | + // | |
858 | + //ReadRecentFiles = fopen(buf,"rt"); | |
859 | + | |
860 | + //if(!ReadRecentFiles) | |
861 | + //{ | |
862 | + // App->Say("Cant Find Recent Files"); | |
863 | + // return; | |
864 | + //} | |
865 | + | |
866 | + //// Read in File Names from RecentFiles.ini | |
867 | + //for (unsigned int i = 0; i < EQUITY_NUM_RECENT_FILES;++i) | |
868 | + //{ | |
869 | + // memset(buffer,0,1024); | |
870 | + // fgets(buffer,1024,ReadRecentFiles); | |
871 | + | |
872 | + // char Path[1024]; | |
873 | + // strcpy(Path,buffer); | |
874 | + // int Len = strlen(Path); | |
875 | + // Path[Len-1]=0; | |
876 | + | |
877 | + // mPreviousFiles[i] = std::string(Path); | |
878 | + //} | |
879 | + | |
880 | + //fclose(ReadRecentFiles); | |
881 | + | |
882 | + //mHistoryMenu = CreateMenu(); | |
883 | + | |
884 | + //// Check for empty slots and gray out | |
885 | + //for (int i = EQUITY_NUM_RECENT_FILES-1; i >= 0;--i) | |
886 | + //{ | |
887 | + // char szText[1024]; | |
888 | + // strcpy(szText,mPreviousFiles[i].c_str()); | |
889 | + | |
890 | + // UINT iFlags = 0; | |
891 | + // int Result = 0; | |
892 | + // Result = strcmp("<empty>",szText); | |
893 | + // if (Result == 0) | |
894 | + // { | |
895 | + // iFlags = MF_GRAYED | MF_DISABLED; | |
896 | + // } | |
897 | + | |
898 | + // AppendMenu(mHistoryMenu,MF_STRING | iFlags,EQUITY_RECENT_FILE_ID(i),szText); | |
899 | + //} | |
900 | + | |
901 | + //ModifyMenu(GetMenu(App->MainHwnd),ID_FILE_RECENTFILES,MF_BYCOMMAND | MF_POPUP, | |
902 | + // (UINT_PTR)mHistoryMenu,"Recent files"); | |
903 | + return; | |
904 | +} | |
905 | + | |
906 | +// ************************************************************************* | |
907 | +// * Save_FileHistory Terry Bernie * | |
908 | +// ************************************************************************* | |
909 | +void GD_Importer::Save_FileHistory() | |
910 | +{ | |
911 | + | |
912 | +// WriteRecentFiles = 0; | |
913 | + | |
914 | + //char buf[1024]; | |
915 | + //strcpy(buf,App->UserData_Folder); | |
916 | + //strcat(buf,"\\Inflanite\\RecentFiles.ini"); | |
917 | + // | |
918 | + | |
919 | + //WriteRecentFiles = fopen(buf,"wt"); | |
920 | + | |
921 | + //if(!WriteRecentFiles) | |
922 | + //{ | |
923 | + // App->Say("Why Cant Find Recent Files"); | |
924 | + // return; | |
925 | + //} | |
926 | + | |
927 | + //// Save out to RecentFile.ini | |
928 | + //for (unsigned int i = 0; i < EQUITY_NUM_RECENT_FILES;++i) | |
929 | + //{ | |
930 | + // char szName[1024]; | |
931 | + // strcpy(szName,mPreviousFiles[i].c_str()); | |
932 | + | |
933 | + // fprintf(WriteRecentFiles, "%s\n",szName); | |
934 | + //} | |
935 | + | |
936 | + //fclose(WriteRecentFiles); | |
937 | + return; | |
938 | +} | |
939 | +// ************************************************************************* | |
940 | +// * RecentFileHistory_Update Terry Bernie * | |
941 | +// ************************************************************************* | |
942 | +void GD_Importer::RecentFileHistory_Update() | |
943 | +{ | |
944 | + //if(!mHistoryMenu)return; | |
945 | + | |
946 | + //std::string sz = std::string(App->CL_Model_Data->Path_FileName); | |
947 | + //if (mPreviousFiles[EQUITY_NUM_RECENT_FILES-1] == sz)return; | |
948 | + | |
949 | + //// add the new file to the list of recent files | |
950 | + //for (unsigned int i = 0; i < EQUITY_NUM_RECENT_FILES-1;++i) | |
951 | + //{ | |
952 | + // mPreviousFiles[i] = mPreviousFiles[i+1]; | |
953 | + //} | |
954 | + | |
955 | + //mPreviousFiles[EQUITY_NUM_RECENT_FILES-1] = sz; | |
956 | + | |
957 | + //// Check for empty slots and gray out | |
958 | + //for (int i = EQUITY_NUM_RECENT_FILES-1; i >= 0;--i) | |
959 | + //{ | |
960 | + // char szText[1024]; | |
961 | + // strcpy(szText,mPreviousFiles[i].c_str()); | |
962 | + | |
963 | + // UINT iFlags = 0; | |
964 | + // int Result = 0; | |
965 | + // Result = strcmp("<empty>",szText); | |
966 | + // if (Result == 0) | |
967 | + // { | |
968 | + // iFlags = MF_GRAYED | MF_DISABLED; | |
969 | + // } | |
970 | + | |
971 | + // ModifyMenu(mHistoryMenu,EQUITY_RECENT_FILE_ID(i), | |
972 | + // MF_STRING | MF_BYCOMMAND | iFlags,EQUITY_RECENT_FILE_ID(i),szText); | |
973 | + //} | |
974 | + | |
975 | + //// Save Changes | |
976 | + //Save_FileHistory(); | |
977 | + | |
978 | + return; | |
979 | +} | |
980 | +// ************************************************************************* | |
981 | +// * ResentHistory_Clear Terry Bernie Hazel Nathan * | |
982 | +// ************************************************************************* | |
983 | +void GD_Importer::ResentHistory_Clear() | |
984 | +{ | |
985 | + //App->CL_Dialogs->YesNo("Delete file history.","Are you sure all File history will be Deleted Procede."); | |
986 | + //if (App->CL_Dialogs->Canceled == 1) | |
987 | + //{ | |
988 | + // return; | |
989 | + //} | |
990 | + | |
991 | + //// Set all slots to <empty> | |
992 | + //for(unsigned int i = 0; i < EQUITY_NUM_RECENT_FILES;++i) | |
993 | + //{ | |
994 | + // mPreviousFiles[i] = std::string("<empty>"); | |
995 | + //} | |
996 | + | |
997 | + //// Repopulate Menu system | |
998 | + //for (int i = EQUITY_NUM_RECENT_FILES-1; i >= 0;--i) | |
999 | + //{ | |
1000 | + // ModifyMenu(mHistoryMenu,EQUITY_RECENT_FILE_ID(i), | |
1001 | + // MF_STRING | MF_BYCOMMAND | MF_GRAYED | MF_DISABLED,EQUITY_RECENT_FILE_ID(i),"<empty>"); | |
1002 | + //} | |
1003 | + | |
1004 | + //// Save Changes | |
1005 | + //Save_FileHistory(); | |
1006 | +} | |
1007 | + | |
1008 | +// ************************************************************************* | |
1009 | +// * CheckPath Terry Bernie * | |
1010 | +// ************************************************************************* | |
1011 | +void GD_Importer::CheckPath(char *pString,char *FileName) | |
1012 | +{ | |
1013 | + int Count=0; | |
1014 | + int Mark=0; | |
1015 | + bool Test = 0; | |
1016 | + | |
1017 | + while(*pString != 0) | |
1018 | + { | |
1019 | + if(*pString == '\\' || *pString == '/') | |
1020 | + { | |
1021 | + Test = 1; | |
1022 | + Mark = Count; | |
1023 | + } | |
1024 | + | |
1025 | + Count++; | |
1026 | + pString++; | |
1027 | + } | |
1028 | + | |
1029 | + if (Mark == 0 && Test == 0) | |
1030 | + { | |
1031 | + strcpy(JustFileName,FileName); | |
1032 | + } | |
1033 | + else | |
1034 | + { | |
1035 | + if (Mark == 0 && Test == 1) | |
1036 | + { | |
1037 | + Mark = 1; | |
1038 | + strcpy(JustFileName,(FileName+Mark)); | |
1039 | + } | |
1040 | + else | |
1041 | + { | |
1042 | + strcpy(JustFileName,(FileName+Mark)+1); | |
1043 | + } | |
1044 | + } | |
1045 | +} | |
\ No newline at end of file |
@@ -0,0 +1,80 @@ | ||
1 | +/* | |
2 | + Copyright (c) Equity10 2016 HGT Software W.T.Flanigan B.Parkin H.C.Flanigan | |
3 | + | |
4 | + This software is provided 'as-is', without any express or implied | |
5 | + warranty. In no event will the authors be held liable for any damages | |
6 | + arising from the use of this software. | |
7 | + | |
8 | + Permission is granted to anyone to use this software for any purpose, | |
9 | + including commercial applications, and to alter it and redistribute it | |
10 | + freely, subject to the following restrictions: | |
11 | + | |
12 | + 1. The origin of this software must not be misrepresented; you must not | |
13 | + claim that you wrote the original software. If you use this software | |
14 | + in a product, an acknowledgment in the product documentation would be | |
15 | + appreciated but is not required. | |
16 | + | |
17 | + 2. Altered source versions must be plainly marked as such, and must not be | |
18 | + misrepresented as being the original software. | |
19 | + | |
20 | + 3. This notice may not be removed or altered from any source | |
21 | + distribution. | |
22 | +*/ | |
23 | + | |
24 | +#pragma once | |
25 | +class GD_Importer | |
26 | +{ | |
27 | +public: | |
28 | + GD_Importer(void); | |
29 | + ~GD_Importer(void); | |
30 | + | |
31 | + bool Test_obj_Loader(char* Extension,char* Extension2); | |
32 | + bool Assimp_Loader(char* Extension,char* Extension2); | |
33 | + bool Truespace_Loader(char* Extension,char* Extension2); | |
34 | + bool STL_Loader(char* Extension,char* Extension2); | |
35 | + | |
36 | + bool RFEditorPro_Loader(char* Extension, char* Extension2); | |
37 | + | |
38 | + bool RFActor_Loader(void); | |
39 | + bool RFActor_Body(void); | |
40 | + | |
41 | + bool Milk_Loader(bool UseWinDialogLoader); | |
42 | + | |
43 | + bool Ogre_Loader(char* Extension,char* Extension2); | |
44 | + bool Ogre_Skeleton(char* Extension,char* Extension2); | |
45 | + bool Ogre_ResourceFile_Loader(char* Extension,char* Extension2); | |
46 | + | |
47 | + void Reload_FromResentFiles(char* ResentPathAndFile); | |
48 | + | |
49 | + void Clear_Model(void); | |
50 | + | |
51 | + void Set_Equity(void); | |
52 | + | |
53 | + void Init_History(); | |
54 | + void LoadHistory(); | |
55 | + void Save_FileHistory(); | |
56 | + void RecentFileHistory_Update(); | |
57 | + void ResentHistory_Clear(); | |
58 | + | |
59 | + void CheckPath(char *pString,char *FileName); | |
60 | + char JustFileName[256]; | |
61 | + | |
62 | + bool Is_RFEditPro; | |
63 | + | |
64 | + long int DefaultPresets; | |
65 | + std::vector<std::string> mPreviousFiles; | |
66 | + | |
67 | +protected: | |
68 | + | |
69 | + bool Set_FlipWindingOrder; | |
70 | + bool Set_MakeLeftHanded; | |
71 | + bool Set_FlipUVs; | |
72 | + | |
73 | + FILE *WriteRecentFiles; | |
74 | + FILE *ReadRecentFiles; | |
75 | + | |
76 | + #define EQUITY_NUM_RECENT_FILES 0x8 | |
77 | + #define EQUITY_RECENT_FILE_ID(_n_) (5000 + _n_) | |
78 | + HMENU mHistoryMenu; | |
79 | +}; | |
80 | + |