public class ObjectFormat
{
- class_data char * extension;
- class_property char * extension
+ class_data const char * extension;
+ class_property const char * extension
{
set { class_data(extension) = value; }
get { return class_data(extension); }
}
- virtual bool ::Load(Object object, char * fileName, DisplaySystem displaySystem);
+ virtual bool ::Load(Object object, const char * fileName, DisplaySystem displaySystem);
};
// TODO: Review these:
}
}
- bool Load(char * fileName, char * type, DisplaySystem displaySystem)
+ bool Load(const char * fileName, const char * type, DisplaySystem displaySystem)
{
char ext[MAX_EXTENSION];
subclass(ObjectFormat) format;
bool result = false;
if(!type && fileName)
- {
- type = GetExtension(fileName, ext);
- strlwr(type);
- }
+ type = strlwr(GetExtension(fileName, ext));
for(link = class(ObjectFormat).derivatives.first; link; link = link.next)
{
}
}
- Object Find(char * name)
+ Object Find(const char * name)
{
if(this && name)
{
return null;
}
- bool AddName(Object object, char * name)
+ bool AddName(Object object, const char * name)
{
- bool result;
+ bool result = false;
if(this)
{
char * newName = CopyString(name);
{
bool result = false;
- if(!children.first)
+ if(!children.first && this.flags.ownMesh)
result = true;
else
{
while(true)
{
int nIndices = 0;
- PrimitiveGroupType type;
+ PrimitiveGroupType type = (PrimitiveGroupType)-1;
Material material = null;
bool foundGroup = false;
newGroup.indices32[nIndices++] = group.indices32[c] + vertexOffset;
else
for(c = 0; c<group.nIndices; c++)
- newGroup.indices[nIndices++] = group.indices[c] + (uint16)vertexOffset;
+ newGroup.indices[nIndices++] = (uint16)(group.indices[c] + vertexOffset);
}
}
vertexOffset += objectMesh.nVertices;
newGroup.indices32[nIndices++] = group.indices32[c] + vertexOffset;
else
for(c = 0; c<group.nIndices; c++)
- newGroup.indices[nIndices++] = group.indices[c] + (uint16)vertexOffset;
+ newGroup.indices[nIndices++] = (uint16)(group.indices[c] + vertexOffset);
}
}
vertexOffset += child.mesh.nVertices;
property Camera camera { get { return camera; } }; // Fix this with inheritance? camera inherit from Object?
property Object firstChild { get { return children.first; } };
property Object next { get { return next; } };
- property char * name { get { return name; } };
+ property const char * name { get { return name; } };
property Matrix matrix { get { value = matrix; } };
property Object cameraTarget { set { cameraTarget = value; } get { return cameraTarget; } };
property OldList * tracks { /* set { tracks = value; } */ get { return &tracks; } };
private:
Object()
{
- children.offset = (uint)&((Object)0).prev;
+ children.offset = (uint)(uintptr)&((Object)0).prev;
transform.scaling = { 1, 1, 1 };
transform.orientation = { 1,0,0,0 };
flags.transform = true;
if(flags.camera && cameraTarget)
{
- // DeterMine angle to look at target
+ // Determine angle to look at target
Vector3D position, direction;
if(flags.root || !parent)
position = transform.position;
unsigned startFrame, endFrame;
int frame;
Vector3Df pivot;
- Transform transform;
+
+ public Transform transform;
Matrix matrix;
Matrix localMatrix;
void * tag;