Exemple #1
0
        public SFInitParams2(SFInitParams initParams)
        {
            TheASVersion         = (ASVersion)initParams.TheASVersion;
            InitVideo            = initParams.InitVideo;
            InitSound            = initParams.InitSound;
            TheVideoSoundSystem  = (VideoSoundSystem)initParams.TheVideoSoundSystem;
            IsInitIME            = initParams.IsInitIME;
            IsProgLoading        = (EnableAmpProfiling)initParams.IsProgLoading;
            IsSetFontCacheParams = initParams.SetFontCacheParams;
            IsEnableDynamicCache = initParams.IsEnableDynamicCache;
            SetFontPackParams    = initParams.SetFontPackParams;
            IsInitIME            = initParams.IsInitIME;
            ProgLoading          = (EnableProgressiveLoading)initParams.ProgLoading;

            TheFontCacheConfig.TextureHeight  = initParams.TheFontCacheConfig.TextureHeight;
            TheFontCacheConfig.TextureWidth   = initParams.TheFontCacheConfig.TextureWidth;
            TheFontCacheConfig.MaxNumTextures = initParams.TheFontCacheConfig.MaxNumTextures;
            TheFontCacheConfig.MaxSlotHeight  = initParams.TheFontCacheConfig.MaxSlotHeight;

            TheFontPackParams.NominalSize   = initParams.TheFontPackParams.NominalSize;
            TheFontPackParams.PadPixels     = initParams.TheFontPackParams.PadPixels;
            TheFontPackParams.TextureWidth  = initParams.TheFontPackParams.TextureWidth;
            TheFontPackParams.TextureHeight = initParams.TheFontPackParams.TextureHeight;

            SetFontPackParams = initParams.SetFontCacheParams;
            GlyphCountLimit   = initParams.GlyphCountLimit;
            SoundVolume       = initParams.SoundVolume;
            IsMute            = initParams.IsMute;
            Sentinal          = SFSentinal.Sentinal;
        }
Exemple #2
0
        public SFInitParams2(SFInitParams initParams)
        {
            TheASVersion                = (ASVersion)initParams.TheASVersion;
            InitVideo                   = initParams.InitVideo;
            InitSound                   = initParams.InitSound;
            TheVideoSoundSystem         = (VideoSoundSystem)initParams.TheVideoSoundSystem;
            IsInitIME                   = initParams.IsInitIME;
            AmpProfiling                = (EnableAmpProfiling)initParams.AmpProfiling;
            IsSetFontCacheParams        = initParams.SetFontCacheParams;
            IsEnableDynamicCache        = initParams.IsEnableDynamicCache;
            SetFontPackParams           = initParams.SetFontPackParams;
            IsInitIME                   = initParams.IsInitIME;
            UseDynamicShaderCompilation = initParams.UseDynamicShaderCompilation;
            ProgLoading                 = (EnableProgressiveLoading)initParams.ProgLoading;

            TheFontCacheConfig.TextureHeight  = initParams.TheFontCacheConfig.TextureHeight;
            TheFontCacheConfig.TextureWidth   = initParams.TheFontCacheConfig.TextureWidth;
            TheFontCacheConfig.MaxNumTextures = initParams.TheFontCacheConfig.MaxNumTextures;
            TheFontCacheConfig.MaxSlotHeight  = initParams.TheFontCacheConfig.MaxSlotHeight;

            TheFontPackParams.NominalSize   = initParams.TheFontPackParams.NominalSize;
            TheFontPackParams.PadPixels     = initParams.TheFontPackParams.PadPixels;
            TheFontPackParams.TextureWidth  = initParams.TheFontPackParams.TextureWidth;
            TheFontPackParams.TextureHeight = initParams.TheFontPackParams.TextureHeight;

            SetFontPackParams = initParams.SetFontCacheParams;
            GlyphCountLimit   = initParams.GlyphCountLimit;
            SoundVolume       = initParams.SoundVolume;
            IsMute            = initParams.IsMute;
            TheImageFormat    = initParams.TheImageFormat;

            TheToleranceParams.Epsilon                = initParams.TheToleranceParams.Epsilon;
            TheToleranceParams.CurveTolerance         = initParams.TheToleranceParams.CurveTolerance;
            TheToleranceParams.CollinearityTolerance  = initParams.TheToleranceParams.CollinearityTolerance;
            TheToleranceParams.IntersectionEpsilon    = initParams.TheToleranceParams.IntersectionEpsilon;
            TheToleranceParams.FillLowerScale         = initParams.TheToleranceParams.FillLowerScale;
            TheToleranceParams.FillUpperScale         = initParams.TheToleranceParams.FillUpperScale;
            TheToleranceParams.FillAliasedLowerScale  = initParams.TheToleranceParams.FillAliasedLowerScale;
            TheToleranceParams.FillAliasedUpperScale  = initParams.TheToleranceParams.FillAliasedUpperScale;
            TheToleranceParams.StrokeLowerScale       = initParams.TheToleranceParams.StrokeLowerScale;
            TheToleranceParams.StrokeUpperScale       = initParams.TheToleranceParams.StrokeUpperScale;
            TheToleranceParams.HintedStrokeLowerScale = initParams.TheToleranceParams.HintedStrokeLowerScale;
            TheToleranceParams.HintedStrokeUpperScale = initParams.TheToleranceParams.HintedStrokeUpperScale;
            TheToleranceParams.Scale9LowerScale       = initParams.TheToleranceParams.Scale9LowerScale;
            TheToleranceParams.Scale9UpperScale       = initParams.TheToleranceParams.Scale9UpperScale;
            TheToleranceParams.EdgeAAScale            = initParams.TheToleranceParams.EdgeAAScale;
            TheToleranceParams.MorphTolerance         = initParams.TheToleranceParams.MorphTolerance;
            TheToleranceParams.MinDet3D               = initParams.TheToleranceParams.MinDet3D;
            TheToleranceParams.MinScale3D             = initParams.TheToleranceParams.MinScale3D;

            UseSystemFontProvider = initParams.UseSystemFontProvider;
            Sentinal = SFSentinal.Sentinal;
        }
