Esempio n. 1
0
 /// <summary>
 /// Invoked by the decoding thread to indicate that it has completed.
 /// </summary>
 /// <param name="success">To indicate if the decoding process was successful.</param>
 /// <param name="postProcess">The results after post porcessing the results from record level Viterbi inference.</param>
 /// <param name="filePath">The path to the phone's memory file.</param>
 /// <param name="phoneInfo">Stores the manufacturer, model etc. information about the phone.</param>
 public void EndWork(bool success, PostProcessor postProcess, string filePath, PhoneInfo phoneInfo)
 {
     if (Terminating)
     {
         return;
     }
     if (MainForm.Program.InvokeRequired)
     {
         EndWorkCallback cb = new EndWorkCallback(EndWork);
         this.Invoke(cb, new object[] { success, postProcess, filePath, phoneInfo });
     }
     else
     {
         this.workerThread = null;
         if (success)
         {
             this.postProcess  = postProcess;
             this.filePath     = filePath;
             this.phoneInfo    = phoneInfo;
             labelStatus9.Text = String.Format("Calls={0}, Addresses={1}, SMS={2}, Images={3}",
                                               postProcess.callLogFields.Count,
                                               postProcess.addressBookFields.Count,
                                               postProcess.smsFields.Count, postProcess.imageBlocks.Count);
         }
         else
         {
             this.postProcess = null;
             HideChecksAbdSteps();
         }
         EnableDisableFields();
     }
 }
Esempio n. 2
0
        internal static IQueryable Deserialize(DomainServiceDescription domainServiceDescription, IQueryable query, IEnumerable <ServiceQueryPart> queryParts, QueryResolver queryResolver)
        {
            foreach (ServiceQueryPart part in queryParts)
            {
                switch (part.QueryOperator)
                {
                case "where":
                    query = DynamicQueryable.Where(query, part.Expression, queryResolver);
                    break;

                case "orderby":
                    query = DynamicQueryable.OrderBy(query, part.Expression, queryResolver);
                    break;

                case "skip":
                    query = DynamicQueryable.Skip(query, Convert.ToInt32(part.Expression, System.Globalization.CultureInfo.InvariantCulture));
                    break;

                case "take":
                    query = DynamicQueryable.Take(query, Convert.ToInt32(part.Expression, System.Globalization.CultureInfo.InvariantCulture));
                    break;
                }
            }

            // Perform any required post processing transformations to the
            // expression tree
            Expression expr = PostProcessor.Process(domainServiceDescription, query.Expression);

            query = query.Provider.CreateQuery(expr);

            return(query);
        }
Esempio n. 3
0
        public PostProcessorInspector(PostProcessor postProcessor)
        {
            _postProcessor = postProcessor;
            _inspectors    = TypeInspectorUtils.GetInspectableProperties(postProcessor);

            // if we are a Material<T>, we need to fix the duplicate Effect due to the "new T effect"
            if (ReflectionUtils.IsGenericTypeOrSubclassOfGenericType(_postProcessor.GetType()))
            {
                var didFindEffectInspector = false;
                for (var i = 0; i < _inspectors.Count; i++)
                {
                    var isEffectInspector = _inspectors[i] is Nez.ImGuiTools.TypeInspectors.EffectInspector;
                    if (isEffectInspector)
                    {
                        if (didFindEffectInspector)
                        {
                            _inspectors.RemoveAt(i);
                            break;
                        }
                        didFindEffectInspector = true;
                    }
                }
            }

            for (var i = 0; i < _inspectors.Count; i++)
            {
                var effectInspector = _inspectors[i] as Nez.ImGuiTools.TypeInspectors.EffectInspector;
                if (effectInspector != null)
                {
                    effectInspector.AllowsEffectRemoval = false;
                }
            }
        }
