• R/O
  • SSH
  • HTTPS

vima19: Commit


Commit MetaInfo

Revision752 (tree)
Time2022-08-13 19:55:37
Authorhgtterry

Log Message

Equity_SB 130822 Project (WIP)

Change Summary

Incremental Difference

--- Anim19_OSDN/SB_Camera.cpp (revision 751)
+++ Anim19_OSDN/SB_Camera.cpp (revision 752)
@@ -109,7 +109,7 @@
109109
110110 if (LOWORD(wParam) == IDC_BTCAMSAVE)
111111 {
112- App->SBC_Project->Write_Camera();
112+ //App->SBC_Project->Write_Camera();
113113 App->Say("Camera Saved");
114114 return TRUE;
115115 }
--- Anim19_OSDN/SB_Player.cpp (revision 751)
+++ Anim19_OSDN/SB_Player.cpp (revision 752)
@@ -274,7 +274,7 @@
274274 {
275275 if (App->SBC_Scene->Scene_Loaded == 1)
276276 {
277- App->SBC_Project->Write_Player();
277+ //App->SBC_Project->Write_Player();
278278 App->Say("Player Saved");
279279 }
280280 return 1;
--- Anim19_OSDN/SB_Project.cpp (revision 751)
+++ Anim19_OSDN/SB_Project.cpp (revision 752)
@@ -72,14 +72,14 @@
7272 // *************************************************************************
7373 bool SB_Project::Start_Save_Project_Dialog()
7474 {
75- DialogBox(App->hInst, (LPCTSTR)IDD_PROJECT, App->Fdlg, (DLGPROC)Create_Project_Proc);
75+ DialogBox(App->hInst, (LPCTSTR)IDD_PROJECT, App->Fdlg, (DLGPROC)Save_Project_Dialog_Proc);
7676 return 1;
7777 }
7878
7979 // *************************************************************************
80-// * Create_Project_Proc Terry Flanigan *
80+// * Save_Project_Dialog_Proc Terry Flanigan *
8181 // *************************************************************************
82-LRESULT CALLBACK SB_Project::Create_Project_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
82+LRESULT CALLBACK SB_Project::Save_Project_Dialog_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
8383 {
8484 switch (message)
8585 {
@@ -304,325 +304,6 @@
304304 }
305305
306306 // *************************************************************************
307-// * Write_Objects Terry Flanigan *
308-// *************************************************************************
309-bool SB_Project::Write_Objects()
310-{
311- char File[1024];
312-
313- strcpy(File, m_Project_Sub_Folder);
314- strcat(File, "\\");
315- strcat(File, "Objects.obf");
316-
317- Write_Object_Ini = NULL;
318-
319- Write_Object_Ini = fopen(File, "wt");
320-
321- if (!Write_Object_Ini)
322- {
323- App->Say("Cant Create File");
324- App->Say(File);
325- return 0;
326- }
327-
328- fprintf(Write_Object_Ini, "%s\n", "[Version_Data]");
329- fprintf(Write_Object_Ini, "%s%s\n", "Version=", "V1.2");
330-
331- fprintf(Write_Object_Ini, "%s\n", " ");
332-
333- fprintf(Write_Object_Ini, "%s\n", "[Objects]");
334- fprintf(Write_Object_Ini, "%s%i\n", "Objects_Count=", App->SBC_Scene->Object_Count);
335-
336-
337-
338- fclose(Write_Object_Ini);
339-
340- return 1;
341-}
342-
343-// *************************************************************************
344-// * Write_Player Terry Flanigan *
345-// *************************************************************************
346-bool SB_Project::Write_Player()
347-{
348- Ogre::Vector3 Pos;
349- char File[1024];
350-
351- strcpy(File, m_Project_Sub_Folder);
352- strcat(File, "\\");
353- strcat(File, "Player1.ply");
354-
355- Write_Player_Ini = NULL;
356-
357- Write_Player_Ini = fopen(File, "wt");
358-
359- if (!Write_Player_Ini)
360- {
361- App->Say("Cant Create File");
362- App->Say(File);
363- return 0;
364- }
365-
366- fprintf(Write_Player_Ini, "%s\n", "[Version_Data]");
367- fprintf(Write_Player_Ini, "%s%s\n", "Version=", "V1.2");
368-
369- fprintf(Write_Player_Ini, "%s\n", " ");
370-
371- fprintf(Write_Player_Ini, "%s\n", "[Counters]");
372- fprintf(Write_Player_Ini, "%s%i\n", "Player_Count=",App->SBC_Scene->Player_Count);
373-
374- fprintf(Write_Player_Ini, "%s\n", " ");
375-
376- char Cbuff[255];
377- char buff[255];
378- int Count = 0;
379- while (Count < App->SBC_Scene->Player_Count)
380- {
381- strcpy(buff, "[Player_");
382- _itoa(Count, Cbuff, 10);
383- strcat(buff, Cbuff);
384- strcat(buff, "]");
385-
386- fprintf(Write_Player_Ini, "%s\n", buff); // Header also Player name until changed by user
387-
388- fprintf(Write_Player_Ini, "%s%s\n", "Player_Name=", App->SBC_Scene->SBC_Base_Player[Count]->Player_Name);
389-
390- Pos.x = App->SBC_Scene->SBC_Base_Player[Count]->StartPos.x;
391- Pos.y = App->SBC_Scene->SBC_Base_Player[Count]->StartPos.y;
392- Pos.z = App->SBC_Scene->SBC_Base_Player[Count]->StartPos.z;
393-
394- fprintf(Write_Player_Ini, "%s%f,%f,%f\n", "Start_Position=", Pos.x, Pos.y, Pos.z);
395- fprintf(Write_Player_Ini, "%s%s\n", "Shape=", "Capsule");
396- fprintf(Write_Player_Ini, "%s%f\n", "Mass=", App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Mass);
397- fprintf(Write_Player_Ini, "%s%f\n", "Radius=", App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Radius);
398- fprintf(Write_Player_Ini, "%s%f\n", "Height=", App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Height);
399- fprintf(Write_Player_Ini, "%s%f\n", "Ground_Speed=", App->SBC_Scene->SBC_Base_Player[Count]->Ground_speed);
400- fprintf(Write_Player_Ini, "%s%f\n", "Cam_Height=", App->SBC_Scene->SBC_Base_Player[Count]->PlayerHeight);
401-
402- Count++;
403- }
404-
405- fclose(Write_Player_Ini);
406-
407- return 1;
408-}
409-
410-// *************************************************************************
411-// * Write_Camera Terry Flanigan *
412-// *************************************************************************
413-bool SB_Project::Write_Camera()
414-{
415- char File[1024];
416-
417- strcpy(File, m_Project_Sub_Folder);
418- strcat(File, "\\");
419- strcat(File, "Camera1.cam");
420-
421- WriteFile = NULL;
422-
423- WriteFile = fopen(File, "wt");
424-
425- if (!WriteFile)
426- {
427- App->Say("Cant Create File");
428- App->Say(File);
429- return 0;
430- }
431-
432- fprintf(WriteFile, "%s\n", "[Version_Data]");
433- fprintf(WriteFile, "%s%s\n", "Version=", "V1.2");
434-
435- fprintf(WriteFile, "%s\n", " ");
436-
437- fprintf(WriteFile, "%s\n", "[Camera]");
438- fprintf(WriteFile, "%s%s\n", "Camera_Name=", App->SBC_Camera->Camera_Name);
439-
440- fprintf(WriteFile, "%s%f,%f,%f\n", "Start_Position=", App->SBC_Camera->CamPos_X, App->SBC_Camera->CamPos_Y, App->SBC_Camera->CamPos_Z);
441- fprintf(WriteFile, "%s%f,%f,%f\n", "Look_At=", App->SBC_Camera->LookAt_X, App->SBC_Camera->LookAt_Y, App->SBC_Camera->LookAt_Z);
442-
443-
444-
445- fclose(WriteFile);
446-
447- return 1;
448-}
449-// *************************************************************************
450-// * Write_Level_File Terry Flanigan *
451-// *************************************************************************
452-bool SB_Project::Write_Level_File()
453-{
454- char File[1024];
455- File[0] = 0;
456-
457- WriteFile = NULL;
458-
459- strcpy(File, m_Project_Sub_Folder);
460- strcat(File, "\\");
461- strcat(File, "Level.SBLevel");
462-
463-
464- WriteFile = fopen(File, "wt");
465-
466- if (!WriteFile)
467- {
468- App->Say("Cant Create File");
469- return 0;
470- }
471-
472- fprintf(WriteFile, "%s\n", "[Version_Data]");
473- fprintf(WriteFile, "%s%s\n", "Version=", "V1.2");
474-
475- fprintf(WriteFile, "%s\n", " ");
476-
477- fprintf(WriteFile, "%s\n", "[Levels]");
478- fprintf(WriteFile, "%s%s\n", "Folder=", "World1");
479- fprintf(WriteFile, "%s%s\n", "File=", "World.mesh");
480-
481- fprintf(WriteFile, "%s\n", " ");
482-
483- fprintf(WriteFile, "%s\n", "[Player]");
484- fprintf(WriteFile, "%s%s\n", "Player_File=", "Player1.ply");
485-
486- fprintf(WriteFile, "%s\n", " ");
487-
488- fprintf(WriteFile, "%s\n", "[Camere]");
489- fprintf(WriteFile, "%s%s\n", "Camera_File=", "Cam1.cam");
490-
491- fclose(WriteFile);
492- return 1;
493-}
494-
495-// *************************************************************************
496-// * Read_Player Terry Flanigan *
497-// *************************************************************************
498-bool SB_Project::Read_Player()
499-{
500- char chr_Tag1[1024];
501- char chr_Tag2[1024];
502-
503- int Int_Tag = 0;
504-
505- float x = 0;
506- float y = 0;
507- float z = 0;
508-
509- chr_Tag1[0] = 0;
510- chr_Tag2[0] = 0;
511-
512- // -------------------------------------------------------------------
513- char Path[1024];
514- strcpy(Path, m_Project_Sub_Folder);
515- strcat(Path, "Player1.ply");
516-
517- // -------------------------------------------------------------------
518-
519- App->Cl_Ini->SetPathName(Path);
520-
521- App->Cl_Ini->GetString("Version_Data", "Version", chr_Tag1, 1024);
522-
523- Int_Tag = App->Cl_Ini->GetInt("Counters", "Player_Count", 0, 10);
524-
525- char Cbuff[255];
526- char buff[255];
527- int Count = 0;
528-
529- while (Count < Int_Tag)
530- {
531- App->SBC_Player->Create_Player_Object(); // Increments Player Counter
532-
533- strcpy(buff, "Player_");
534- _itoa(Count, Cbuff, 10);
535- strcat(buff, Cbuff);
536-
537- App->Cl_Ini->GetString(buff, "Player_Name", chr_Tag1, 1024);
538-
539- strcpy(App->SBC_Scene->SBC_Base_Player[Count]->Player_Name, chr_Tag1);
540-
541- //// Position
542- App->Cl_Ini->GetString(buff, "Start_Position", chr_Tag1, 1024);
543- sscanf(chr_Tag1, "%f,%f,%f", &x, &y, &z);
544- App->SBC_Scene->SBC_Base_Player[Count]->StartPos.x = x;
545- App->SBC_Scene->SBC_Base_Player[Count]->StartPos.y = y;
546- App->SBC_Scene->SBC_Base_Player[Count]->StartPos.z = z;
547-
548-
549- App->Cl_Ini->GetString(buff, "Shape", chr_Tag1, 1024); // Capsule
550-
551- x = App->Cl_Ini->Get_Float(buff, "Mass");
552- y = App->Cl_Ini->Get_Float(buff, "Radius");
553- z = App->Cl_Ini->Get_Float(buff, "Height");
554-
555- App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Mass = x;
556- App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Radius = y;
557- App->SBC_Scene->SBC_Base_Player[Count]->Capsule_Height = z;
558-
559- x = App->Cl_Ini->Get_Float(buff, "Ground_Speed");
560- App->SBC_Scene->SBC_Base_Player[Count]->Ground_speed = x;
561-
562- x = App->Cl_Ini->Get_Float(buff, "Cam_Height");
563- App->SBC_Scene->SBC_Base_Player[Count]->PlayerHeight = x;
564-
565- App->SBC_Player->FileViewItem = App->SBC_FileView->Add_PlayerFile(App->SBC_Scene->SBC_Base_Player[Count]->Player_Name, Count);
566-
567- Count++;
568-
569- }
570-
571- App->SBC_FileView->Redraw_FileView();
572-
573- App->Cl_Bullet->Reset_Physics();
574- return 1;
575-}
576-
577-// *************************************************************************
578-// * Read_Camera Terry Flanigan *
579-// *************************************************************************
580-bool SB_Project::Read_Camera()
581-{
582- char chr_Tag1[1024];
583- char chr_Tag2[1024];
584-
585- float x = 0;
586- float y = 0;
587- float z = 0;
588-
589- chr_Tag1[0] = 0;
590- chr_Tag2[0] = 0;
591-
592- // -------------------------------------------------------------------
593- char Path[1024];
594- strcpy(Path, m_Project_Sub_Folder);
595- strcat(Path, "Camera1.cam");
596-
597- // -------------------------------------------------------------------
598-
599- //App->Cl_Ini->SetPathName(Path);
600-
601- //App->Cl_Ini->GetString("Version_Data", "Version", chr_Tag1, 1024);
602-
603- //App->Cl_Ini->GetString("Camera", "Camera_Name", chr_Tag1, 1024);
604- //strcpy(App->SBC_Camera->Camera_Name, chr_Tag1);
605-
606- //// Position
607- //App->Cl_Ini->GetString("Camera", "Start_Position", chr_Tag1, 1024);
608- //sscanf(chr_Tag1, "%f,%f,%f", &x, &y, &z);
609- //App->SBC_Camera->CamPos_X = x;
610- //App->SBC_Camera->CamPos_Y = y;
611- //App->SBC_Camera->CamPos_Z = z;
612-
613- //// Position
614- //App->Cl_Ini->GetString("Camera", "Look_At", chr_Tag1, 1024);
615- //sscanf(chr_Tag1, "%f,%f,%f", &x, &y, &z);
616- //App->SBC_Camera->LookAt_X = x;
617- //App->SBC_Camera->LookAt_Y = y;
618- //App->SBC_Camera->LookAt_Z = z;
619-
620- App->SBC_Camera->FileViewItem = App->SBC_FileView->Add_Camera(App->SBC_Camera->Camera_Name, 0);
621- App->SBC_FileView->Redraw_FileView();
622- return 1;
623-}
624-
625-// *************************************************************************
626307 // * Save_Project Terry Flanigan *
627308 // *************************************************************************
628309 bool SB_Project::N_Save_Project()
@@ -1013,7 +694,7 @@
1013694 strcpy(App->CL_Vm_Model->FileName, chr_Tag2);*/
1014695
1015696 //Read_Player();
1016- Read_Camera();
697+ N_Load_Project_Camera();
1017698 App->SBC_FileView->Set_FolderActive(App->SBC_FileView->GD_CameraFolder);
1018699 //App->SBC_Aera->Add_Area();
1019700
@@ -1092,3 +773,51 @@
1092773 return 1;
1093774 }
1094775
776+// *************************************************************************
777+// * N_Load_Project_Camera Terry Flanigan *
778+// *************************************************************************
779+bool SB_Project::N_Load_Project_Camera()
780+{
781+ char chr_Tag1[1024];
782+ char chr_Tag2[1024];
783+
784+ float x = 0;
785+ float y = 0;
786+ float z = 0;
787+
788+ chr_Tag1[0] = 0;
789+ chr_Tag2[0] = 0;
790+
791+ // -------------------------------------------------------------------
792+ char Path[1024];
793+ strcpy(Path, m_Project_Sub_Folder);
794+ strcat(Path, "Camera1.cam");
795+
796+ // -------------------------------------------------------------------
797+
798+ //App->Cl_Ini->SetPathName(Path);
799+
800+ //App->Cl_Ini->GetString("Version_Data", "Version", chr_Tag1, 1024);
801+
802+ //App->Cl_Ini->GetString("Camera", "Camera_Name", chr_Tag1, 1024);
803+ //strcpy(App->SBC_Camera->Camera_Name, chr_Tag1);
804+
805+ //// Position
806+ //App->Cl_Ini->GetString("Camera", "Start_Position", chr_Tag1, 1024);
807+ //sscanf(chr_Tag1, "%f,%f,%f", &x, &y, &z);
808+ //App->SBC_Camera->CamPos_X = x;
809+ //App->SBC_Camera->CamPos_Y = y;
810+ //App->SBC_Camera->CamPos_Z = z;
811+
812+ //// Position
813+ //App->Cl_Ini->GetString("Camera", "Look_At", chr_Tag1, 1024);
814+ //sscanf(chr_Tag1, "%f,%f,%f", &x, &y, &z);
815+ //App->SBC_Camera->LookAt_X = x;
816+ //App->SBC_Camera->LookAt_Y = y;
817+ //App->SBC_Camera->LookAt_Z = z;
818+
819+ App->SBC_Camera->FileViewItem = App->SBC_FileView->Add_Camera(App->SBC_Camera->Camera_Name, 0);
820+ App->SBC_FileView->Redraw_FileView();
821+ return 1;
822+}
823+
--- Anim19_OSDN/SB_Project.h (revision 751)
+++ Anim19_OSDN/SB_Project.h (revision 752)
@@ -72,11 +72,6 @@
7272
7373 //------------------------------------------------
7474
75- bool Write_Level_File();
76- bool Write_Player();
77- bool Write_Camera();
78- bool Write_Objects();
79-
8075 char Project_Ini_FilePath[1024];
8176
8277 char Level_Folder_Path_World[1024];
@@ -90,13 +85,11 @@
9085
9186 protected:
9287
93- static LRESULT CALLBACK Create_Project_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
88+ static LRESULT CALLBACK Save_Project_Dialog_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
9489
90+ bool N_Load_Project_Camera();
9591 void N_Set_Paths();
9692
97- bool Read_Player();
98- bool Read_Camera();
99-
10093 FILE *Write_Ini;
10194 FILE *Write_Player_Ini;
10295 FILE *Write_Object_Ini;
Show on old repository browser