• R/O
  • SSH
  • HTTPS

vima19: Commit


Commit MetaInfo

Revision763 (tree)
Time2022-08-14 22:25:01
Authorhgtterry

Log Message

Equity_SB 140822 New FileIO (WIP)

Change Summary

Incremental Difference

--- Anim19_OSDN/EB_Options.cpp (revision 762)
+++ Anim19_OSDN/EB_Options.cpp (revision 763)
@@ -300,7 +300,7 @@
300300
301301 case WM_COMMAND:
302302 {
303- if (LOWORD(wParam) == IDC_BTQLBROWSE)
303+ /*if (LOWORD(wParam) == IDC_BTQLBROWSE)
304304 {
305305 int Result = App->CL_Vm_FileIO->Vm_OpenFile("Model Files *.*\0*.*\0", "Model Files",NULL);
306306 if (Result == 0)
@@ -313,7 +313,7 @@
313313 SetDlgItemText(hDlg, IDC_STQLBOX, (LPCTSTR)App->EBC_Options->Quick_Load_File_Chr);
314314
315315 return TRUE;
316- }
316+ }*/
317317
318318 if (LOWORD(wParam) == IDCANCEL)
319319 {
--- Anim19_OSDN/GD19_OSDN.cpp (revision 762)
+++ Anim19_OSDN/GD19_OSDN.cpp (revision 763)
@@ -296,7 +296,7 @@
296296 // ------------------------------------------------------------
297297 case ID_OPEN_PROJECT:
298298 {
299- App->SBC_Import->Load_Scene("Project *.SBProj\0*.SBProj\0", "Project");
299+ App->SBC_Import->Load_Project("Project *.SBProj\0*.SBProj\0", "Project");
300300 return 1;
301301 }
302302
@@ -826,7 +826,7 @@
826826 //App->Cl_Load_Scene->OpenScene(true);
827827
828828 //App->SBC_Import->Bullet_Load_Room("Ogre3D *.mesh\0*.mesh\0", "Ogre3D");
829- App->SBC_Import->Load_Scene("Level *.SBLevel\0*.SBLevel\0", "Level");
829+ App->SBC_Import->Load_Project("Level *.SBLevel\0*.SBLevel\0", "Level");
830830 //strcpy(App->Cl_Vm_Preferences->Pref_Ogre_JustFileName, App->CL_Vm_Model->FileName);
831831 //strcpy(App->Cl_Vm_Preferences->Pref_Ogre_Path, App->CL_Vm_Model->Model_FolderPath);
832832
--- Anim19_OSDN/SB_FileIO.cpp (revision 762)
+++ Anim19_OSDN/SB_FileIO.cpp (revision 763)
@@ -1,12 +1,73 @@
1+/*
2+Copyright (c) 2021 Stage Builder and Equity -- Inflanite Software W.T.Flanigan 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+
124 #include "stdafx.h"
25+#include "GD19_App.h"
226 #include "SB_FileIO.h"
327
428
529 SB_FileIO::SB_FileIO()
630 {
31+ Project_File_Name[0] = 0;
32+ Project_Path_File_Name[0] = 0;
733 }
834
935
1036 SB_FileIO::~SB_FileIO()
1137 {
38+}
39+
40+// *************************************************************************
41+// * Open_Project_File Terry Flanigan *
42+// *************************************************************************
43+bool SB_FileIO::Open_Project_File(char* Extension, char* Title, char* StartDirectory)
44+{
45+ strcpy(Project_File_Name, "");
46+ strcpy(Project_Path_File_Name, "");
47+
48+ ZeroMemory(&ofn, sizeof(ofn));
49+ ofn.lStructSize = sizeof(ofn);
50+ ofn.hwndOwner = App->MainHwnd;
51+ ofn.hInstance = App->hInst;
52+ ofn.lpstrFile = Project_Path_File_Name; // full path and file name
53+ ofn.nMaxFile = sizeof(Project_Path_File_Name);
54+ ofn.lpstrFilter = Extension;
55+
56+ ofn.nFilterIndex = 1;
57+ ofn.lpstrFileTitle = Project_File_Name; // Just File Name
58+ ofn.nMaxFileTitle = sizeof(Project_File_Name);
59+ ofn.lpstrInitialDir = StartDirectory;
60+ ofn.lpstrTitle = Title;
61+ ofn.Flags = OFN_PATHMUSTEXIST |
62+ OFN_FILEMUSTEXIST |
63+ OFN_EXPLORER |
64+ OFN_HIDEREADONLY |
65+ OFN_FILEMUSTEXIST;
66+
67+ if (GetOpenFileName(&ofn) == TRUE)
68+ {
69+ return 1;
70+ }
71+
72+ return 0;
1273 }
\ No newline at end of file
--- Anim19_OSDN/SB_FileIO.h (revision 762)
+++ Anim19_OSDN/SB_FileIO.h (revision 763)
@@ -1,3 +1,26 @@
1+/*
2+Copyright (c) 2021 Stage Builder and Equity -- Inflanite Software W.T.Flanigan 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+
124 #pragma once
225 class SB_FileIO
326 {
@@ -5,7 +28,12 @@
528 SB_FileIO();
629 ~SB_FileIO();
730
31+ bool Open_Project_File(char* Extension, char* Title, char* StartDirectory);
832
33+ char Project_File_Name[MAX_PATH];
34+ char Project_Path_File_Name[MAX_PATH];
935
36+
37+ OPENFILENAME ofn;
1038 };
1139
--- Anim19_OSDN/SB_Import.cpp (revision 762)
+++ Anim19_OSDN/SB_Import.cpp (revision 763)
@@ -36,67 +36,34 @@
3636 }
3737
3838 // *************************************************************************
39-// * Assimp_Loader Terry Bernie *
39+// * Load_Project Terry Flanigan *
4040 // *************************************************************************
41-bool SB_Import::Assimp_Loader(char* Extension, char* Extension2)
41+bool SB_Import::Load_Project(char* Extension, char* Extension2)
4242 {
43-
44- return 1;
45-}
4643
47-// *************************************************************************
48-// * WorldEditor_Loader Terry Terry Berine *
49-// *************************************************************************
50-bool SB_Import::WorldEditor_Loader(void)
51-{
52-
53- return 1;
54-}
44+ int Result = App->SBC_FileIO->Open_Project_File(Extension, Extension2, NULL);
45+ if (Result == 0)
46+ {
47+ return 1;
48+ }
5549
56-// *************************************************************************
57-// * Genesis3D Terry Terry Berine *
58-// *************************************************************************
59-bool SB_Import::Genesis3D_Loader(void)
60-{
50+ App->SBC_Project->Load_Project();
6151
62-
63-
52+ App->Say("Scene Loaded");
6453 return 1;
6554 }
6655
6756 // *************************************************************************
68-// * Ogre_Loader Terry Bernie *
69-// *************************************************************************
70-bool SB_Import::Ogre_Loader(char* Extension, char* Extension2)
71-{
72-
73-
74- return 1;
75-}
76-
77-// *************************************************************************
7857 // * Room_Loader Terry Bernie *
7958 // *************************************************************************
8059 bool SB_Import::Room_Loader(char* Extension, char* Extension2)
8160 {
82- int Result = App->CL_Vm_FileIO->Vm_OpenFile(Extension, Extension2, NULL);
61+ int Result = App->SBC_FileIO->Open_Project_File(Extension, Extension2, NULL);
8362 if (Result == 0)
8463 {
8564 return 1;
8665 }
8766
88- //App->EBC_Model->Clear_ModelData();
89-
90- //App->CL_Vm_Model->Set_Paths();
91-
92-
93- //App->CL_Ogre_Import_E15->Load_OgreModel(); // Load Ogre Model
94-
95- //App->CL_Vm_Model->Model_Type = LoadedFile_Assimp;
96-
97- //App->SBC_Equity->Set_Equity();
98-
99- //App->Say("Model Loaded");
10067 return 1;
10168 }
10269
@@ -115,7 +82,7 @@
11582 }
11683
11784
118- strcpy(App->CL_Vm_FileIO->Model_Path_FileName, ResentPathAndFile);
85+ strcpy(App->SBC_FileIO->Project_Path_File_Name, ResentPathAndFile);
11986
12087 char mPathAndFile[1024];
12188 char mJustFileName[1024];
@@ -125,7 +92,7 @@
12592 App->CL_Vm_FileIO->CheckPath(mPathAndFile, mPathAndFile);
12693 strcpy(mJustFileName, App->CL_Vm_FileIO->JustFileName); // Just File Name
12794
128- strcpy(App->CL_Vm_FileIO->Model_FileName, mJustFileName);
95+ strcpy(App->SBC_FileIO->Project_File_Name, mJustFileName);
12996
13097
13198
@@ -142,22 +109,3 @@
142109
143110 }
144111
145-
146-
147-// *************************************************************************
148-// * Load_Scene Terry Flanigan *
149-// *************************************************************************
150-bool SB_Import::Load_Scene(char* Extension, char* Extension2)
151-{
152-
153- int Result = App->CL_Vm_FileIO->Vm_OpenFile(Extension, Extension2, NULL);
154- if (Result == 0)
155- {
156- return 1;
157- }
158-
159- App->SBC_Project->Load_Project();
160-
161- App->Say("Scene Loaded");
162- return 1;
163-}
--- Anim19_OSDN/SB_Import.h (revision 762)
+++ Anim19_OSDN/SB_Import.h (revision 763)
@@ -28,12 +28,8 @@
2828 SB_Import();
2929 ~SB_Import();
3030
31- bool Assimp_Loader(char* Extension, char* Extension2);
32- bool Genesis3D_Loader(void);
33- bool WorldEditor_Loader(void);
34- bool Ogre_Loader(char* Extension, char* Extension2);
3531 bool Room_Loader(char* Extension, char* Extension2);
36- bool Load_Scene(char* Extension, char* Extension2);
32+ bool Load_Project(char* Extension, char* Extension2);
3733
3834 void Reload_FromResentFiles(char* ResentPathAndFile);
3935 };
--- Anim19_OSDN/SB_Project.cpp (revision 762)
+++ Anim19_OSDN/SB_Project.cpp (revision 763)
@@ -339,7 +339,7 @@
339339 App->SBC_FileView->Change_Level_Name();
340340 App->SBC_FileView->Change_Project_Name();
341341
342- App->Set_Main_TitleBar(App->CL_Vm_FileIO->Model_Path_FileName);
342+ App->Set_Main_TitleBar(App->SBC_FileIO->Project_Path_File_Name);
343343
344344 App->Say("Scene Created");
345345 return 1;
@@ -591,11 +591,11 @@
591591 // *************************************************************************
592592 void SB_Project::Set_Paths()
593593 {
594- strcpy(m_Level_File_Name, App->CL_Vm_FileIO->Model_FileName);
595- strcpy(m_Project_Sub_Folder, App->CL_Vm_FileIO->Model_Path_FileName);
596- strcpy(m_Ini_Path_File_Name, App->CL_Vm_FileIO->Model_Path_FileName);
594+ strcpy(m_Level_File_Name, App->SBC_FileIO->Project_File_Name);
595+ strcpy(m_Project_Sub_Folder, App->SBC_FileIO->Project_Path_File_Name);
596+ strcpy(m_Ini_Path_File_Name, App->SBC_FileIO->Project_Path_File_Name);
597597
598- strcpy(m_Level_Folder_Path, App->CL_Vm_FileIO->Model_Path_FileName);
598+ strcpy(m_Level_Folder_Path, App->SBC_FileIO->Project_Path_File_Name);
599599
600600 // Get path no file
601601 int len1 = strlen(m_Level_File_Name);
@@ -709,7 +709,7 @@
709709
710710 delete Options;
711711
712- App->Set_Main_TitleBar(App->CL_Vm_FileIO->Model_Path_FileName);
712+ App->Set_Main_TitleBar(App->SBC_FileIO->Project_Path_File_Name);
713713 App->CL_Vm_FileIO->RecentFileHistory_Update();
714714 return 1;
715715 }
--- Anim19_OSDN/SB_TopTabs.cpp (revision 762)
+++ Anim19_OSDN/SB_TopTabs.cpp (revision 763)
@@ -1030,7 +1030,7 @@
10301030 if (LOWORD(wParam) == IDC_TBBTLOAD)
10311031 {
10321032
1033- App->SBC_Import->Load_Scene("Level *.SBLevel\0*.SBLevel\0", "Level");
1033+ App->SBC_Import->Load_Project("Level *.SBLevel\0*.SBLevel\0", "Level");
10341034 return TRUE;
10351035 }
10361036
--- Anim19_OSDN/VM_FileIO.cpp (revision 762)
+++ Anim19_OSDN/VM_FileIO.cpp (revision 763)
@@ -14,8 +14,6 @@
1414 Scene_FileName[0] = 0;
1515 Scene_Path_FileName[0] = 0;
1616
17- Model_FileName[0] = 0;
18- Model_Path_FileName[0] = 0;
1917 JustFileName[0] = 0;
2018
2119 Cannceled = 0;
@@ -26,40 +24,7 @@
2624 {
2725 }
2826
29-// *************************************************************************
30-// * Vm_OpenFile Terry Bernie *
31-// *************************************************************************
32-bool VM_FileIO::Vm_OpenFile(char* Extension, char* Title, char* StartDirectory)
33-{
34- strcpy(Model_FileName, "");
35- strcpy(Model_Path_FileName, "");
3627
37- ZeroMemory(&ofn, sizeof(ofn));
38- ofn.lStructSize = sizeof(ofn);
39- ofn.hwndOwner = App->MainHwnd;
40- ofn.hInstance = App->hInst;
41- ofn.lpstrFile = Model_Path_FileName; // full path and file name
42- ofn.nMaxFile = sizeof(Model_Path_FileName);
43- ofn.lpstrFilter = Extension;
44-
45- ofn.nFilterIndex = 1;
46- ofn.lpstrFileTitle = Model_FileName; // Just File Name
47- ofn.nMaxFileTitle = sizeof(Model_FileName);;
48- ofn.lpstrInitialDir = StartDirectory;
49- ofn.lpstrTitle = Title;
50- ofn.Flags = OFN_PATHMUSTEXIST |
51- OFN_FILEMUSTEXIST |
52- OFN_EXPLORER |
53- OFN_HIDEREADONLY |
54- OFN_FILEMUSTEXIST;
55-
56- if (GetOpenFileName(&ofn) == TRUE)
57- {
58- return 1;
59- }
60- return 0;
61-}
62-
6328 // *************************************************************************
6429 // * OpenFile Terry Bernie *
6530 // *************************************************************************
@@ -428,7 +393,7 @@
428393 {
429394 if (!mHistoryMenu)return;
430395
431- std::string sz = std::string(App->CL_Vm_FileIO->Model_Path_FileName);
396+ std::string sz = std::string(App->SBC_FileIO->Project_Path_File_Name);
432397 if (mPreviousFiles[EQUITY_NUM_RECENT_FILES - 1] == sz)return;
433398
434399 // add the new file to the list of recent files
--- Anim19_OSDN/VM_FileIO.h (revision 762)
+++ Anim19_OSDN/VM_FileIO.h (revision 763)
@@ -5,7 +5,6 @@
55 VM_FileIO();
66 ~VM_FileIO();
77
8- bool Vm_OpenFile(char* Extension, char* Title, char* StartDirectory);
98 bool OpenTextureFile(char* Title, char* StartDirectory, bool SaveLocation);
109
1110 bool OpenFile(char* Extension, char* Title, char* StartDirectory);
@@ -40,9 +39,6 @@
4039 char Scene_FileName[255];
4140 char Scene_Path_FileName[1024];
4241
43- char Model_FileName[255];
44- char Model_Path_FileName[1024];
45-
4642 char mSaveFileCom[255];
4743 char mSavePathFileCom[255];
4844
Show on old repository browser