Procházet zdrojové kódy

Clang On Windows Partial Effort

Attempted to compile on windows with clang. Fixed a few bugs that are probably affecting Mac, but eventually ran into errors in the platformWin32 folder.
Peter Robinson před 3 roky
rodič
revize
08953c6eff

+ 3 - 0
.gitignore

@@ -31,6 +31,7 @@ Torque2D_DEBUG
 linkmap.txt
 **/.vs/**
 .vscode/
+*.vcxproj.FileListAbsolute.txt
 
 # Compiled source #
 ###################
@@ -41,6 +42,8 @@ linkmap.txt
 *.so
 *.obj
 *.lib
+*.lib.recipe
+*.exe.recipe
 *.idb
 *.pdb
 *.ilk

+ 4 - 4
engine/Link/Debug/libogg/libogg_DEBUG.lib.recipe

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project>
-  <ProjectOutputs></ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
+  <ProjectOutputs />
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
 </Project>

+ 4 - 4
engine/Link/Debug/libvorbis/libvorbis_DEBUG.lib.recipe

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project>
-  <ProjectOutputs></ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
+  <ProjectOutputs />
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
 </Project>

+ 4 - 4
engine/Link/Debug/ljpeg/ljpeg_DEBUG.lib.recipe

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project>
-  <ProjectOutputs></ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
+  <ProjectOutputs />
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
 </Project>

+ 4 - 4
engine/Link/Debug/lpng/lpng_DEBUG.lib.recipe

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project>
-  <ProjectOutputs></ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
+  <ProjectOutputs />
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
 </Project>

+ 4 - 4
engine/Link/Debug/zlib/zlib_DEBUG.lib.recipe

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project>
-  <ProjectOutputs></ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
+  <ProjectOutputs />
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
 </Project>

+ 0 - 7
engine/Link/VC2012.Debug.Win32/Torque2D/Torque2D_DEBUG.exe.recipe

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project>
-  <ProjectOutputs>C:\Users\Peter\Documents\GitHub\TorqueGameEngines\Torque2D\Torque2D_DEBUG.exe</ProjectOutputs>
-  <ContentFiles></ContentFiles>
-  <SatelliteDlls></SatelliteDlls>
-  <NonRecipeFileRefs></NonRecipeFileRefs>
-</Project>

+ 80 - 44
engine/source/2d/editorToy/EditorToyTool.cc

@@ -63,86 +63,122 @@ void EditorToyTool::onRelinquishObj(SceneObject * obj)
 
 bool EditorToyTool::onTouchMove(const GuiEvent &e)
 {
-   if (!mUseMouseDown)
-      return false;
-
-   Con::executef(this, 2, "onTouchMove", e.mousePoint);
-   return true;
+    if (mUseMouseDown && isMethod("onTouchMove"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onTouchMove", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onTouchDown(const GuiEvent &e)
 {
-   if (!mUseMouseDown)
-      return false;
-
-   Con::executef(this, 2, "onTouchDown", e.mousePoint);
-
-   return true;
+    if (mUseMouseDown && isMethod("onTouchDown"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onTouchDown", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onTouchDragged(const GuiEvent &e)
 {
-   Con::executef(this, 2, "onTouchDragged", e.mousePoint);
-
-   return true;
+    if (isMethod("onTouchDragged"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onTouchDragged", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onTouchUp(const GuiEvent &e)
 {
-   if (!mUseMouseDown)
-      return false;
-
-   Con::executef(this, 2, "onTouchUp", e.mousePoint);
-
-   return true;
+    if (mUseMouseDown && isMethod("onTouchUp"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onTouchUp", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onRightMouseDown(const GuiEvent &e)
 {
-   if (!mUseRightMouseDown)
-      return false;
-
-   Con::executef(this,2, "onRightMouseDown", e.mousePoint);
-   return true;
+   if (mUseRightMouseDown && isMethod("onRightMouseDown"))
+   {
+       char* point = Con::getArgBuffer(32);
+       dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+       Con::executef(this, 2, "onRightMouseDown", point);
+       return true;
+   }
+   return false;
 }
 
 bool EditorToyTool::onRightMouseDragged(const GuiEvent &e)
 {
-   Con::executef(this,2, "onRightMouseDragged", e.mousePoint);
-   return true;
+    if (isMethod("onRightMouseDragged"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onRightMouseDragged", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onRightMouseUp(const GuiEvent &e)
 {
-   if (!mUseRightMouseDown)
-      return false;
-
-   Con::executef(this,2, "onRightMouseUp", e.mousePoint);
-   return true;
+    if (mUseRightMouseDown && isMethod("onRightMouseUp"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onRightMouseUp", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onMiddleMouseDown(const GuiEvent &e)
 {
-   if (!mUseMiddleMouseDown)
-      return false;
-
-   Con::executef(this,2, "onMiddleMouseDown", e.mousePoint);
-   return true;
+    if (mUseMiddleMouseDown && isMethod("onMiddleMouseDown"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onMiddleMouseDown", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onMiddleMouseDragged(const GuiEvent &e)
 {
-   Con::executef(this,2, "onMiddleMouseDragged", e.mousePoint);
-   return true;
+    if (isMethod("onMiddleMouseDragged"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onMiddleMouseDragged", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onMiddleMouseUp(const GuiEvent &e)
 {
-   if (!mUseMiddleMouseDown)
-      return false;
-
-   Con::executef(this,2, "onMiddleMouseUp", e.mousePoint);
-   return true;
+    if (mUseMiddleMouseDown && isMethod("onMiddleMouseUp"))
+    {
+        char* point = Con::getArgBuffer(32);
+        dSprintf(point, 32, "%d %d", e.mousePoint.x, e.mousePoint.y);
+        Con::executef(this, 2, "onMiddleMouseUp", point);
+        return true;
+    }
+    return false;
 }
 
 bool EditorToyTool::onInputEvent(const GuiEvent &e)

+ 3 - 3
engine/source/console/consoleDoc.cc

@@ -436,14 +436,14 @@ void Namespace::dumpClasses( bool dumpScript, bool dumpEngine )
          {
             switch((*fieldList)[j].type)
             {
-            case AbstractClassRep::StartGroupFieldType:
+            case static_cast<U32>(AbstractClassRep::StartGroupFieldType):
                printGroupStart((*fieldList)[j].pGroupname, (*fieldList)[j].pFieldDocs);
                break;
-            case AbstractClassRep::EndGroupFieldType:
+            case static_cast<U32>(AbstractClassRep::EndGroupFieldType):
                printGroupEnd();
                break;
             default:
-            case AbstractClassRep::DepricatedFieldType:
+            case static_cast<U32>(AbstractClassRep::DepricatedFieldType):
                {
                   bool isDeprecated = ((*fieldList)[j].type == AbstractClassRep::DepricatedFieldType);
 

+ 1 - 1
engine/source/gui/guiColorPicker.cc

@@ -472,7 +472,7 @@ void GuiColorPickerCtrl::renderColorBox(RectI &bounds)
    pickerBounds.extent.x = bounds.extent.x-1;
    pickerBounds.extent.y = bounds.extent.y-1;
    
-   if (mProfile->mBorderDefault && mProfile->mBorderDefault->mBorder > 0)
+   if (mProfile->mBorderDefault && mProfile->mBorderDefault->mBorder[0] > 0)
       dglDrawRect(bounds, mProfile->mBorderDefault->mBorderColor[0]);
       
    Point2I selectorPos = Point2I(bounds.point.x+mSelectorPos.x+1, bounds.point.y+mSelectorPos.y+1);

binární
engine/source/platformWin32/cardProfile_ScriptBinding.h


+ 1 - 1
engine/source/platformWin32/nativeDialogs/win32MsgBox.cpp

@@ -90,7 +90,7 @@ S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons butto
    const UTF8 *msg = message;
    const UTF8 *t = title;
 #endif
-   S32 ret = ::MessageBox(winState.appWindow, msg, t, getMaskFromID(sgButtonMap, buttons) | getMaskFromID(sgIconMap, icon));
+   S32 ret = ::MessageBox(winState.appWindow, (LPCWSTR)msg, (LPCWSTR)t, getMaskFromID(sgButtonMap, buttons) | getMaskFromID(sgIconMap, icon));
 
 #ifdef UNICODE
    delete [] msg;

binární
engine/source/platformWin32/winConsole_ScriptBinding.h


binární
engine/source/platformWin32/winExec_ScriptBinding.h


+ 6 - 6
engine/source/platformWin32/winFileio.cc

@@ -164,7 +164,7 @@ bool Platform::pathCopy(const char *fromName, const char *toName, bool nooverwri
       char *f = (char*)fromName;
       char *t = (char*)toName;
 #endif
-      if(::CopyFile( f, t, nooverwrite))
+      if(::CopyFile((LPCWSTR)f, (LPCWSTR)t, nooverwrite))
       {
          return true;
       }
@@ -229,7 +229,7 @@ bool Platform::pathCopy(const char *fromName, const char *toName, bool nooverwri
          char *t = (char*)to;
 #endif
 
-         if (!::CopyFile(f, t, nooverwrite))
+         if (!::CopyFile((LPCWSTR)f, (LPCWSTR)t, nooverwrite))
          {
             // New directory should be deleted here.
             return false;
@@ -305,7 +305,7 @@ File::Status File::open(const char *filename, const AccessMode openMode)
     switch (openMode)
     {
     case Read:
-        handle = (void *)CreateFile(fname,
+        handle = (void *)CreateFile((LPCWSTR)fname,
                                     GENERIC_READ,
                                     FILE_SHARE_READ,
                                     NULL,
@@ -314,7 +314,7 @@ File::Status File::open(const char *filename, const AccessMode openMode)
                                     NULL);
         break;
     case Write:
-        handle = (void *)CreateFile(fname,
+        handle = (void *)CreateFile((LPCWSTR)fname,
                                     GENERIC_WRITE,
                                     0,
                                     NULL,
@@ -323,7 +323,7 @@ File::Status File::open(const char *filename, const AccessMode openMode)
                                     NULL);
         break;
     case ReadWrite:
-        handle = (void *)CreateFile(fname,
+        handle = (void *)CreateFile((LPCWSTR)fname,
                                     GENERIC_WRITE | GENERIC_READ,
                                     0,
                                     NULL,
@@ -332,7 +332,7 @@ File::Status File::open(const char *filename, const AccessMode openMode)
                                     NULL);
         break;
     case WriteAppend:
-        handle = (void *)CreateFile(fname,
+        handle = (void *)CreateFile((LPCWSTR)fname,
                                     GENERIC_WRITE,
                                     0,
                                     NULL,

binární
engine/source/platformWin32/winGLSpecial_ScriptBinding.h


binární
engine/source/platformWin32/winMath_ScriptBinding.h


binární
engine/source/platformWin32/winOGLVideo_ScriptBinding.h