Esempio n. 4
0
            protected override Expression VisitMember(MemberExpression m)
            {
                if (!this.isInProjection)
                {
                    if (m.Member.MemberType == MemberTypes.Property)
                    {
                        PropertyDescriptor pd = TypeDescriptor.GetProperties(m.Member.DeclaringType)[m.Member.Name];

                        // Let properties for which no PropertyDescriptors exist go through. This happens when we
                        // deal with structs.
                        bool requiresValidation = !(pd == null && m.Member.DeclaringType.IsValueType);
                        if (requiresValidation && !this.IsVisible(pd))
                        {
                            if (!PostProcessor.IsProjectionPath(m))
                            {
                                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.UnknownPropertyOrField, pd.Name, ExpressionParser.GetTypeName(pd.ComponentType)));
                            }
                            else
                            {
                                this.isInProjection = true;
                                Expression expr = base.VisitMember(m);
                                this.isInProjection = false;
                                return(expr);
                            }
                        }
                    }
                }

                return(base.VisitMember(m));
            }
        public static void buildDependencyContent(string file)
        {
            htmlPageContent += "<div class = \"fileList\" style=\"text-align:center\">\n";
            htmlPageContent += "<h3>Active Dependencies for current file: </3>\n";
            htmlPageContent += "<ul class=\"list-group row\">\n";

            List <string> dependencies = PostProcessor.returnListOfDependencies(file);

            if (!dependencies.Any())
            {
                htmlPageContent += "<li class=\"list-group-item col-xs-6\"><a href=\"" + "" + "\">" +
                                   "No dependencies" + "</a>" + "<br></li>\n";
            }
            else
            {
                foreach (string depend in dependencies)
                {
                    string strippedName = separateFileNameForHTML(depend);
                    htmlPageContent += "<li class=\"list-group-item col-xs-6\"><a href=\"" + "file:///" + fullPath + strippedName + ".html" + "\">" +
                                       strippedName + ".html" + "</a>" + "<br></li>\n";
                }
            }


            htmlPageContent += "</ul>\n";
            htmlPageContent += "</div>\n";
        }
Esempio n. 6
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
            PostProcessor.begin();
            GuiData.startDraw();
            GuiData.spriteBatch.Draw(Utils.white, Fullscreen, Color.Black);
            var dest = Utils.InsetRectangle(Fullscreen, 200);

            dest.Y      = dest.Y + dest.Height / 2 - 200;
            dest.Height = 400;
            var destinationRectangle = new Rectangle(Fullscreen.X, dest.Y + 50, Fullscreen.Width, dest.Height - 148);

            GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, Utils.AddativeRed * (0.5f + Utils.randm(0.1f)));
            var text = "HACKNET";

            FlickeringTextEffect.DrawLinedFlickeringText(dest, text, 18f, 0.7f, GuiData.titlefont, null, Color.White, 6);
            dest.Y     += 400;
            dest.Height = 120;
            FlickeringTextEffect.DrawFlickeringText(dest, Utils.FlipRandomChars("MORE SOON", 0.008), -8f, 0.7f,
                                                    GuiData.titlefont, null, Color.Gray);
            FlickeringTextEffect.DrawFlickeringText(dest, Utils.FlipRandomChars("MORE SOON", 0.03), -8f, 0.7f,
                                                    GuiData.titlefont, null, Utils.AddativeWhite * 0.15f);
            GuiData.endDraw();
            PostProcessor.end();
        }
        protected override void OnInitialize()
        {
            PostProcessor = new PostProcessor(GameManager.GraphicsDevice,
                                              CVars.Get <float>("screen_width"),
                                              CVars.Get <float>("screen_height"));
            PostProcessor.RegisterEvents(); // Responds to ResizeEvent; keep outside of RegisterListeners

            Camera = new Camera(CVars.Get <float>("screen_width"), CVars.Get <float>("screen_height"));
            Camera.RegisterEvents();
            DebugCamera = new DebugCamera(CVars.Get <float>("screen_width"), CVars.Get <float>("screen_height"));
            DebugCamera.RegisterEvents();

            VelocityParticleManager = new ParticleManager <VelocityParticleInfo>(1024 * 20, VelocityParticleInfo.UpdateParticle);
            ProcessManager.Attach(VelocityParticleManager);
            GPUParticleManager = new GPUParticleManager(GameManager.GraphicsDevice,
                                                        Content,
                                                        "effect_gpu_particle_velocity");
            GPUParticleManager.RegisterListeners();

            Engine = new Engine();
            InitSystems();
            InitDirectors();

            LoadContent();

            CreateEntities();

            base.OnInitialize();
        }
