X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=a91157bee2e9d1cb74765b406e4c3754d0433406;hb=35680f96d57400576d1e3996f2e8064e97e71ec9;hp=6c449190aa7d8e0f429741fead0e13fc674ee2e2;hpb=59c333f44be7cf784489be705cff9a75d5b6e21a;p=xonotic%2Fnetradiant.git diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 6c449190..a91157be 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -184,6 +184,9 @@ void VFS_Destroy() // Home Paths +#ifdef WIN32 +#include +#endif void HomePaths_Realise() { #if defined(POSIX) @@ -196,6 +199,26 @@ void HomePaths_Realise() Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); } else +#elif defined(WIN32) + if(!string_empty(prefix)) + { + StringOutputStream path(256); + TCHAR mydocsdir[MAX_PATH + 1]; + if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir)) + { + path << DirectoryCleaned(mydocsdir) << "My Games/" << prefix << "/"; + // win32: only add it if it already exists + if(file_is_directory(path.c_str())) + g_qeglobals.m_userEnginePath = path.c_str(); + else + g_qeglobals.m_userEnginePath = EnginePath_get(); + } + else + { + g_qeglobals.m_userEnginePath = EnginePath_get(); + } + } + else #endif { g_qeglobals.m_userEnginePath = EnginePath_get(); @@ -718,7 +741,7 @@ void PasteToCamera() // Work out the delta Vector3 mid; Select_GetMid(mid); - Vector3 delta = vector3_subtracted(vector3_snapped(Camera_getOrigin(camwnd), GetGridSize()), mid); + Vector3 delta = vector3_subtracted(vector3_snapped(Camera_getOrigin(camwnd), GetSnapGridSize()), mid); // Move to camera GlobalSelectionSystem().translateSelected(delta); @@ -976,11 +999,13 @@ void OpenUpdateURL() { // build the URL StringOutputStream URL(256); - URL << "http://www.qeradiant.com/index.php?data=dlupdate&query_dlup=1"; + URL << "http://www.icculus.org/netradiant/?cmd=update&data=dlupdate&query_dlup=1"; #ifdef WIN32 URL << "&OS_dlup=1"; -#else +#elif defined(__APPLE__) URL << "&OS_dlup=2"; +#else + URL << "&OS_dlup=3"; #endif URL << "&Version_dlup=" RADIANT_VERSION; g_GamesDialog.AddPacksURL(URL); @@ -990,15 +1015,15 @@ void OpenUpdateURL() // open the Q3Rad manual void OpenHelpURL() { - // at least on win32, AppPath + "Q3Rad_Manual/index.htm" + // at least on win32, AppPath + "docs/index.html" StringOutputStream help(256); - help << AppPath_get() << "Q3Rad_Manual/index.htm"; + help << AppPath_get() << "docs/index.html"; OpenURL(help.c_str()); } void OpenBugReportURL() { - OpenURL("http://www.qeradiant.com/?data=bugreport"); + OpenURL("http://www.icculus.org/netradiant/?cmd=bugs"); } @@ -1187,13 +1212,21 @@ void SelectFaceMode() class CloneSelected : public scene::Graph::Walker { bool doMakeUnique; + NodeSmartReference worldspawn; public: - CloneSelected(bool d): doMakeUnique(d) { } + CloneSelected(bool d): doMakeUnique(d), worldspawn(Map_FindOrInsertWorldspawn(g_map)) + { + } bool pre(const scene::Path& path, scene::Instance& instance) const { if(path.size() == 1) return true; + // ignore worldspawn, but keep checking children + NodeSmartReference me(path.top().get()); + if(me == worldspawn) + return true; + if(!path.top().get().isRoot()) { Selectable* selectable = Instance_getSelectable(instance); @@ -1211,6 +1244,11 @@ public: if(path.size() == 1) return; + // ignore worldspawn, but keep checking children + NodeSmartReference me(path.top().get()); + if(me == worldspawn) + return; + if(!path.top().get().isRoot()) { Selectable* selectable = Instance_getSelectable(instance); @@ -3286,7 +3324,7 @@ void MainFrame::SetGridStatus() { StringOutputStream status(64); const char* lock = (GridStatus_getTextureLockEnabled()) ? "ON" : "OFF"; - status << "G:" << GridStatus_getGridSize() + status << (GetSnapGridSize() > 0 ? "G:" : "g:") << GridStatus_getGridSize() << " R:" << GridStatus_getRotateIncrement() << " C:" << GridStatus_getFarClipDistance() << " L:" << lock; @@ -3301,13 +3339,10 @@ void GridStatus_onTextureLockEnabledChanged() } } -namespace -{ - GLFont g_font(0, 0); -} - void GlobalGL_sharedContextCreated() { + GLFont *g_font = NULL; + // report OpenGL information globalOutputStream() << "GL_VENDOR: " << reinterpret_cast(glGetString (GL_VENDOR)) << "\n"; globalOutputStream() << "GL_RENDERER: " << reinterpret_cast(glGetString (GL_RENDERER)) << "\n"; @@ -3321,15 +3356,17 @@ void GlobalGL_sharedContextCreated() GlobalShaderCache().realise(); Textures_Realise(); -#if defined(WIN32) - g_font = glfont_create("courier new 8"); -#elif defined(__linux__) - g_font = glfont_create("fixed 8"); +#ifdef WIN32 + /* win32 is dodgy here, just use courier new then */ + g_font = glfont_create("arial 9"); #else - g_font = glfont_create("courier 8"); + GtkSettings *settings = gtk_settings_get_default(); + gchar *fontname; + g_object_get(settings, "gtk-font-name", &fontname, NULL); + g_font = glfont_create(fontname); #endif - GlobalOpenGL().m_font = g_font.getDisplayList(); - GlobalOpenGL().m_fontHeight = g_font.getPixelHeight(); + + GlobalOpenGL().m_font = g_font; } void GlobalGL_sharedContextDestroyed()