Browse Source

Merge pull request #25 from marauder2k7/development

more 64bit defines
Peter Robinson 4 years ago
parent
commit
8016b0dfef

+ 1 - 1
engine/source/2d/core/SpriteBatchItem.h

@@ -156,7 +156,7 @@ public:
         // This should be as unique as possible as it is used for hashing.
         // This should be as unique as possible as it is used for hashing.
         operator const U32() const
         operator const U32() const
         {
         {
-#ifdef TORQUE_64
+#ifdef TORQUE_CPU_X64
             return (U32)((U64)(mArgString) * (U32)2654435761);
             return (U32)((U64)(mArgString) * (U32)2654435761);
 #else
 #else
             return (U32)(mArgString) * (U32)2654435761;
             return (U32)(mArgString) * (U32)2654435761;

+ 1 - 1
engine/source/collection/hashTable.h

@@ -41,7 +41,7 @@ namespace Hash
 
 
    inline U32 hash(const void *data)
    inline U32 hash(const void *data)
    {
    {
-#ifdef TORQUE_64
+#ifdef TORQUE_CPU_X64
       return (U32)((U64)data);
       return (U32)((U64)data);
 #else
 #else
       return (U32)data;
       return (U32)data;

+ 1 - 1
engine/source/platform/threads/thread.h

@@ -33,7 +33,7 @@ struct PlatformThreadData;
 // Typedefs
 // Typedefs
 typedef void (*ThreadRunFunction)(void *data);
 typedef void (*ThreadRunFunction)(void *data);
 
 
-#ifdef TORQUE_64
+#ifdef TORQUE_CPU_X64
 typedef U64 ThreadIdent;
 typedef U64 ThreadIdent;
 #else
 #else
 typedef U32 ThreadIdent;
 typedef U32 ThreadIdent;

+ 2 - 3
engine/source/platform/types.gcc.h

@@ -52,7 +52,6 @@ typedef unsigned long long  U64;
 #  define TORQUE_COMPILER_STRING "GCC "
 #  define TORQUE_COMPILER_STRING "GCC "
 #endif
 #endif
 
 
-
 //--------------------------------------
 //--------------------------------------
 // Identify the Operating System
 // Identify the Operating System
 #if defined(_WIN64)
 #if defined(_WIN64)
@@ -130,7 +129,7 @@ typedef unsigned long long  U64;
 #  define TORQUE_CPU_STRING "Intel x86-64"
 #  define TORQUE_CPU_STRING "Intel x86-64"
 #  define TORQUE_CPU_X86_64
 #  define TORQUE_CPU_X86_64
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_LITTLE_ENDIAN
-#  define TORQUE_64
+#  define TORQUE_CPU_X64
 
 
 #elif defined(__ppc__)
 #elif defined(__ppc__)
 #  define TORQUE_CPU_STRING "PowerPC"
 #  define TORQUE_CPU_STRING "PowerPC"
@@ -146,7 +145,7 @@ typedef unsigned long long  U64;
 #  define TORQUE_CPU_STRING "ARM"
 #  define TORQUE_CPU_STRING "ARM"
 #  define TORQUE_CPU_ARM
 #  define TORQUE_CPU_ARM
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_LITTLE_ENDIAN
-#  define TORQUE_64
+#  define TORQUE_CPU_X64
 
 
 #elif defined(EMSCRIPTEN)
 #elif defined(EMSCRIPTEN)
 
 

+ 8 - 0
engine/source/platform/types.h

@@ -89,6 +89,14 @@ static const F32 F32_MAX = F32(3.402823466e+38F);                 ///< Constant
 #  error "Unknown Compiler"
 #  error "Unknown Compiler"
 #endif
 #endif
 
 
+/// Integral type matching the host's memory address width.
+#ifdef TORQUE_CPU_X64
+typedef U64 MEM_ADDRESS;
+#else
+typedef U32 MEM_ADDRESS;
+#endif
+
+
 //--------------------------------------
 //--------------------------------------
 // Enable Asserts in all debug builds -- AFTER compiler types include.
 // Enable Asserts in all debug builds -- AFTER compiler types include.
 #if defined(TORQUE_DEBUG)
 #if defined(TORQUE_DEBUG)

+ 1 - 1
engine/source/platform/types.visualc.h

@@ -85,7 +85,7 @@ typedef unsigned _int64 U64;
 
 
 #if defined(_M_AMD64)
 #if defined(_M_AMD64)
 #  define TORQUE_CPU_STRING "x86_64"
 #  define TORQUE_CPU_STRING "x86_64"
-#  define TORQUE_64
+#  define TORQUE_CPU_X64
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_LITTLE_ENDIAN
 //#  define TORQUE_SUPPORTS_NASM
 //#  define TORQUE_SUPPORTS_NASM
 //#  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
 //#  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM

+ 18 - 18
toybox/Sandbox/1/gui/guiProfiles.cs

@@ -72,24 +72,6 @@ function SetColorAlpha(%color, %newAlpha)
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
-{
-    // fill color
-    fillColor = "0 0 0 0";
-
-    // font
-    fontType = $platformFontType;
-    fontSize = $platformFontSize;
-    fontColor = "255 255 255 255";
-	align = center;
-	vAlign = middle;
-
-	cursorColor = "0 0 0 255";
-
-	borderDefault = GuiDefaultBorderProfile;
-	category = "default";
-};
-
 new GuiCursor(DefaultCursor)
 new GuiCursor(DefaultCursor)
 {
 {
     hotSpot = "3 3";
     hotSpot = "3 3";
@@ -158,6 +140,24 @@ if (!isObject(GuiDefaultBorderProfile)) new GuiBorderProfile (GuiDefaultBorderPr
 	underfill = true;
 	underfill = true;
 };
 };
 
 
+if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
+{
+    // fill color
+    fillColor = "0 0 0 0";
+
+    // font
+    fontType = $platformFontType;
+    fontSize = $platformFontSize;
+    fontColor = "255 255 255 255";
+	align = center;
+	vAlign = middle;
+
+	cursorColor = "0 0 0 255";
+
+	borderDefault = GuiDefaultBorderProfile;
+	category = "default";
+};
+
 if (!isObject(GuiBrightBorderProfile)) new GuiBorderProfile (GuiBrightBorderProfile : GuiDefaultBorderProfile)
 if (!isObject(GuiBrightBorderProfile)) new GuiBorderProfile (GuiBrightBorderProfile : GuiDefaultBorderProfile)
 {
 {
 	border = 2;
 	border = 2;