Esempio n. 8
0
            private async Task <IEnumerable <SyntaxNode> > CreateStatementsOrInitializerToInsertAtCallSiteAsync(CancellationToken cancellationToken)
            {
                var selectedNode = this.GetFirstStatementOrInitializerSelectedAtCallSite();

                // field initializer, constructor initializer, expression bodied member case
                if (selectedNode is ConstructorInitializerSyntax ||
                    selectedNode is FieldDeclarationSyntax ||
                    IsExpressionBodiedMember(selectedNode))
                {
                    var statement = await GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(this.CallSiteAnnotation, cancellationToken).ConfigureAwait(false);

                    return(SpecializedCollections.SingletonEnumerable(statement));
                }

                // regular case
                var semanticModel = this.SemanticDocument.SemanticModel;
                var context       = this.InsertionPoint.GetContext();
                var postProcessor = new PostProcessor(semanticModel, context.SpanStart);
                var statements    = SpecializedCollections.EmptyEnumerable <StatementSyntax>();

                statements = AddSplitOrMoveDeclarationOutStatementsToCallSite(statements, cancellationToken);
                statements = postProcessor.MergeDeclarationStatements(statements);
                statements = AddAssignmentStatementToCallSite(statements, cancellationToken);
                statements = await AddInvocationAtCallSiteAsync(statements, cancellationToken).ConfigureAwait(false);

                statements = AddReturnIfUnreachable(statements, cancellationToken);

                return(statements);
            }
Esempio n. 9
0
        protected override void OnLoad()
        {
            texture = Texture.Empty(1, 1, PixelInternalFormat.Rgba);

            renderTarget = new RenderTarget();
            // ReSharper disable once ConvertToUsingDeclaration
            using (var target = renderTarget.Bind())
            {
                target.SetColorAttachments(texture);
            }

            shapeShaderProgram = ShaderProgram.FromShaders(
                ShaderFactory.Vertex.FromFile("geometry.vs"), ShaderFactory.Fragment.FromFile("geometry.fs"));

            meshBuilder = new IndexedTrianglesMeshBuilder <ColorVertexData>();

            var shapeDrawer =
                new ShapeDrawer3 <ColorVertexData, Color>(meshBuilder, (xyz, color) => new ColorVertexData(xyz, color));

            shapeDrawer.DrawCube(Vector3.Zero, 1f, Color.Aqua);

            var shapeRenderable = meshBuilder.ToRenderable();

            shapeRenderer = Renderer.From(shapeRenderable, shapeShaderProgram, viewMatrix, projectionMatrix);

            viewMatrix.Value = Matrix4.LookAt(new Vector3(0, 1, -2), Vector3.Zero, Vector3.UnitY);

            postProcessShader = ShaderProgram.FromShaders(
                ShaderFactory.Vertex.FromFile("postprocess.vs"), ShaderFactory.Fragment.FromFile("postprocess.fs"));

            postProcessor = PostProcessor.From(postProcessShader,
                                               new TextureUniform("inTexture", TextureUnit.Texture0, texture), pixelSizeUniform);
        }
