From Gregory Jaegy and Robert Osfield, added support for static linking of OpenFlight plugin

This commit is contained in:
Robert Osfield 2009-05-28 13:29:20 +00:00
parent d06265b782
commit 07cf3ecd11
11 changed files with 279 additions and 97 deletions

View File

@ -84,7 +84,8 @@ class Comment : public Record
} }
}; };
RegisterRecordProxy<Comment> g_Comment(COMMENT_OP); REGISTER_FLTRECORD(Comment, COMMENT_OP)
/** LongID - /** LongID -
@ -111,7 +112,8 @@ class LongID : public Record
} }
}; };
RegisterRecordProxy<LongID> g_LongID(LONG_ID_OP); REGISTER_FLTRECORD(LongID, LONG_ID_OP)
/** Matrix - /** Matrix -
@ -150,7 +152,8 @@ class Matrix : public Record
} }
}; };
RegisterRecordProxy<Matrix> g_Matrix(MATRIX_OP); REGISTER_FLTRECORD(Matrix, MATRIX_OP)
/** Multitexture - /** Multitexture -
@ -228,7 +231,8 @@ class Multitexture : public Record
} }
}; };
RegisterRecordProxy<Multitexture> g_Multitexture(MULTITEXTURE_OP); REGISTER_FLTRECORD(Multitexture, MULTITEXTURE_OP)
/** UVList - Texture coordinates used with multitexture. /** UVList - Texture coordinates used with multitexture.
@ -284,7 +288,7 @@ class UVList : public Record
} }
}; };
RegisterRecordProxy<UVList> g_UVList(UV_LIST_OP); REGISTER_FLTRECORD(UVList, UV_LIST_OP)
/** Replicate - /** Replicate -
@ -310,38 +314,38 @@ class Replicate : public Record
} }
}; };
RegisterRecordProxy<Replicate> g_Replicate(REPLICATE_OP); REGISTER_FLTRECORD(Replicate, REPLICATE_OP)
// Prevent "unknown record" message for the following ancillary records: // Prevent "unknown record" message for the following ancillary records:
RegisterRecordProxy<DummyRecord> g_OldTranslate(OLD_TRANSLATE2_OP); REGISTER_FLTRECORD(DummyRecord, OLD_TRANSLATE2_OP)
RegisterRecordProxy<DummyRecord> g_OldRotateAboutPoint(OLD_ROTATE_ABOUT_POINT_OP); REGISTER_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_POINT_OP)
RegisterRecordProxy<DummyRecord> g_OldRotateAboutEdge(OLD_ROTATE_ABOUT_EDGE_OP); REGISTER_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_EDGE_OP)
RegisterRecordProxy<DummyRecord> g_OldScale(OLD_SCALE_OP); REGISTER_FLTRECORD(DummyRecord, OLD_SCALE_OP)
RegisterRecordProxy<DummyRecord> g_OldTranslate2(OLD_TRANSLATE_OP); REGISTER_FLTRECORD(DummyRecord, OLD_TRANSLATE_OP)
RegisterRecordProxy<DummyRecord> g_OldNonuniformScale(OLD_NONUNIFORM_SCALE_OP); REGISTER_FLTRECORD(DummyRecord, OLD_NONUNIFORM_SCALE_OP)
RegisterRecordProxy<DummyRecord> g_OldRotateAboutPoint2(OLD_ROTATE_ABOUT_POINT2_OP); REGISTER_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_POINT2_OP)
RegisterRecordProxy<DummyRecord> g_OldRotateScaleToPoint(OLD_ROTATE_SCALE_TO_POINT_OP); REGISTER_FLTRECORD(DummyRecord, OLD_ROTATE_SCALE_TO_POINT_OP)
RegisterRecordProxy<DummyRecord> g_OldPutTransform(OLD_PUT_TRANSFORM_OP); REGISTER_FLTRECORD(DummyRecord, OLD_PUT_TRANSFORM_OP)
RegisterRecordProxy<DummyRecord> g_OldBoundingBox(OLD_BOUNDING_BOX_OP); REGISTER_FLTRECORD(DummyRecord, OLD_BOUNDING_BOX_OP)
RegisterRecordProxy<DummyRecord> g_IndexedString(INDEXED_STRING_OP); REGISTER_FLTRECORD(DummyRecord, INDEXED_STRING_OP)
RegisterRecordProxy<DummyRecord> g_RoadZone(ROAD_ZONE_OP); REGISTER_FLTRECORD(DummyRecord, ROAD_ZONE_OP)
RegisterRecordProxy<DummyRecord> g_RotateAboutEdge(ROTATE_ABOUT_EDGE_OP); REGISTER_FLTRECORD(DummyRecord, ROTATE_ABOUT_EDGE_OP)
RegisterRecordProxy<DummyRecord> g_Translate(TRANSLATE_OP); REGISTER_FLTRECORD(DummyRecord, TRANSLATE_OP)
RegisterRecordProxy<DummyRecord> g_Scale(NONUNIFORM_SCALE_OP); REGISTER_FLTRECORD(DummyRecord, NONUNIFORM_SCALE_OP)
RegisterRecordProxy<DummyRecord> g_RotateAboutPoint(ROTATE_ABOUT_POINT_OP); REGISTER_FLTRECORD(DummyRecord, ROTATE_ABOUT_POINT_OP)
RegisterRecordProxy<DummyRecord> g_RotateScaleToPoint(ROTATE_SCALE_TO_POINT_OP); REGISTER_FLTRECORD(DummyRecord, ROTATE_SCALE_TO_POINT_OP)
RegisterRecordProxy<DummyRecord> g_PutTransform(PUT_TRANSFORM_OP); REGISTER_FLTRECORD(DummyRecord, PUT_TRANSFORM_OP)
RegisterRecordProxy<DummyRecord> g_GeneralMatrix(GENERAL_MATRIX_OP); REGISTER_FLTRECORD(DummyRecord, GENERAL_MATRIX_OP)
RegisterRecordProxy<DummyRecord> g_Vector(VECTOR_OP); REGISTER_FLTRECORD(DummyRecord, VECTOR_OP)
RegisterRecordProxy<DummyRecord> g_BoundingBox(BOUNDING_BOX_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_BOX_OP)
RegisterRecordProxy<DummyRecord> g_BoundingSphere(BOUNDING_SPHERE_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_SPHERE_OP)
RegisterRecordProxy<DummyRecord> g_BoundingCylinder(BOUNDING_CYLINDER_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_CYLINDER_OP)
RegisterRecordProxy<DummyRecord> g_BoundingConvexHull(BOUNDING_CONVEX_HULL_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_CONVEX_HULL_OP)
RegisterRecordProxy<DummyRecord> g_BoundingHistogram(BOUNDING_HISTOGRAM); REGISTER_FLTRECORD(DummyRecord, BOUNDING_HISTOGRAM)
RegisterRecordProxy<DummyRecord> g_BoundingVolumeCenter(BOUNDING_VOLUME_CENTER_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_VOLUME_CENTER_OP)
RegisterRecordProxy<DummyRecord> g_BoundingVolumeOrientation(BOUNDING_VOLUME_ORIENTATION_OP); REGISTER_FLTRECORD(DummyRecord, BOUNDING_VOLUME_ORIENTATION_OP)
RegisterRecordProxy<DummyRecord> g_HistogramBoundingVolume(HISTOGRAM_BOUNDING_VOLUME_OP); REGISTER_FLTRECORD(DummyRecord, HISTOGRAM_BOUNDING_VOLUME_OP)
} // end namespace } // end namespace

View File

@ -48,7 +48,8 @@ class PushLevel : public Record
virtual ~PushLevel() {} virtual ~PushLevel() {}
}; };
RegisterRecordProxy<PushLevel> g_PushLevel(PUSH_LEVEL_OP); REGISTER_FLTRECORD(PushLevel, PUSH_LEVEL_OP)
/** PophLevel /** PophLevel
@ -86,7 +87,8 @@ class PopLevel : public Record
virtual ~PopLevel() {} virtual ~PopLevel() {}
}; };
RegisterRecordProxy<PopLevel> g_PopLevel(POP_LEVEL_OP); REGISTER_FLTRECORD(PopLevel, POP_LEVEL_OP)
/** PushSubface /** PushSubface
@ -109,7 +111,8 @@ class PushSubface : public Record
virtual ~PushSubface() {} virtual ~PushSubface() {}
}; };
RegisterRecordProxy<PushSubface> g_PushSubface(PUSH_SUBFACE_OP); REGISTER_FLTRECORD(PushSubface, PUSH_SUBFACE_OP)
/** PopSubface /** PopSubface
@ -132,7 +135,8 @@ class PopSubface : public Record
virtual ~PopSubface() {} virtual ~PopSubface() {}
}; };
RegisterRecordProxy<PopSubface> g_PopSubface(POP_SUBFACE_OP); REGISTER_FLTRECORD(PopSubface, POP_SUBFACE_OP)
/** PushExtension /** PushExtension
@ -156,7 +160,8 @@ class PushExtension : public Record
virtual ~PushExtension() {} virtual ~PushExtension() {}
}; };
RegisterRecordProxy<PushExtension> g_PushExtension(PUSH_EXTENSION_OP); REGISTER_FLTRECORD(PushExtension, PUSH_EXTENSION_OP)
/** PopExtension /** PopExtension
@ -180,7 +185,8 @@ class PopExtension : public Record
virtual ~PopExtension() {} virtual ~PopExtension() {}
}; };
RegisterRecordProxy<PopExtension> g_PopExtension(POP_EXTENSION_OP); REGISTER_FLTRECORD(PopExtension, POP_EXTENSION_OP)
/** PushAttribute - Reserved subtree /** PushAttribute - Reserved subtree
@ -203,7 +209,8 @@ class PushAttribute : public Record
virtual ~PushAttribute() {} virtual ~PushAttribute() {}
}; };
RegisterRecordProxy<PushAttribute> g_PushAttribute(PUSH_ATTRIBUTE_OP); REGISTER_FLTRECORD(PushAttribute, PUSH_ATTRIBUTE_OP)
/** PopAttribute /** PopAttribute
@ -226,7 +233,8 @@ class PopAttribute : public Record
virtual ~PopAttribute() {} virtual ~PopAttribute() {}
}; };
RegisterRecordProxy<PopAttribute> g_PopAttribute(POP_ATTRIBUTE_OP); REGISTER_FLTRECORD(PopAttribute, POP_ATTRIBUTE_OP)
} // end namespace } // end namespace

View File

@ -536,7 +536,8 @@ protected:
} }
}; };
RegisterRecordProxy<Face> g_Face(FACE_OP); REGISTER_FLTRECORD(Face, FACE_OP)
/** VertexList - /** VertexList -
@ -592,7 +593,8 @@ protected:
}; };
RegisterRecordProxy<VertexListRecord> g_VertexList(VERTEX_LIST_OP); REGISTER_FLTRECORD(VertexListRecord, VERTEX_LIST_OP)
/** MorphVertexList - /** MorphVertexList -
@ -681,7 +683,8 @@ protected:
} }
}; };
RegisterRecordProxy<MorphVertexList> g_MorphVertexList(MORPH_VERTEX_LIST_OP); REGISTER_FLTRECORD(MorphVertexList, MORPH_VERTEX_LIST_OP)
/* Mesh record /* Mesh record
@ -1016,7 +1019,8 @@ protected:
} }
}; };
RegisterRecordProxy<Mesh> g_Mesh(MESH_OP); REGISTER_FLTRECORD(Mesh, MESH_OP)
@ -1133,7 +1137,8 @@ protected:
} }
}; };
RegisterRecordProxy<LocalVertexPool> g_LocalVertexPool(LOCAL_VERTEX_POOL_OP); REGISTER_FLTRECORD(LocalVertexPool, LOCAL_VERTEX_POOL_OP)
@ -1271,7 +1276,8 @@ protected:
} }
}; };
RegisterRecordProxy<MeshPrimitive> g_MeshPrimitive(MESH_PRIMITIVE_OP); REGISTER_FLTRECORD(MeshPrimitive, MESH_PRIMITIVE_OP)
} // end namespace } // end namespace

View File

@ -234,7 +234,8 @@ protected:
} }
}; };
RegisterRecordProxy<LightPoint> g_LightPoint(LIGHT_POINT_OP); REGISTER_FLTRECORD(LightPoint, LIGHT_POINT_OP)
/** IndexedLightPoint /** IndexedLightPoint
@ -416,7 +417,8 @@ protected:
} }
}; };
RegisterRecordProxy<IndexedLightPoint> g_IndexedLightPoint(INDEXED_LIGHT_POINT_OP); REGISTER_FLTRECORD(IndexedLightPoint, INDEXED_LIGHT_POINT_OP)
/** LightPointSystem /** LightPointSystem
@ -508,5 +510,6 @@ protected:
} }
}; };
RegisterRecordProxy<LightPointSystem> g_LightPointSystem(LIGHT_POINT_SYSTEM_OP); REGISTER_FLTRECORD(LightPointSystem, LIGHT_POINT_SYSTEM_OP)

View File

@ -60,7 +60,8 @@ protected:
} }
}; };
RegisterRecordProxy<VertexPalette> g_VertexPalette(VERTEX_PALETTE_OP); REGISTER_FLTRECORD(VertexPalette, VERTEX_PALETTE_OP)
class ColorPalette : public Record class ColorPalette : public Record
@ -140,7 +141,8 @@ protected:
}; };
RegisterRecordProxy<ColorPalette> g_ColorPalette(COLOR_PALETTE_OP); REGISTER_FLTRECORD(ColorPalette, COLOR_PALETTE_OP)
class NameTable : public Record class NameTable : public Record
@ -160,7 +162,8 @@ protected:
} }
}; };
RegisterRecordProxy<NameTable> g_NameTable(NAME_TABLE_OP); REGISTER_FLTRECORD(NameTable, NAME_TABLE_OP)
class MaterialPalette : public Record class MaterialPalette : public Record
@ -204,7 +207,8 @@ protected:
} }
}; };
RegisterRecordProxy<MaterialPalette> g_MaterialPalette(MATERIAL_PALETTE_OP); REGISTER_FLTRECORD(MaterialPalette, MATERIAL_PALETTE_OP)
class OldMaterialPalette : public Record class OldMaterialPalette : public Record
@ -251,7 +255,8 @@ protected:
}; };
RegisterRecordProxy<OldMaterialPalette> g_OldMaterialPalette(OLD_MATERIAL_PALETTE_OP); REGISTER_FLTRECORD(OldMaterialPalette, OLD_MATERIAL_PALETTE_OP)
class TexturePalette : public Record class TexturePalette : public Record
@ -466,7 +471,8 @@ protected:
} }
}; };
RegisterRecordProxy<TexturePalette> g_TexturePalette(TEXTURE_PALETTE_OP); REGISTER_FLTRECORD(TexturePalette, TEXTURE_PALETTE_OP)
class EyepointAndTrackplanePalette : public Record class EyepointAndTrackplanePalette : public Record
@ -484,7 +490,8 @@ protected:
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {} virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
}; };
RegisterRecordProxy<EyepointAndTrackplanePalette> g_EyepointAndTrackplanePalette(EYEPOINT_AND_TRACKPLANE_PALETTE_OP); REGISTER_FLTRECORD(EyepointAndTrackplanePalette, EYEPOINT_AND_TRACKPLANE_PALETTE_OP)
class LinkagePalette : public Record class LinkagePalette : public Record
@ -502,7 +509,8 @@ protected:
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {} virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
}; };
RegisterRecordProxy<LinkagePalette> g_LinkagePalette(LINKAGE_PALETTE_OP); REGISTER_FLTRECORD(LinkagePalette, LINKAGE_PALETTE_OP)
class SoundPalette : public Record class SoundPalette : public Record
@ -520,7 +528,8 @@ protected:
virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {} virtual void readRecord(RecordInputStream& /*in*/, Document& /*document*/) {}
}; };
RegisterRecordProxy<SoundPalette> g_SoundPalette(SOUND_PALETTE_OP); REGISTER_FLTRECORD(SoundPalette, SOUND_PALETTE_OP)
class LightSourcePalette : public Record class LightSourcePalette : public Record
@ -599,7 +608,8 @@ protected:
} }
}; };
RegisterRecordProxy<LightSourcePalette> g_LightSourcePalette(LIGHT_SOURCE_PALETTE_OP); REGISTER_FLTRECORD(LightSourcePalette, LIGHT_SOURCE_PALETTE_OP)
class LightPointAppearancePalette : public Record class LightPointAppearancePalette : public Record
@ -681,7 +691,8 @@ protected:
}; };
RegisterRecordProxy<LightPointAppearancePalette> g_LightPointAppearancePalette(LIGHT_POINT_APPEARANCE_PALETTE_OP); REGISTER_FLTRECORD(LightPointAppearancePalette, LIGHT_POINT_APPEARANCE_PALETTE_OP)
class LightPointAnimationPalette : public Record class LightPointAnimationPalette : public Record
@ -739,7 +750,8 @@ protected:
} }
}; };
RegisterRecordProxy<LightPointAnimationPalette> g_LightPointAnimationPalette(LIGHT_POINT_ANIMATION_PALETTE_OP); REGISTER_FLTRECORD(LightPointAnimationPalette, LIGHT_POINT_ANIMATION_PALETTE_OP)
class LineStylePalette : public Record class LineStylePalette : public Record
@ -759,7 +771,8 @@ protected:
} }
}; };
RegisterRecordProxy<LineStylePalette> g_LineStylePalette(LINE_STYLE_PALETTE_OP); REGISTER_FLTRECORD(LineStylePalette, LINE_STYLE_PALETTE_OP)
class TextureMappingPalette : public Record class TextureMappingPalette : public Record
@ -779,7 +792,8 @@ protected:
} }
}; };
RegisterRecordProxy<TextureMappingPalette> g_TextureMappingPalette(TEXTURE_MAPPING_PALETTE_OP); REGISTER_FLTRECORD(TextureMappingPalette, TEXTURE_MAPPING_PALETTE_OP)
class ShaderPalette : public Record class ShaderPalette : public Record
@ -876,7 +890,8 @@ protected:
} }
}; };
RegisterRecordProxy<ShaderPalette> g_ShaderPalette(SHADER_PALETTE_OP); REGISTER_FLTRECORD(ShaderPalette, SHADER_PALETTE_OP)
} // end namespace } // end namespace

