+
+// Some windows stuff
+#ifdef WIN32
+void _ccmd_open_nav_win() {
+ OPENFILENAME ofn; // common dialog box structure
+ char szFile[260]; // buffer for file name
+ //HWND hwnd; // owner window
+ HANDLE hf; // file handle
+ // Initialize OPENFILENAME
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
+ //ofn.hwndOwner = hwnd;
+ ofn.lpstrFile = szFile;
+ // Set lpstrFile[0] to '\0' so that GetOpenFileName does not
+ // use the contents of szFile to initialize itself.
+ ofn.lpstrFile[0] = '\0';
+ ofn.nMaxFile = sizeof(szFile);
+ ofn.lpstrFilter = "Nav Mesh\0*.NAV\0";
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFileTitle = NULL;
+ ofn.nMaxFileTitle = 0;
+ ofn.lpstrInitialDir = NULL;
+ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
+
+ // Display the Open dialog box.
+
+ if (GetOpenFileName(&ofn) == TRUE) {
+
+ Nav::Mesh bob(ofn.lpstrFile);
+ //mesh_map_nav->~Mesh(); //Destroy old mesh
+ mesh_map_nav = new Mesh(bob.generateGLMesh());
+
+ }
+ else {
+ console.FeedBack("Couldn't read file. (getopenfilename)");
+ mesh_map_nav = NULL;
+ }
+}
+
+void _ccmd_open_bsp_win() {
+ OPENFILENAME ofn; // common dialog box structure
+ char szFile[260]; // buffer for file name
+ //HWND hwnd; // owner window
+ HANDLE hf; // file handle
+ // Initialize OPENFILENAME
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
+ //ofn.hwndOwner = hwnd;
+ ofn.lpstrFile = szFile;
+ // Set lpstrFile[0] to '\0' so that GetOpenFileName does not
+ // use the contents of szFile to initialize itself.
+ ofn.lpstrFile[0] = '\0';
+ ofn.nMaxFile = sizeof(szFile);
+ ofn.lpstrFilter = "BSP file\0*.BSP\0";
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFileTitle = NULL;
+ ofn.nMaxFileTitle = 0;
+ ofn.lpstrInitialDir = NULL;
+ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
+
+ // Display the Open dialog box.
+
+ if (GetOpenFileName(&ofn) == TRUE) {
+
+ vbsp_level bsp_map(ofn.lpstrFile, true);
+ mesh_map_bsp = new Mesh(bsp_map.generate_bigmesh());
+
+ }
+ else {
+ console.FeedBack("Couldn't read file. (getopenfilename)");
+ mesh_map_bsp = NULL;
+ }
+}
+#endif
+