Esempio n. 10
0
        internal static bool Draw(ref OptionsMenu __instance, GameTime gameTime)
        {
            if (!isInPathfinderMenu)
            {
                return(true);
            }

            PostProcessor.begin();
            GuiData.startDraw();
            PatternDrawer.draw(new Rectangle(0, 0, __instance.ScreenManager.GraphicsDevice.Viewport.Width, __instance.ScreenManager.GraphicsDevice.Viewport.Height), 0.5f, Color.Black, new Color(2, 2, 2), GuiData.spriteBatch);

            if (ReturnButton.Do())
            {
                currentTabName     = null;
                isInPathfinderMenu = false;
                GuiData.endDraw();
                PostProcessor.end();
                var saveEvent = new CustomOptionsSaveEvent();
                EventManager <CustomOptionsSaveEvent> .InvokeAll(saveEvent);

                return(false);
            }

            var tabs = OptionsManager.Tabs;

            int tabX = 10;

            foreach (var tab in tabs.Values)
            {
                if (currentTabName == null)
                {
                    currentTabName = tab.Name;
                }
                var active = currentTabName == tab.Name;
                // Display tab button
                if (Button.doButton(tab.ButtonID, tabX, 70, 128, 20, tab.Name, active ? Color.Green : Color.Gray))
                {
                    currentTabName = tab.Name;
                    break;
                }
                tabX += 128 + 10;

                if (currentTabName != tab.Name)
                {
                    continue;
                }

                // Display options
                int optX = 80, optY = 110;
                foreach (var option in tab.Options)
                {
                    option.Draw(optX, optY);
                    optY += 10 + option.SizeY;
                }
            }

            GuiData.endDraw();
            PostProcessor.end();
            return(false);
        }
Esempio n. 11
0
    /// <summary>
    /// Update gradle dependencies in the Android project.
    /// </summary>
    /// <param name="path"></param>
    private static void UpdateUnityLibraryDependencies(string path)
    {
        var unityPlayerFile             = $@"build.gradle";
        var unityPlayerFileAbsolutePath = Path.Combine(path, unityPlayerFile);
        var oldValue = "dependencies {";
        var newValue = @"dependencies {
    ext.kotlin_version = '1.3.72'


    api(""com.iab.gdpr_android:gdpr_android:1.0.1"")
    api(""com.google.code.gson:gson:2.8.6"")

    implementation(""androidx.appcompat:appcompat:1.2.0"")
    implementation(""androidx.constraintlayout:constraintlayout:2.0.4"")
    implementation(""androidx.lifecycle:lifecycle-extensions:2.2.0"")
    implementation(""androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"")
    implementation(""androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"")
    implementation(""androidx.preference:preference-ktx:1.1.1"")
    implementation(""com.google.android.material:material:1.3.0"")
    implementation(""com.google.zxing:core:3.3.2"")
    implementation(""org.apmem.tools:layouts:1.10"")
    implementation(""org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"")
    implementation(""org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.4.2"")
    implementation(""com.google.dagger:dagger:2.38.1"")";

        PostProcessor.ReplaceLineInFile(unityPlayerFileAbsolutePath, oldValue, newValue);
    }
Esempio n. 12
0
        public void Draw(GraphicsDevice device)
        {
            PostProcessor postprocessor = PostProcessor.GetInstance(device);

            device.SetRenderTargets(postprocessor.color_rt, postprocessor.depth_rt);
            device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, Application.CLEAR_COLOR, 1.0f, 0);
            device.BlendState        = BlendState.Opaque;
            device.DepthStencilState = DepthStencilState.Default;

            level.Draw3dEntities(device, camera);

            postprocessor.DepthOfField(postprocessor.color_rt, postprocessor.result_rt, postprocessor.depth_rt, camera, DepthOfFieldType.DiscBlur, player.position.Z, 5, total_time);

            device.SetRenderTarget(postprocessor.color_rt);
            device.Clear(ClearOptions.Target, Application.CLEAR_COLOR, 1, 0);
            device.BlendState = BlendState.AlphaBlend;

            level.Draw2dEntities(device, camera);
            device.DepthStencilState = DepthStencilState.DepthRead;
            particlemanager.Draw(device, camera);
            device.DepthStencilState = DepthStencilState.Default;
            level.DrawBubbleReflections(device, camera);

            device.SetRenderTargets(postprocessor.result_rt);

            SpriteRenderer spriterenderer = SpriteRenderer.GetInstance(device);

            spriterenderer.Begin(null);
            spriterenderer.Add(new TextureRegion(postprocessor.color_rt, 0, 0, postprocessor.color_rt.Width, postprocessor.color_rt.Height), Color.White, 0, 0, postprocessor.color_rt.Width, postprocessor.color_rt.Height, 0);
            spriterenderer.End();
        }