Exemple #3
0
        public SFManager(SFInitParams initParams)
        {
            SFInitParams2 initParams2    = new SFInitParams2(initParams);
            int           initParamsSize = Marshal.SizeOf(typeof(SFInitParams2));
            int           sfValueSize    = Marshal.SizeOf(typeof(Value));

            // initParams2.Print();
            IntPtr pdata = Marshal.AllocCoTaskMem(initParamsSize);

            Marshal.StructureToPtr(initParams2, pdata, false);
            String version = Application.unityVersion;

            SFInitialized = false;
            if (SF_Init(pdata, initParamsSize, version) == -1)
            {
                UnityEngine.Debug.Log("Error in Scaleform Manager Initialization. There could be a problem with marshaling structure members");
                return;
            }
            SF_LoadFontConfig(GetScaleformContentPath() + "FontConfig/");
            AllocateSharedData();
            SF_SetSharedData(pCommandOffset, pCommandQueue, 0);
            SF_SetSharedData(pValueOffset, pValueQueue, 1);
            SF_SetSharedData(pASOutputOffset, pASOutput, 2);

            Marshal.DestroyStructure(pdata, typeof(SFInitParams));

            SFMovieList = new List <Movie>();

            MarkForReleaseIDs    = new List <long>();
            MarkForReleaseValues = new List <IntPtr>();
            LifecycleEventsList  = new List <SFLifecycleEvent>();
            pValues_PreAllocated = Marshal.AllocCoTaskMem(sfValueSize * NumPreAllocatedValues);

            SFKey.CreateKeyDictionary();
            SFInitialized = true;
        }
        public SFInitParams2(SFInitParams initParams)
        {
            TheASVersion    = (ASVersion)initParams.TheASVersion;
            InitVideo    = initParams.InitVideo;
            InitSound    = initParams.InitSound;
            TheVideoSoundSystem       = (VideoSoundSystem) initParams.TheVideoSoundSystem;
            IsInitIME                = initParams.IsInitIME;
            IsProgLoading     = (EnableAmpProfiling) initParams.IsProgLoading;
            IsSetFontCacheParams     = initParams.SetFontCacheParams;
            IsEnableDynamicCache     = initParams.IsEnableDynamicCache;
            SetFontPackParams      = initParams.SetFontPackParams;
            IsInitIME                = initParams.IsInitIME;
            ProgLoading            = (EnableProgressiveLoading) initParams.ProgLoading;

            TheFontCacheConfig.TextureHeight      = initParams.TheFontCacheConfig.TextureHeight;
            TheFontCacheConfig.TextureWidth       = initParams.TheFontCacheConfig.TextureWidth;
            TheFontCacheConfig.MaxNumTextures     = initParams.TheFontCacheConfig.MaxNumTextures;
            TheFontCacheConfig.MaxSlotHeight      = initParams.TheFontCacheConfig.MaxSlotHeight;

            TheFontPackParams.NominalSize         = initParams.TheFontPackParams.NominalSize;
            TheFontPackParams.PadPixels           = initParams.TheFontPackParams.PadPixels;
            TheFontPackParams.TextureWidth        = initParams.TheFontPackParams.TextureWidth;
            TheFontPackParams.TextureHeight       = initParams.TheFontPackParams.TextureHeight;

            SetFontPackParams      = initParams.SetFontCacheParams;
            GlyphCountLimit        = initParams.GlyphCountLimit;
            SoundVolume             = initParams.SoundVolume;
            IsMute                  = initParams.IsMute;
            Sentinal                = SFSentinal.Sentinal;
        }
 public SFManager(SFInitParams initParams)
 {
     SFInitParams2 initParams2   = new SFInitParams2(initParams);
     int initParamsSize          = Marshal.SizeOf(typeof(SFInitParams2));
     int sfValueSize             = Marshal.SizeOf(typeof(Value));
     
     // initParams2.Print();
     IntPtr pdata = Marshal.AllocCoTaskMem(initParamsSize);
     Marshal.StructureToPtr(initParams2, pdata, false);
     String version = Application.unityVersion;
     SFInitialized = false;
     if (SF_Init(pdata, initParamsSize, version) == -1)
     {
         UnityEngine.Debug.Log("Error in Scaleform Manager Initialization. There could be a problem with marshaling structure members");
         return;
     }
     SF_LoadFontConfig(GetScaleformContentPath() + "FontConfig/");
     AllocateSharedData();
     SF_SetSharedData(pCommandOffset, pCommandQueue, 0);
     SF_SetSharedData(pValueOffset, pValueQueue, 1);  
     SF_SetSharedData(pASOutputOffset, pASOutput, 2);
     
     Marshal.DestroyStructure(pdata, typeof(SFInitParams));
     
     SFMovieList = new List<Movie>();
     
     MarkForReleaseIDs           = new List<long>();
     MarkForReleaseValues        = new List<IntPtr>();
     LifecycleEventsList         = new List<SFLifecycleEvent>();
     pValues_PreAllocated        = Marshal.AllocCoTaskMem(sfValueSize * NumPreAllocatedValues);
     
     SFKey.CreateKeyDictionary();
     SFInitialized = true;
 }