diff --git a/C3Dit.vcxproj b/C3Dit.vcxproj index 84cdbb3..e2a5b54 100644 --- a/C3Dit.vcxproj +++ b/C3Dit.vcxproj @@ -18,12 +18,13 @@ Application true - v100 + v142 MultiByte Application false + v142 diff --git a/Globals.h b/Globals.h index f455c8e..cebda6e 100644 --- a/Globals.h +++ b/Globals.h @@ -5,7 +5,6 @@ //#include "Model.h" #include -using namespace std; class Globals @@ -22,10 +21,10 @@ class Globals ~Globals(){} //Global Variables - string GameLocation; - string WorkingDirectory; - string EnvironmentMap; - string SpecularMap; + std::string GameLocation; + std::string WorkingDirectory; + std::string EnvironmentMap; + std::string SpecularMap; int WinX, WinY, WinW, WinH; bool Maximized; @@ -39,6 +38,8 @@ class GlobalVariables private: GlobalVariables(){} + GlobalVariables(const GlobalVariables&) = delete; + GlobalVariables(GlobalVariables&&) = delete; public: diff --git a/Ini.cpp b/Ini.cpp index 10d8e57..c8c12bb 100644 --- a/Ini.cpp +++ b/Ini.cpp @@ -1,7 +1,8 @@ #include "header.h" #include "Ini.h" -#include +#include +#include //===========================================================// @@ -142,12 +143,10 @@ INIFILE::~INIFILE() fp = fopen( Name.c_str(), "w" ); - for ( int s=0; s #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "version.h" #include "Ini.h" diff --git a/main.cpp b/main.cpp index 371c092..ea60085 100644 --- a/main.cpp +++ b/main.cpp @@ -13,8 +13,6 @@ #include #include -using namespace std; - string statMessages[] = { "Holding the right mouse button lets you orbit the object!", @@ -40,7 +38,6 @@ void LoadCARData(char*); void LoadC2OData(char*); void Load3DFData(char*); void LoadOBJData(char*); -void SaveEZJSOBJData(char *); BOOL CALLBACK AniDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); @@ -498,21 +495,19 @@ int WINAPI WinMain(HINSTANCE hInstance, g_TVItems.clear(); - { - gIniFile->SetValueString( "General", "gamedir", GlobalData->GameLocation ); - gIniFile->SetValueString( "General", "envmap", GlobalData->EnvironmentMap ); - gIniFile->SetValueString( "General", "specular", GlobalData->SpecularMap ); - gIniFile->SetValueInt( "General", "software", false ); - - gIniFile->SetValueInt( "Window", "left", WinX ); - gIniFile->SetValueInt( "Window", "top", WinY ); - gIniFile->SetValueInt( "Window", "width", WinW ); - gIniFile->SetValueInt( "Window", "height", WinH ); - - gIniFile->SetValueInt( "OpenGL", "color", GlobalData->BufferColorBits ); - gIniFile->SetValueInt( "OpenGL", "depth", GlobalData->BufferDepthBits ); - gIniFile->SetValueInt( "OpenGL", "mipmaps", GlobalData->UseMipMaps ); - } + gIniFile->SetValueString( "General", "gamedir", GlobalData->GameLocation ); + gIniFile->SetValueString( "General", "envmap", GlobalData->EnvironmentMap ); + gIniFile->SetValueString( "General", "specular", GlobalData->SpecularMap ); + gIniFile->SetValueInt( "General", "software", false ); + + gIniFile->SetValueInt( "Window", "left", WinX ); + gIniFile->SetValueInt( "Window", "top", WinY ); + gIniFile->SetValueInt( "Window", "width", WinW ); + gIniFile->SetValueInt( "Window", "height", WinH ); + + gIniFile->SetValueInt( "OpenGL", "color", GlobalData->BufferColorBits ); + gIniFile->SetValueInt( "OpenGL", "depth", GlobalData->BufferDepthBits ); + gIniFile->SetValueInt( "OpenGL", "mipmaps", GlobalData->UseMipMaps ); delete gIniFile; @@ -622,6 +617,7 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (ParItem == rootNodes[TV_ANIMATIONS]) // Animations { + // TODO: CUR_ANIM = ((UINT)nmtv->itemNew.lParam - (UINT)&g_Animations[0]) / sizeof(TVtl); CUR_FRAME = 0; SendMessage(g_AniTrack, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, ( g_Animations[CUR_ANIM].FrameCount-1 ) ) ); @@ -1752,6 +1748,7 @@ void LoadCARData(char* fname) hResMenu = GetSubMenu(hMenu, 0); EnableMenuItem(hResMenu, IDF_SAVEAS, MF_BYCOMMAND | (TRUE ? MF_ENABLED : MF_GRAYED));*/ + RedrawWindow(g_FileView, nullptr, nullptr, RDW_UPDATENOW); UpdateWindow(g_FileView); UpdateWindow(g_hMain); } @@ -2002,7 +1999,6 @@ void loadCAR() char sstr[64]; sprintf(sstr,"Triangles: %u",(UINT)Model.num_tris); SendMessage(gHStatus, SB_SETTEXT, 0, (LPARAM)sstr); - MessageBox(g_hMain,sstr,"triangles",MB_OK); return; } @@ -2148,45 +2144,6 @@ void SaveOBJData(char *fname) return; } -void SaveEZJSOBJData(char *fname) -{ - // -- Saves the mesh as an EpicZenVideo-JS primitive script - FILE *fp = fopen(fname,"w"); - - fprintf(fp, "function Create_%s_Primitive()\n{\n", Model.name); - - fprintf(fp, "\tmesh = new EZprimitive( EZPT_TRIANGLES );\n", Model.name); - - for (int t=0; t