Esempio n. 13
0
 public RenderManager(Renderer renderer, Camera cam, Action userRender)
 {
     RenderManager.renderer = renderer;
     this.userRender        = userRender;
     postProcessor          = new PostProcessor(this, cam);
     depthFbo = new Framebuffer(cam.Width, cam.Height);
 }
Esempio n. 14
0
        protected override void OnKill()
        {
            PostProcessor.UnregisterEvents();
            Camera.UnregisterEvents();
            GPUParticleManager.UnregisterListeners();

            throw new Exception("This game state provides shared logic with all other game states and must not be killed.");
        }
Esempio n. 15
0
        public override void Draw(GameTime gameTime)
        {
            try
            {
                float t = (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (this.lastGameTime == null)
                {
                    this.lastGameTime = gameTime;
                }

                PostProcessor.begin();
                GuiData.startDraw();
                try
                {
                    Overlay onlyOverlay = null;
                    foreach (Overlay overlay in this.overlays)
                    {
                        if (overlay.PreventsDrawing())
                        {
                            onlyOverlay = overlay;
                            break;
                        }
                    }
                    if (onlyOverlay == null)
                    {
                        this.drawBackground();
                        this.drawModules(gameTime);
                        SFX.Draw(GuiData.spriteBatch);
                        foreach (Overlay overlay in this.overlays)
                        {
                            overlay.Draw();
                        }
                    }
                    else
                    {
                        onlyOverlay.Draw();
                    }
                }
                catch (System.Exception ex)
                {
                    Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex) + "\r\n\r\n");
                }
                GuiData.endDraw();
                PostProcessor.end();
                GuiData.startDraw();
                if (this.postFXDrawActions != null)
                {
                    this.postFXDrawActions();
                    this.postFXDrawActions = null;
                }
                this.drawScanlines();
                GuiData.endDraw();
            }
            catch (System.Exception ex)
            {
                Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex));
            }
        }
Esempio n. 16
0
        public static IPipeline <TState> PostProcess(IRendererShader shaderProgram, out IDisposable disposable,
                                                     params IRenderSetting[] renderSettings)
        {
            var postProcessor = PostProcessor.From(renderSettings);

            shaderProgram.UseOnRenderer(postProcessor);
            disposable = postProcessor;
            return(new PostProcess <TState>(postProcessor));
        }
Esempio n. 17
0
 public command(long format = default, PostProcessor postProcess = default, PostProcessor visualizer = default, bool hasParam = default, @string description = default, @string usage = default)
 {
     this.format      = format;
     this.postProcess = postProcess;
     this.visualizer  = visualizer;
     this.hasParam    = hasParam;
     this.description = description;
     this.usage       = usage;
 }
Esempio n. 18
0
 public static BonsaiExpression PostProcess(BonsaiExpression expression, PostProcessor top, PostProcessor next) =>
 Switch <BonsaiExpression> .On(expression)
 .Match <BinaryLogic>(x => new BinaryLogic(x.Operator, top(x.Left), top(x.Right)))
 .Match <Column>(x => x)
 .Match <Comparison>(x => new Comparison(x.Operator, top(x.Left), top(x.Right)))
 .Match <Constant>(x => x)
 .Match <UnaryLogic>(x => new UnaryLogic(x.Operator, top(x.Expression)))
 .Match <List>(x => new List(x.Values.Select(top.Invoke), x.ElementType, x.Type))
 .OrThrow();
