]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/bobtoolz/misc.cpp
- Radiant is now Vista compatible (Aero must be disabled)
[xonotic/netradiant.git] / contrib / bobtoolz / misc.cpp
index cce40e14f44c4057e6dd30bcb8a4d4da1d4cdc6b..5d926986b2d32de900b55066dc27d19be46068b4 100644 (file)
@@ -131,12 +131,10 @@ void SetInitialStairPos(int dir, vec3_t min, vec3_t max, float width)
 char* TranslateString (char *buf)
 {
        static  char    buf2[32768];
 char* TranslateString (char *buf)
 {
        static  char    buf2[32768];
-       int             i, l;
-       char    *out;
 
 
-       l = strlen(buf);
-       out = buf2;
-       for (i=0 ; i<l ; i++)
+  std::size_t l = strlen(buf);
+       char* out = buf2;
+       for (int i=0 ; i<l ; i++)
        {
                if (buf[i] == '\n')
                {
        {
                if (buf[i] == '\n')
                {
@@ -168,7 +166,7 @@ char* UnixToDosPath(char* path)
 
 const char* ExtractFilename(const char* path)
 {
 
 const char* ExtractFilename(const char* path)
 {
-       char* p = strrchr(path, '/');
+       const char* p = strrchr(path, '/');
        if(!p)
        {
                p = strrchr(path, '\\');
        if(!p)
        {
                p = strrchr(path, '\\');
@@ -217,8 +215,6 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole )
 }
 #endif
 
 }
 #endif
 
-#include <windows.h>
-
 #ifdef WIN32
 
 #include <windows.h>
 #ifdef WIN32
 
 #include <windows.h>
@@ -239,7 +235,7 @@ bool Q_Exec( const char *pCmd, bool bCreateConsole )
 
        for(; *pCmd == ' '; pCmd++);
 
 
        for(; *pCmd == ' '; pCmd++);
 
-       if(!CreateProcess(NULL, (char *)pCmd, NULL, NULL, FALSE, dwCreationFlags, NULL, NULL, &si, &pi))
+       if(!CreateProcess(NULL, (char *)pCmd, NULL, NULL, false, dwCreationFlags, NULL, NULL, &si, &pi))
                return false;
 
   return true;
                return false;
 
   return true;
@@ -262,7 +258,7 @@ void StartBSP()
        char command[1024];
        sprintf(command, "%s -nowater -fulldetail %s", exename, mapname);
 
        char command[1024];
        sprintf(command, "%s -nowater -fulldetail %s", exename, mapname);
 
-       Q_Exec( command, TRUE );
+       Q_Exec( command, true );
 }
 
 class EntityWriteMiniPrt
 }
 
 class EntityWriteMiniPrt
@@ -281,8 +277,8 @@ public:
 
                if(!strcmp(classname, "worldspawn"))
                {
 
                if(!strcmp(classname, "worldspawn"))
                {
-                       world.LoadFromEntity(instance.path().top(), FALSE);
-                       world.RemoveNonCheckBrushes(exclusionList, TRUE);
+                       world.LoadFromEntity(instance.path().top(), false);
+                       world.RemoveNonCheckBrushes(exclusionList, true);
                        world.SaveToFile(pFile);
                }
                else if(strstr(classname, "info_"))
                        world.SaveToFile(pFile);
                }
                else if(strstr(classname, "info_"))
@@ -379,12 +375,12 @@ bool GetEntityCentre(const char* entity, vec3_t centre)
 {
   const scene::Path* ent = FindEntityFromTargetname(entity);
        if(!ent)
 {
   const scene::Path* ent = FindEntityFromTargetname(entity);
        if(!ent)
-               return FALSE;
+               return false;
 
   scene::Instance& instance = *GlobalSceneGraph().find(*ent);
   VectorCopy(instance.worldAABB().origin, centre);
 
 
   scene::Instance& instance = *GlobalSceneGraph().find(*ent);
   VectorCopy(instance.worldAABB().origin, centre);
 
-       return TRUE;
+       return true;
 }
 
 vec_t Min(vec_t a, vec_t b)
 }
 
 vec_t Min(vec_t a, vec_t b)