}
#endif
}
+ public property int ascent
+ {
+ get { return (int)(this ? ascent * scale : 0); }
+ }
};
public class LFBDisplay : struct
LFBDisplay lfbDisplay = display ? display.driverData : null;
LFBSurface lfbSurface = surface.driverData;
uint index;
- if(display) color = color /*& 0xFFFFFF*/;
+ //if(display) color = color & 0xFFFFFF;
lfbSurface.foregroundRgb = color;
if(lfbSurface.font && lfbDisplay)
{
LFBDisplay lfbDisplay = display ? display.driverData : null;
LFBSurface lfbSurface = surface.driverData;
- color = color /*& 0xFFFFFF*/;
+ //color = color & 0xFFFFFF;
switch(lfbSurface.bitmap.pixelFormat)
{
case pixelFormat8:
ColorAlpha * backsrc;
ColorAlpha * source = ((ColorAlpha *) src.picture) + sy * addsource + sx;
ColorAlpha * dest = ((ColorAlpha *) lfbSurface.bitmap.picture) + dy * adddest + dx;
- if(flip < 0) source += sw-1;
+ if(flip) source += sw-1;
adddest -= w;
yerr = 0;
for(y=0; y<sh; y++)
delete mesh.texCoords;
}
- bool AllocateMesh(DisplaySystem displaySystem, Mesh mesh)
+ bool AllocateMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags, int nVertices)
{
bool result = false;
-
- if((!mesh.flags.vertices || mesh.vertices || (mesh.vertices = new Vector3Df[mesh.nVertices])) &&
- (!mesh.flags.normals || mesh.normals || (mesh.normals = new Vector3Df[mesh.nVertices])) &&
- (!mesh.flags.texCoords1 || mesh.texCoords || (mesh.texCoords = new Pointf [mesh.nVertices])))
+ if(mesh.nVertices == nVertices)
+ {
result = true;
+ // Same number of vertices, adding features (Leaves the other features pointers alone)
+ if(mesh.flags != flags)
+ {
+ if(!mesh.flags.vertices && flags.vertices)
+ {
+ if(flags.doubleVertices)
+ {
+ mesh.vertices = (Vector3Df *)new Vector3D[nVertices];
+ }
+ else
+ mesh.vertices = new Vector3Df[nVertices];
+ }
+ if(!mesh.flags.normals && flags.normals)
+ {
+ if(flags.doubleNormals)
+ {
+ mesh.normals = (Vector3Df *)new Vector3D[nVertices];
+ }
+ else
+ mesh.normals = new Vector3Df[nVertices];
+ }
+ if(!mesh.flags.texCoords1 && flags.texCoords1)
+ mesh.texCoords = new Pointf[nVertices];
+ if(!mesh.flags.colors && flags.colors)
+ mesh.colors = new ColorRGBAf[nVertices];
+ }
+ }
+ else
+ {
+ result = true;
+ // New number of vertices, reallocate all current and new features
+ flags |= mesh.flags;
+ if(flags.vertices)
+ {
+ if(flags.doubleVertices)
+ {
+ mesh.vertices = (Vector3Df *)renew mesh.vertices Vector3D[nVertices];
+ }
+ else
+ mesh.vertices = renew mesh.vertices Vector3Df[nVertices];
+ }
+ if(flags.normals)
+ {
+ if(flags.doubleNormals)
+ {
+ mesh.normals = (Vector3Df *)renew mesh.normals Vector3D[nVertices];
+ }
+ else
+ mesh.normals = renew mesh.normals Vector3Df[nVertices];
+ }
+ if(flags.texCoords1)
+ mesh.texCoords = renew mesh.texCoords Pointf[nVertices];
+ if(flags.colors)
+ mesh.colors = renew mesh.colors ColorRGBAf[nVertices];
+ }
return result;
}