Esempio n. 19
0
    /// <summary>
    /// Convert the Activity class generated by Unity to AppCompatActivity as that is
    /// what is expected by the Didomi SDK.
    /// </summary>
    /// <param name="path"></param>
    private static void UpdateUnityPlayerActivity(string path)
    {
        var unityPlayerFile             = $@"src{PostProcessorSettings.FilePathSeperator}main{PostProcessorSettings.FilePathSeperator}java{PostProcessorSettings.FilePathSeperator}com{PostProcessorSettings.FilePathSeperator}unity3d{PostProcessorSettings.FilePathSeperator}player{PostProcessorSettings.FilePathSeperator}UnityPlayerActivity.java";
        var unityPlayerFileAbsolutePath = Path.Combine(path, unityPlayerFile);
        var oldValue = "public class UnityPlayerActivity extends Activity implements IUnityPlayerLifecycleEvents";
        var newValue = $"import androidx.appcompat.app.AppCompatActivity;{System.Environment.NewLine}{System.Environment.NewLine}public class UnityPlayerActivity extends AppCompatActivity implements IUnityPlayerLifecycleEvents";

        PostProcessor.ReplaceLineInFile(unityPlayerFileAbsolutePath, oldValue, newValue);
    }
    public void OnAfterDeserialize()
    {
        foreach (BindingSourceData bindingSource in BindingSourcesSerializable)
        {
            bindingSource.RuntimeBindingSource = bindingSource.ObjectReference as IBindingSource;
        }

        this.PostProcessor = this.PostProcessorSerializable as PostProcessor <U>;
    }
Esempio n. 21
0
 /// <summary>
 /// Called to initiate decoding. This is done in a separate thread.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="manufacturer"></param>
 /// <param name="model"></param>
 /// <param name="note"></param>
 /// <param name="noStore"></param>
 private void StartWork(string path, string manufacturer, string model, string note, bool noStore)
 {
     this.postProcess  = null;
     this.filePath     = null;
     this.phoneInfo    = null;
     this.workerThread = new WorkerThread(path, manufacturer, model, note, noStore);
     EnableDisableFields();
     InitializeSteps();
     this.workerThread.Start();
 }
Esempio n. 22
0
 public GTC_CSV_Writer(List <MetaResult> metaResults, PostProcessor postProcess, string filePath)
 {
     _metaResults        = metaResults;
     _postProcess        = postProcess;
     _filePath           = filePath;
     _fields_in_blocks   = new Dictionary <int, List <ViterbiField> >();
     _fields_of_interest = new Dictionary <int, List <ViterbiField> >();
     Get_Fields_in_Blocks();
     Get_Fields_Of_Interest();
 }
