Exemple #1
0
void InspectReflect::Initialize()
{
    if ( g_InspectReflectInitStack.Increment() == 1 )
    {
        g_InspectReflectInitStack.Push( Inspect::Initialize, Inspect::Cleanup );

        // scalars
        ReflectFieldInterpreterFactory::Register<ReflectBitfieldInterpreter>( Reflect::GetClass<Reflect::BitfieldData>() );
        ReflectFieldInterpreterFactory::Register<ReflectVectorInterpreter>( Reflect::GetClass<Reflect::Vector2Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectVectorInterpreter>( Reflect::GetClass<Reflect::Vector3Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectVectorInterpreter>( Reflect::GetClass<Reflect::Vector4Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectColorInterpreter>( Reflect::GetClass<Reflect::Color3Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectColorInterpreter>( Reflect::GetClass<Reflect::HDRColor3Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectColorInterpreter>( Reflect::GetClass<Reflect::Color4Data>() );
        ReflectFieldInterpreterFactory::Register<ReflectColorInterpreter>( Reflect::GetClass<Reflect::HDRColor4Data>() );

        // containers
        ReflectFieldInterpreterFactory::Register<ReflectStlVectorInterpreter>( Reflect::GetClass<Reflect::StlVectorData>() );
        ReflectFieldInterpreterFactory::Register<ReflectStlSetInterpreter>( Reflect::GetClass<Reflect::StlSetData>() );

        // paths
        ReflectFieldInterpreterFactory::Register<PathInterpreter>( Reflect::GetClass<Reflect::PathData>() );
        ReflectFieldInterpreterFactory::Register<PathContainerInterpreter>( Reflect::GetClass<Reflect::PathStlVectorData>() );
        ReflectFieldInterpreterFactory::Register<PathContainerInterpreter>( Reflect::GetClass<Reflect::PathStlSetData>() );
    }
}
void Editor::Initialize()
{
	if ( g_EditorSceneInitStack.Increment() == 1 )
	{
		// core library initiailization
		g_EditorSceneInitStack.Push( PropertiesGenerator::Initialize, PropertiesGenerator::Cleanup );
	}
}
Exemple #3
0
void InspectFile::Initialize()
{
  if ( ++g_InitCount == 1 )
  {
    Inspect::Initialize();

    g_RegisteredTypes.Push( Reflect::RegisterClassType<FileDialogButton>( TXT( "InspectFileDialogButton" ) ) );
    g_RegisteredTypes.Push( Reflect::RegisterClassType<FileBrowserButton>( TXT( "InspectFileBrowserButton" ) ) );

    ReflectFieldInterpreterFactory::Register<FileContainerInterpreter>( Reflect::GetType<Reflect::StringArraySerializer>(), Reflect::FieldFlags::FilePath );
    ReflectFieldInterpreterFactory::Register<FileInterpreter>( Reflect::GetType<Reflect::StringSerializer>(), Reflect::FieldFlags::FilePath );
  }
}
Exemple #4
0
void Content::Cleanup()
{
    if ( --g_InitCount == 0 )
    {
        g_InitializerStack.Cleanup();
    }
}
Exemple #5
0
void InspectReflect::Cleanup()
{
    if ( g_InspectReflectInitStack.Decrement() == 0 )
    {
        ReflectFieldInterpreterFactory::Clear();
    }
}
Exemple #6
0
void InspectFile::Cleanup()
{
  if ( --g_InitCount == 0 )
  {
    g_RegisteredTypes.Cleanup();
    Inspect::Cleanup();
  }
}
Exemple #7
0
void Asset::Cleanup()
{
    if ( --g_AssetInitCount == 0 )
    {
        for ( std::vector< AssetFactory* >::iterator itr = g_AssetFactories.begin(), end = g_AssetFactories.end(); itr != end; ++itr )
        {
            AssetClass::UnregisterFactory( (*itr) );
            delete (*itr);
        }
        g_AssetFactories.clear();

        g_AssetClassTypes.clear();

        g_AssetInitializerStack.Cleanup();
    }
}
Exemple #8
0
void Helium::CoreInitialize()
{
    if ( g_CoreInitStack.Increment() == 1 )
    {
        g_CoreInitStack.Push( &Asset::Initialize,       &Asset::Cleanup );

        g_CoreInitStack.Push( Reflect::RegisterStructureType< TestStructure >( TXT( "TestStructure" ) ) );
        g_CoreInitStack.Push( Reflect::RegisterClassType< Project >( TXT( "Project" ) ) );
        g_CoreInitStack.Push( Reflect::RegisterClassType< Settings >( TXT( "Settings" ) ) ); 
        g_CoreInitStack.Push( Reflect::RegisterClassType< SettingsManager >( TXT( "SettingsManager" ) ) ); 

        g_CoreInitStack.Push( &SceneGraph::Initialize,  &SceneGraph::Cleanup );
    }
}
void Editor::Cleanup()
{
	g_EditorSceneInitStack.Decrement();
}
Exemple #10
0
void Asset::Initialize()
{
    if ( ++g_AssetInitCount == 1 )
    {
        g_AssetInitializerStack.Push( Reflect::Initialize, Reflect::Cleanup );
        g_AssetInitializerStack.Push( Component::Initialize, Component::Cleanup );
        g_AssetInitializerStack.Push( Content::Initialize, Content::Cleanup );

        //
        // Enums
        //

        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< TextureFilters::TextureFilter >( &TextureFilters::TextureFilterEnumerateEnum, TXT( "TextureFilter" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< WrapModes::WrapMode >( &WrapModes::WrapModeEnumerateEnum, TXT( "WrapMode" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< AlphaTypes::AlphaType >( &AlphaTypes::AlphaTypeEnumerateEnum, TXT( "AlphaType" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< WetSurfaceTypes::WetSurfaceType >( &WetSurfaceTypes::WetSurfaceTypeEnumerateEnum, TXT( "WetSurfaceType" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< MipGenFilterTypes::MipGenFilterType >( &MipGenFilterTypes::MipGenFilterTypeEnumerateEnum, TXT( "MipGenFilterType" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< PostMipFilterTypes::PostMipFilterType >( &PostMipFilterTypes::PostMipFilterTypeEnumerateEnum, TXT( "PostMipFilterType" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< ReductionRatios::ReductionRatio >( &ReductionRatios::ReductionRatioEnumerateEnum, TXT( "ReductionRatio" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< AnimationClipModes::AnimationClipMode >( &AnimationClipModes::AnimationClipModeEnumerateEnum, TXT( "AnimationClipMode" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType< AudioClipModes::AudioClipMode >( &AudioClipModes::AudioClipModeEnumerateEnum, TXT( "AudioClipMode" ) ) );

        //
        // Basic Types
        //

        g_AssetInitializerStack.Push( Reflect::RegisterClassType<AssetClass>( TXT( "AssetClass" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<ManifestVersion>( TXT( "ManifestVersion" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<AssetManifest>( TXT( "AssetManifest" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<EntityManifest>( TXT( "EntityManifest" ) ) ); Reflect::Registry::GetInstance()->AliasType( Reflect::GetClass< EntityManifest >(), TXT( "AssetManifest" ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<SceneManifest>( TXT( "SceneManifest" ) ) );


        //
        // Misc
        //

        // texture
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType<TextureWrapModes::TextureWrapMode>( &TextureWrapModes::TextureWrapModeEnumerateEnum, TXT( "TextureWrapMode" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType<TextureColorFormats::TextureColorFormat>( &TextureColorFormats::TextureColorFormatEnumerateEnum, TXT( "TextureColorFormat" ) ) );

        //
        // Components
        //

        g_AssetInitializerStack.Push( Reflect::RegisterClassType<DependenciesComponent>( TXT( "DependenciesComponent" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType<MeshCompressionFactor>( &MeshCompressionFactors::MeshComressionFactorEnumerateEnum, TXT("MeshCompressionFactor") ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<MeshProcessingComponent>( TXT( "MeshProcessingComponent" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType<TextureDataFormat>( &TextureDataFormats::TextureDataFormatEnumerateEnum, TXT("TextureDataFormat") ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<TextureProcessingComponent>( TXT( "TextureProcessingComponent" ) ) );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<TransformComponent>( TXT( "TransformComponent" ) ) );


        //
        // Asset classes
        //

        g_AssetInitializerStack.Push( Reflect::RegisterClassType<ShaderAsset>( TXT( "ShaderAsset" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType< ShaderAsset >() );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<Entity>( TXT( "Entity" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType<Entity>() );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<SceneAsset>( TXT( "SceneAsset" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType<SceneAsset>() );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<Texture>( TXT( "Texture" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType<Texture>() );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<AnimationClip>( TXT( "AnimationClip" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType<AnimationClip>() );
        g_AssetInitializerStack.Push( Reflect::RegisterClassType<AudioClip>( TXT( "AudioClip" ) ) );
        g_AssetClassTypes.push_back( Reflect::GetType<AudioClip>() );

        /////////////////////////////////////////////////////////////
        // Support for engine types

        // we build up entity classes that consist of all the attributes
        // necessary for the given type.  these are then used in the
        // Classify function to determine what kind of engine type the
        // entity class maps to.  (ie: an entity class maps to the
        // smallest superset)

        /*
        ASSET_BEGIN_REGISTER_ENGINE_TYPES;
        {
        // Null == -1
        g_AssetTypeInfos.insert( M_AssetTypeInfo::value_type( AssetTypes::Null, Asset::GetAssetTypeInfo( AssetTypes::Null ) ) );

        // Level
        ASSET_REGISTER_ENGINETYPE( Level );
        ASSET_REGISTER_ENGINETYPE_ICONFILENAME( TXT( "enginetype_level" ) );
        ASSET_REGISTER_ENGINETYPE_TYPECOLOR_ARGB( 0xff, 142, 234, 251 );

        // Shader
        ASSET_REGISTER_ENGINETYPE( Shader );
        ASSET_REGISTER_ENGINETYPE_ICONFILENAME( TXT( "enginetype_shader" ) );
        ASSET_REGISTER_ENGINETYPE_TYPECOLOR_ARGB( 0xff, 57, 143, 202 );

        // TexturePack
        ASSET_REGISTER_ENGINETYPE( TexturePack );
        ASSET_REGISTER_ENGINETYPE_BUILDERDLL( TXT( "TexturePackBuilder.dll" ) );
        ASSET_REGISTER_ENGINETYPE_ICONFILENAME( TXT( "enginetype_texturepack" ) );
        ASSET_REGISTER_ENGINETYPE_TYPECOLOR_ARGB( 0xff, 164, 93, 163 );
        }


        //
        // Enums
        //
        g_AssetInitializerStack.Push( Reflect::RegisterEnumType<Asset::AssetTypes::AssetType>( &Asset::AssetTypes::AssetTypeEnumerateEnum, TXT( "AssetType" ) ) );
        */
        // Above is for supporting engine types
        ///////////////////////////////////////////////////////////////

        g_AssetFactories.push_back( new MeshAssetFactory() );

        for ( std::vector< AssetFactory* >::iterator itr = g_AssetFactories.begin(), end = g_AssetFactories.end(); itr != end; ++itr )
        {
            for ( std::set< tstring >::const_iterator extensionItr = (*itr)->GetExtensions().begin(), extensionEnd = (*itr)->GetExtensions().end(); extensionItr != extensionEnd; ++extensionItr )
            {
                AssetClass::RegisterFactory( (*extensionItr), (*itr) );
            }
        }
    }
}
Exemple #11
0
void Content::Initialize()
{
    if ( ++g_InitCount == 1 )
    {
        g_InitializerStack.Push( Reflect::Initialize, Reflect::Cleanup );
        g_InitializerStack.Push( Component::Initialize, Component::Cleanup );

        g_InitializerStack.Push( Reflect::RegisterClassType<ContentVersion>( TXT( "ContentVersion" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<SceneNode>( TXT( "SceneNode" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<HierarchyNode>( TXT( "HierarchyNode" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Transform>( TXT( "Transform" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<PivotTransform>( TXT( "PivotTransform" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<JointTransform>( TXT( "JointTransform" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Instance>( TXT( "Instance" ) ) );

        g_InitializerStack.Push( Reflect::RegisterEnumType<VolumeShapes::VolumeShape>( &VolumeShapes::VolumeShapeEnumerateEnum, TXT( "VolumeShape" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Volume>( TXT( "Volume" ) ) );

        g_InitializerStack.Push( Reflect::RegisterEnumType<LocatorShapes::LocatorShape>( &LocatorShapes::LocatorShapeEnumerateEnum, TXT( "LocatorShape" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Locator>( TXT( "Locator" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Camera>( TXT( "Camera" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Layer>( TXT( "Layer" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<MorphTargetDelta>( TXT( "MorphTargetDelta" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<MorphTarget>( TXT( "MorphTarget" ) ) );

        g_InitializerStack.Push( Reflect::RegisterEnumType<Mesh::MeshOriginType>( &Mesh::MeshOriginTypeEnumeration, TXT( "MeshOriginType" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Mesh>( TXT( "Mesh" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Shader>( TXT( "Shader" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Influence>( TXT( "Influence" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Skin>( TXT( "Skin" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<Point>( TXT( "Point" ) ) );
        g_InitializerStack.Push( Reflect::RegisterEnumType<CurveTypes::CurveType>( &CurveTypes::CurveTypeEnumerateEnum, TXT( "CurveType" ) ) );
        g_InitializerStack.Push( Reflect::RegisterEnumType<ControlPointLabels::ControlPointLabel>( &ControlPointLabels::ControlPointLabelEnumerateEnum, TXT( "ControlPointLabel" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Curve>( TXT( "Curve" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<MorphTargetWeight>( TXT( "MorphTargetWeight" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<FrameMorphTargets>( TXT( "FrameMorphTargets" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<FrameWrinkleMap>( TXT( "FrameWrinkleMap" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<CompressedJointAnimation>( TXT( "CompressedJointAnimation" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<JointAnimation>( TXT( "JointAnimation" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Animation>( TXT( "Animation" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<ParametricKey>( TXT( "ParametricKey" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<ParametricColorKey>( TXT( "ParametricColorKey" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<ParametricIntensityKey>( TXT( "ParametricIntensityKey" ) ) );

        // lights
        g_InitializerStack.Push( Reflect::RegisterEnumType<LightTypes::LightType>( &LightTypes::LightTypeEnumerateEnum, TXT( "LightType" ) ) );
        g_InitializerStack.Push( Reflect::RegisterEnumType<LightRenderTypes::LightRenderType>( &LightRenderTypes::LightRenderTypeEnumerateEnum, TXT( "LightRenderType" ) ) );
        g_InitializerStack.Push( Reflect::RegisterEnumType<LensFlareTypes::LensFlareType>( &LensFlareTypes::LensFlareTypeEnumerateEnum, TXT( "LensFlareType" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<Light>( TXT( "Light" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<SpotLight>( TXT( "SpotLight" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<PointLight>( TXT( "PointLight" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<DirectionalLight>( TXT( "DirectionalLight" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<AmbientLight>( TXT( "AmbientLight" ) ) );

        g_InitializerStack.Push( Reflect::RegisterClassType<JointOrdering>( TXT( "JointOrdering" ) ) );

        // Visibility
        g_InitializerStack.Push( Reflect::RegisterClassType<NodeVisibility>( TXT( "NodeVisibility" ) ) );
        g_InitializerStack.Push( Reflect::RegisterClassType<SceneVisibility>( TXT( "SceneVisibility" ) ) );
    }
}
Exemple #12
0
void Helium::CoreCleanup()
{
    g_CoreInitStack.Decrement();
}