View File

@ -153,7 +153,7 @@ protected:
} }
}; };
RegisterRecordProxy<Header> g_Header(HEADER_OP); REGISTER_FLTRECORD(Header, HEADER_OP)
/** Group /** Group
@ -292,7 +292,8 @@ protected:
} }
}; };
RegisterRecordProxy<Group> g_Group(GROUP_OP); REGISTER_FLTRECORD(Group, GROUP_OP)
/** DegreeOfFreedom /** DegreeOfFreedom
@ -457,7 +458,8 @@ protected:
} }
}; };
RegisterRecordProxy<DegreeOfFreedom> g_DegreeOfFreedom(DOF_OP); REGISTER_FLTRECORD(DegreeOfFreedom, DOF_OP)
/** LevelOfDetail - To recreate the LevelOfDetail record in OSG we have to create a LOD node with one Group node under it. /** LevelOfDetail - To recreate the LevelOfDetail record in OSG we have to create a LOD node with one Group node under it.
@ -513,7 +515,8 @@ protected:
}; };
RegisterRecordProxy<LevelOfDetail> g_LevelOfDetail(LOD_OP); REGISTER_FLTRECORD(LevelOfDetail, LOD_OP)
/** OldLevelOfDetail /** OldLevelOfDetail
@ -569,7 +572,8 @@ protected:
}; };
RegisterRecordProxy<OldLevelOfDetail> g_OldLevelOfDetail(OLD_LOD_OP); REGISTER_FLTRECORD(OldLevelOfDetail, OLD_LOD_OP)
/** Switch /** Switch
@ -645,7 +649,8 @@ protected:
} }
}; };
RegisterRecordProxy<Switch> g_Switch(SWITCH_OP); REGISTER_FLTRECORD(Switch, SWITCH_OP)
/** ExternalReference /** ExternalReference
@ -729,7 +734,8 @@ protected:
}; };
RegisterRecordProxy<ExternalReference> g_ExternalReference(EXTERNAL_REFERENCE_OP); REGISTER_FLTRECORD(ExternalReference, EXTERNAL_REFERENCE_OP)
/** InstanceDefinition /** InstanceDefinition
@ -778,7 +784,8 @@ protected:
}; };
RegisterRecordProxy<InstanceDefinition> g_InstanceDefinition(INSTANCE_DEFINITION_OP); REGISTER_FLTRECORD(InstanceDefinition, INSTANCE_DEFINITION_OP)
/** InstanceReference /** InstanceReference
@ -809,7 +816,8 @@ protected:
} }
}; };
RegisterRecordProxy<InstanceReference> g_InstanceReference(INSTANCE_REFERENCE_OP); REGISTER_FLTRECORD(InstanceReference, INSTANCE_REFERENCE_OP)
/** Extension /** Extension
@ -848,7 +856,8 @@ protected:
} }
}; };
RegisterRecordProxy<Extension> g_Extension(EXTENSION_OP); REGISTER_FLTRECORD(Extension, EXTENSION_OP)
/** Object /** Object
@ -952,7 +961,8 @@ protected:
}; };
RegisterRecordProxy<Object> g_Object(OBJECT_OP); REGISTER_FLTRECORD(Object, OBJECT_OP)
/** LightSource /** LightSource
@ -1035,7 +1045,8 @@ protected:
} }
}; };
RegisterRecordProxy<LightSource> g_LightSource(LIGHT_SOURCE_OP); REGISTER_FLTRECORD(LightSource, LIGHT_SOURCE_OP)
} // end namespace } // end namespace

View File

@ -40,6 +40,110 @@ using namespace flt;
using namespace osg; using namespace osg;
using namespace osgDB; using namespace osgDB;
// pull in symbols from attr plugin
USE_OSGPLUGIN(attr)
// pull in symbols from individual .o's to enable the static build to work
// note, following USE_FLTRECORD list was generated by running:
// grep REGISTER_FLTRECORD * -h | grep -v "#define" | sed 's/REGISTER_FLTRECORD/USE_FLTRECORD/g'
USE_FLTRECORD(Comment, COMMENT_OP)
USE_FLTRECORD(LongID, LONG_ID_OP)
USE_FLTRECORD(Matrix, MATRIX_OP)
USE_FLTRECORD(Multitexture, MULTITEXTURE_OP)
USE_FLTRECORD(UVList, UV_LIST_OP)
USE_FLTRECORD(Replicate, REPLICATE_OP)
USE_FLTRECORD(DummyRecord, OLD_TRANSLATE2_OP)
USE_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_POINT_OP)
USE_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_EDGE_OP)
USE_FLTRECORD(DummyRecord, OLD_SCALE_OP)
USE_FLTRECORD(DummyRecord, OLD_TRANSLATE_OP)
USE_FLTRECORD(DummyRecord, OLD_NONUNIFORM_SCALE_OP)
USE_FLTRECORD(DummyRecord, OLD_ROTATE_ABOUT_POINT2_OP)
USE_FLTRECORD(DummyRecord, OLD_ROTATE_SCALE_TO_POINT_OP)
USE_FLTRECORD(DummyRecord, OLD_PUT_TRANSFORM_OP)
USE_FLTRECORD(DummyRecord, OLD_BOUNDING_BOX_OP)
USE_FLTRECORD(DummyRecord, INDEXED_STRING_OP)
USE_FLTRECORD(DummyRecord, ROAD_ZONE_OP)
USE_FLTRECORD(DummyRecord, ROTATE_ABOUT_EDGE_OP)
USE_FLTRECORD(DummyRecord, TRANSLATE_OP)
USE_FLTRECORD(DummyRecord, NONUNIFORM_SCALE_OP)
USE_FLTRECORD(DummyRecord, ROTATE_ABOUT_POINT_OP)
USE_FLTRECORD(DummyRecord, ROTATE_SCALE_TO_POINT_OP)
USE_FLTRECORD(DummyRecord, PUT_TRANSFORM_OP)
USE_FLTRECORD(DummyRecord, GENERAL_MATRIX_OP)
USE_FLTRECORD(DummyRecord, VECTOR_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_BOX_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_SPHERE_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_CYLINDER_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_CONVEX_HULL_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_HISTOGRAM)
USE_FLTRECORD(DummyRecord, BOUNDING_VOLUME_CENTER_OP)
USE_FLTRECORD(DummyRecord, BOUNDING_VOLUME_ORIENTATION_OP)
USE_FLTRECORD(DummyRecord, HISTOGRAM_BOUNDING_VOLUME_OP)
USE_FLTRECORD(PushLevel, PUSH_LEVEL_OP)
USE_FLTRECORD(PopLevel, POP_LEVEL_OP)
USE_FLTRECORD(PushSubface, PUSH_SUBFACE_OP)
USE_FLTRECORD(PopSubface, POP_SUBFACE_OP)
USE_FLTRECORD(PushExtension, PUSH_EXTENSION_OP)
USE_FLTRECORD(PopExtension, POP_EXTENSION_OP)
USE_FLTRECORD(PushAttribute, PUSH_ATTRIBUTE_OP)
USE_FLTRECORD(PopAttribute, POP_ATTRIBUTE_OP)
USE_FLTRECORD(Face, FACE_OP)
USE_FLTRECORD(VertexListRecord, VERTEX_LIST_OP)
USE_FLTRECORD(MorphVertexList, MORPH_VERTEX_LIST_OP)
USE_FLTRECORD(Mesh, MESH_OP)
USE_FLTRECORD(LocalVertexPool, LOCAL_VERTEX_POOL_OP)
USE_FLTRECORD(MeshPrimitive, MESH_PRIMITIVE_OP)
USE_FLTRECORD(LightPoint, LIGHT_POINT_OP)
USE_FLTRECORD(IndexedLightPoint, INDEXED_LIGHT_POINT_OP)
USE_FLTRECORD(LightPointSystem, LIGHT_POINT_SYSTEM_OP)
USE_FLTRECORD(VertexPalette, VERTEX_PALETTE_OP)
USE_FLTRECORD(ColorPalette, COLOR_PALETTE_OP)
USE_FLTRECORD(NameTable, NAME_TABLE_OP)
USE_FLTRECORD(MaterialPalette, MATERIAL_PALETTE_OP)
USE_FLTRECORD(OldMaterialPalette, OLD_MATERIAL_PALETTE_OP)
USE_FLTRECORD(TexturePalette, TEXTURE_PALETTE_OP)
USE_FLTRECORD(EyepointAndTrackplanePalette, EYEPOINT_AND_TRACKPLANE_PALETTE_OP)
USE_FLTRECORD(LinkagePalette, LINKAGE_PALETTE_OP)
USE_FLTRECORD(SoundPalette, SOUND_PALETTE_OP)
USE_FLTRECORD(LightSourcePalette, LIGHT_SOURCE_PALETTE_OP)
USE_FLTRECORD(LightPointAppearancePalette, LIGHT_POINT_APPEARANCE_PALETTE_OP)
USE_FLTRECORD(LightPointAnimationPalette, LIGHT_POINT_ANIMATION_PALETTE_OP)
USE_FLTRECORD(LineStylePalette, LINE_STYLE_PALETTE_OP)
USE_FLTRECORD(TextureMappingPalette, TEXTURE_MAPPING_PALETTE_OP)
USE_FLTRECORD(ShaderPalette, SHADER_PALETTE_OP)
USE_FLTRECORD(Header, HEADER_OP)
USE_FLTRECORD(Group, GROUP_OP)
USE_FLTRECORD(DegreeOfFreedom, DOF_OP)
USE_FLTRECORD(LevelOfDetail, LOD_OP)
USE_FLTRECORD(OldLevelOfDetail, OLD_LOD_OP)
USE_FLTRECORD(Switch, SWITCH_OP)
USE_FLTRECORD(ExternalReference, EXTERNAL_REFERENCE_OP)
USE_FLTRECORD(InstanceDefinition, INSTANCE_DEFINITION_OP)
USE_FLTRECORD(InstanceReference, INSTANCE_REFERENCE_OP)
USE_FLTRECORD(Extension, EXTENSION_OP)
USE_FLTRECORD(Object, OBJECT_OP)
USE_FLTRECORD(LightSource, LIGHT_SOURCE_OP)
USE_FLTRECORD(DummyRecord, 103)
USE_FLTRECORD(DummyRecord, 104)
USE_FLTRECORD(DummyRecord, 117)
USE_FLTRECORD(DummyRecord, 118)
USE_FLTRECORD(DummyRecord, 120)
USE_FLTRECORD(DummyRecord, 121)
USE_FLTRECORD(DummyRecord, 124)
USE_FLTRECORD(DummyRecord, 125)
USE_FLTRECORD(RoadSegment, ROAD_SEGMENT_OP)
USE_FLTRECORD(RoadConstruction, ROAD_CONSTRUCTION_OP)
USE_FLTRECORD(RoadPath, ROAD_PATH_OP)
USE_FLTRECORD(VertexC, VERTEX_C_OP)
USE_FLTRECORD(VertexCN, VERTEX_CN_OP)
USE_FLTRECORD(VertexCT, VERTEX_CT_OP)
USE_FLTRECORD(VertexCNT, VERTEX_CNT_OP)
USE_FLTRECORD(AbsoluteVertex, OLD_ABSOLUTE_VERTEX_OP)
USE_FLTRECORD(ShadedVertex, OLD_SHADED_VERTEX_OP)
USE_FLTRECORD(NormalVertex, OLD_NORMAL_VERTEX_OP)
class ReadExternalsVisitor : public osg::NodeVisitor class ReadExternalsVisitor : public osg::NodeVisitor
{ {

View File

@ -122,6 +122,27 @@ class RegisterRecordProxy
~RegisterRecordProxy() {} ~RegisterRecordProxy() {}
}; };
//////////////////////////////////////////////////////////////////////////
extern "C"
{
typedef void (* CRecordFunction) (void);
}
struct RecordFunctionProxy
{
RecordFunctionProxy(CRecordFunction function) { (function)(); }
};
#define USE_FLTRECORD(recname, opcode) \
extern "C" void osgfltrec_##recname_##opcode(void); \
static flt::RecordFunctionProxy proxy_fltrecord_##recname_##opcode(osgfltrec_##recname_##opcode);
#define REGISTER_FLTRECORD(recname, opcode) \
extern "C" void osgfltrec_##recname_##opcode(void) {} \
static flt::RegisterRecordProxy<recname> g_proxy_fltrecord_##recname_##opcode(opcode);
} // end namespace } // end namespace
#endif #endif

View File

@ -22,14 +22,15 @@
using namespace flt; using namespace flt;
// Prevent "unknown record" message for the following reserved records: // Prevent "unknown record" message for the following reserved records:
RegisterRecordProxy<DummyRecord> g_Reserved_103(103); REGISTER_FLTRECORD(DummyRecord, 103)
RegisterRecordProxy<DummyRecord> g_Reserved_104(104); REGISTER_FLTRECORD(DummyRecord, 104)
RegisterRecordProxy<DummyRecord> g_Reserved_117(117); REGISTER_FLTRECORD(DummyRecord, 117)
RegisterRecordProxy<DummyRecord> g_Reserved_118(118); REGISTER_FLTRECORD(DummyRecord, 118)
RegisterRecordProxy<DummyRecord> g_Reserved_120(120); REGISTER_FLTRECORD(DummyRecord, 120)
RegisterRecordProxy<DummyRecord> g_Reserved_121(121); REGISTER_FLTRECORD(DummyRecord, 121)
RegisterRecordProxy<DummyRecord> g_Reserved_124(124); REGISTER_FLTRECORD(DummyRecord, 124)
RegisterRecordProxy<DummyRecord> g_Reserved_125(125); REGISTER_FLTRECORD(DummyRecord, 125)

View File

@ -60,7 +60,7 @@ class RoadSegment : public PrimaryRecord
} }
}; };
RegisterRecordProxy<RoadSegment> g_RoadSegment(ROAD_SEGMENT_OP); REGISTER_FLTRECORD(RoadSegment, ROAD_SEGMENT_OP)
/** RoadConstruction /** RoadConstruction
@ -98,7 +98,8 @@ class RoadConstruction : public PrimaryRecord
} }
}; };
RegisterRecordProxy<RoadConstruction> g_RoadConstruction(ROAD_CONSTRUCTION_OP); REGISTER_FLTRECORD(RoadConstruction, ROAD_CONSTRUCTION_OP)
/** RoadPath /** RoadPath
@ -132,7 +133,8 @@ class RoadPath : public PrimaryRecord
} }
}; };
RegisterRecordProxy<RoadPath> g_RoadPath(ROAD_PATH_OP); REGISTER_FLTRECORD(RoadPath, ROAD_PATH_OP)
} // end namespace } // end namespace

View File

@ -76,7 +76,8 @@ class VertexC : public Record
} }
}; };
RegisterRecordProxy<VertexC> g_VertexC(VERTEX_C_OP); REGISTER_FLTRECORD(VertexC, VERTEX_C_OP)
class VertexCN : public Record class VertexCN : public Record
@ -115,7 +116,8 @@ class VertexCN : public Record
} }
}; };
RegisterRecordProxy<VertexCN> g_VertexCN(VERTEX_CN_OP); REGISTER_FLTRECORD(VertexCN, VERTEX_CN_OP)
class VertexCT : public Record class VertexCT : public Record
@ -154,7 +156,8 @@ class VertexCT : public Record
} }
}; };
RegisterRecordProxy<VertexCT> g_VertexCT(VERTEX_CT_OP); REGISTER_FLTRECORD(VertexCT, VERTEX_CT_OP)
class VertexCNT : public Record class VertexCNT : public Record
@ -211,7 +214,8 @@ class VertexCNT : public Record
} }
}; };
RegisterRecordProxy<VertexCNT> g_VertexCNT(VERTEX_CNT_OP); REGISTER_FLTRECORD(VertexCNT, VERTEX_CNT_OP)
/** Absolute Vertex - /** Absolute Vertex -
@ -252,7 +256,8 @@ class AbsoluteVertex : public Record
} }
}; };
RegisterRecordProxy<AbsoluteVertex> g_AbsoluteVertex(OLD_ABSOLUTE_VERTEX_OP); REGISTER_FLTRECORD(AbsoluteVertex, OLD_ABSOLUTE_VERTEX_OP)
/** Shaded Vertex /** Shaded Vertex
@ -300,7 +305,8 @@ class ShadedVertex : public Record
} }
}; };
RegisterRecordProxy<ShadedVertex> g_ShadedVertex(OLD_SHADED_VERTEX_OP); REGISTER_FLTRECORD(ShadedVertex, OLD_SHADED_VERTEX_OP)
/** Normal Vertex /** Normal Vertex
@ -348,6 +354,7 @@ class NormalVertex : public Record
} }
}; };
RegisterRecordProxy<NormalVertex> g_NormalVertex(OLD_NORMAL_VERTEX_OP); REGISTER_FLTRECORD(NormalVertex, OLD_NORMAL_VERTEX_OP)
} // end namespace } // end namespace