Esempio n. 23
0
        static void SetupWindows()
        {
            WindowManager.WindowTitleText = Resources.WindowTitle;

            if (PreferencesManager.GetValueB(PrefNames.Headless))
            {
                return;
            }

            WindowManager.WindowInfo info = new WindowManager.WindowInfo();
            info.Size.x = PreferencesManager.GetValueI(PrefNames.MainWindowWidth, 1280);
            info.Size.y = PreferencesManager.GetValueI(PrefNames.MainWindowHeight, 900);

            info.AntiAliasingFactor = PreferencesManager.GetValueI(PrefNames.FSAA, 0);
            info.SizeType           = (WindowManager.WindowInfo.WindowSizeTypes)PreferencesManager.GetValueI(PrefNames.Fullscreen, 0);

            if (info.AntiAliasingFactor > 0)
            {
                if (info.AntiAliasingFactor < 2)
                {
                    info.AntiAliasingFactor = 2;
                }
            }
            if (info.SizeType == WindowManager.WindowInfo.WindowSizeTypes.Fullscreen)
            {
                info.Size.x = OpenTK.DisplayDevice.Default.Width;
                info.Size.y = OpenTK.DisplayDevice.Default.Height;
            }

            WindowManager.Init(info);

            WindowManager.ClearRenderLayers();

            Graphics.BackgroundLayer = WindowManager.AddRenderLayer(new RenderLayer());
            Graphics.ObjectLayer     = WindowManager.AddRenderLayer(new RenderLayer());
            Graphics.EffectLayer     = WindowManager.AddRenderLayer(new RenderLayer());
            Graphics.HudLayer        = WindowManager.AddRenderLayer(GUIManager.GetGUILayer(WindowManager.MainWindowID));
            Graphics.MouseLayer      = WindowManager.AddRenderLayer(new RenderLayer());

            RenderLayer.DefaultLayer = Graphics.ObjectLayer;

            Graphics.GlitchPostProcessor = WindowManager.AddRenderLayer(new PostProcessor("glitch")) as PostProcessor;
            Graphics.GlitchPostProcessor.Enable(false);
            Graphics.WarpPostProcessor = WindowManager.AddRenderLayer(new PostProcessor("warp")) as PostProcessor;
            Graphics.WarpPostProcessor.Enable(false);

            if (PreferencesManager.GetValueB(PrefNames.DisableShader))
            {
                PostProcessor.EnableEffects(false);
            }

            MenuManager.MainFont    = FontManager.LoadFont(ThemeManager.GetThemeAsset("ui/fonts/BebasNeue Regular.otf"));
            MenuManager.BoldFont    = FontManager.LoadFont(ThemeManager.GetThemeAsset("ui/fonts/BebasNeue Bold.otf"));
            FontManager.DefaultFont = MenuManager.MainFont;
        }
Esempio n. 24
0
        public override void Update(GameTime gameTime)
        {
            if (CurrentScene != null)
            {
                CurrentScene.Update(gameTime);
            }

            PostProcessor.Update(gameTime);

            base.Update(gameTime);
        }
Esempio n. 25
0
    /// <summary>
    /// Update the `styles.xml` resource file by adding styles for AppCompat.
    /// </summary>
    /// <param name="path"></param>
    private static void UpdateStylesThemeToAppCompat(string path)
    {
        var unityPlayerFile             = $@"src{PostProcessorSettings.FilePathSeperator}main{PostProcessorSettings.FilePathSeperator}res{PostProcessorSettings.FilePathSeperator}values{PostProcessorSettings.FilePathSeperator}styles.xml";
        var unityPlayerFileAbsolutePath = Path.Combine(path, unityPlayerFile);
        var oldValue = @"</resources>";
        var newValue = @"<style name=""DidomiTheme"" parent =""Theme.AppCompat.Light.DarkActionBar"" />

</resources>";

        PostProcessor.ReplaceLineInFile(unityPlayerFileAbsolutePath, oldValue, newValue);
    }
Esempio n. 26
0
 /// <summary> 窗口关闭时将窗口所对应的模型数据也关闭 </summary>
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Model = null;
     //
     if (_Solver != null)
     {
         _Solver.Dispose();
         _Solver = null;
     }
     //
     _PostProcessor = null;
 }
Esempio n. 27
0
            private IEnumerable <StatementSyntax> CleanupCode(IEnumerable <StatementSyntax> statements)
            {
                var semanticModel = this.SemanticDocument.SemanticModel;
                var context       = this.InsertionPoint.GetContext();
                var postProcessor = new PostProcessor(semanticModel, context.SpanStart);

                statements = postProcessor.RemoveRedundantBlock(statements);
                statements = postProcessor.RemoveDeclarationAssignmentPattern(statements);
                statements = postProcessor.RemoveInitializedDeclarationAndReturnPattern(statements);

                return(statements);
            }
