ecere/gfx/3D/Object: Replacing public data members by properties
authorJerome St-Louis <jerome@ecere.com>
Fri, 22 Jan 2016 21:09:21 +0000 (16:09 -0500)
committerJerome St-Louis <jerome@ecere.com>
Fri, 29 Apr 2016 16:27:20 +0000 (12:27 -0400)
- There are issues with cross-bitness compiling and private data members access

ecere/src/gfx/3D/Object.ec
ecere/src/gfx/3D/models/Object3DSFormat.ec

index 4076c0b..1fed3c2 100644 (file)
@@ -1291,6 +1291,13 @@ public:
    property OldList * tracks { /* set { tracks = value; } */ get { return &tracks; } };
    property ObjectFlags flags { set { flags = value; } get { return flags; } };
 
+   // TOFIX: 32-bit compiling with 64-bit SDK cannot access public members properly
+   property Object parent          { get { return parent; } }
+   property uint numChildren { get { return children.count; } }
+
+   property Matrix * localMatrixPtr   { get { return &localMatrix; } }
+   property Matrix * matrixPtr        { get { return &matrix; } }
+
 private:
    Object()
    {
@@ -1530,8 +1537,8 @@ private:
 
    Object prev, next;
    char * name;
-   public Object parent;
-   public OldList children;
+   Object parent;
+   OldList children;
 
    ObjectFlags flags;
 
@@ -1541,8 +1548,8 @@ private:
    Vector3Df pivot;
 
    public Transform transform;
-   public Matrix matrix;
-   public Matrix localMatrix;
+   Matrix matrix;
+   Matrix localMatrix;
 
    void * tag;
    Vector3Df min, max, center;
index 0733bcc..e35987f 100644 (file)
@@ -2116,7 +2116,9 @@ class Object3DSFormat : ObjectFormat
          info.f = FileOpen(fileName, read);
          if(info.f)
          {
-            if(ReadChunks(ReadMain, &info, object) && info.rootObject.children.first)
+            // TOFIX: eC reorders that badly
+            // if(ReadChunks(ReadMain, &info, object) && info.rootObject.children.first)
+            if(ReadChunks(ReadMain, &info, object) && info.rootObject.firstChild)
             {
                object.flags.root = true;
                object.SetMinMaxRadius(true);