Esempio n. 28
0
        public void TranslateTemplateThread()
        {
            articleContentCache.TranslatedArticle_Content = "";
            articleContentCache.IsTranslatedArticle       = false;
            pr = new PostProcessor(SessionsManager.RuleFileName, SessionsManager.VerbListFileName, SessionsManager.NounListFileName, SessionsManager.AdjectiveListFileName, SessionsManager.PronounListFileName, SessionsManager.UsersCustomFileName);
            pr.LoadTextToTranslate(articleContentCache.Article_WikiContent);
            pr.OnTranslationComplete += new PostProcessor.TranslationCompleteDelegate(TranslationOfThreadCompleted);

            templateTranslatorThread      = new Thread(new ThreadStart(pr.TranslateVoid)); //inside the thread is the function that will be executed
            templateTranslatorThread.Name = "TemplateTranslatorThread";                    //Name of the thread
            templateTranslatorThread.Start();                                              //starting translation.
        }
Esempio n. 29
0
        public override void Initialize()
        {
            EventManager.Instance.RegisterListener <PlayerLostEvent>(this);

            _processManager = new ProcessManager();

            _mainCamera = new Camera(Constants.Global.WINDOW_WIDTH, Constants.Global.WINDOW_HEIGHT);
            _pongCamera = new PongCamera(Constants.Global.SCREEN_WIDTH, Constants.Global.SCREEN_HEIGHT);
            // The camera response to size changes
            EventManager.Instance.RegisterListener <ResizeEvent>(_mainCamera);

            _root = new Root(GameManager.GraphicsDevice.Viewport.Width,
                             GameManager.GraphicsDevice.Viewport.Height);
            _root.RegisterListeners();

            PresentationParameters pp = GameManager.GraphicsDevice.PresentationParameters;

            _pongRenderTarget = new RenderTarget2D(GameManager.GraphicsDevice,
                                                   Constants.Global.SCREEN_WIDTH,
                                                   Constants.Global.SCREEN_HEIGHT,
                                                   false,
                                                   SurfaceFormat.Color,
                                                   DepthFormat.None);

            VelocityParticleManager = new ParticleManager <VelocityParticleInfo>(1024 * 20, VelocityParticleInfo.UpdateParticle);

            _quadEffect = new BasicEffect(GameManager.GraphicsDevice);
            _quadEffect.AmbientLightColor = new Vector3(1, 1, 1);
            _quadEffect.World             = Matrix.Identity;
            _quadEffect.TextureEnabled    = true;
            _quad = new Quad(new Vector3(-Constants.Global.SCREEN_ASPECT_RATIO, 1, 0),
                             new Vector3(Constants.Global.SCREEN_ASPECT_RATIO, 1, 0),
                             new Vector3(-Constants.Global.SCREEN_ASPECT_RATIO, -1, 0),
                             new Vector3(Constants.Global.SCREEN_ASPECT_RATIO, -1, 0),
                             Vector3.Forward);

            PongPostProcessor = new PostProcessor(GameManager.GraphicsDevice,
                                                  Constants.Global.SCREEN_WIDTH,
                                                  Constants.Global.SCREEN_HEIGHT);

            InitSystems();

            _directors = new BaseDirector[] {
                new PongDirector(this),
                new AstheticsDirector(this),
                new FluctuationDirector(this)
            };
            for (int i = 0; i < _directors.Length; i++)
            {
                _directors[i].RegisterEvents();
            }
        }
Esempio n. 30
0
        public static bool onOptionsMenuDraw(OptionsMenu self, ref GameTime time)
        {
            var optionsMenuDrawEvent = new Event.OptionsMenuDrawEvent(self, time);

            optionsMenuDrawEvent.CallEvent();
            if (optionsMenuDrawEvent.IsCancelled)
            {
                GuiData.endDraw();
                PostProcessor.end();
                return(true);
            }
            return(false);
        }