예제 #1
0
        private void draw_battle(SpriteBatch sprite_batch, GraphicsDevice device,
                                 RenderTarget2D finalRender, RenderTarget2D tempRender, RenderTarget2D effectRender, Effect battle_shader)
        {
            device.SetRenderTarget(finalRender);

            if (Weather_Visible == BattleWeathers.Visible)
            {
                draw_lower_weather(sprite_batch, Weather_Opacity);
            }

            draw_battler_bg_effects(sprite_batch);

            // Platform
            device.SetRenderTarget(tempRender);
            device.Clear(Color.Transparent);
            draw_platform(sprite_batch);
            device.SetRenderTarget(finalRender);
            if (battle_shader != null)
            {
                battle_shader.CurrentTechnique = battle_shader.Techniques["Tone"];
                battle_shader.Parameters["tone"].SetValue(
                    Global.game_state.screen_tone.to_vector_4(
                        Global.BattleSceneConfig.ActionPlatformToneWeight / 255f));
            }
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, battle_shader);
            sprite_batch.Draw(tempRender, Vector2.Zero, Color.White); // on promotion (and level up?) darken this tint //Yeti
            sprite_batch.End();

            // Platform effect
            device.SetRenderTarget(tempRender);
            device.Clear(Color.Transparent);

            platform_effect_setup();
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Platform_Matrix_1);
            if (Platform_Effect_1 != null)
            {
                Platform_Effect_1.draw(sprite_batch, Vector2.Zero);
            }
            //Platform_Effect_1.draw(sprite_batch, (Layer_2_Shake + Pan_Vector) + Platform_1_Shake);
            sprite_batch.End();
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Platform_Matrix_2);
            if (Platform_Effect_2 != null)
            {
                Platform_Effect_2.draw(sprite_batch, Vector2.Zero);
            }
            //Platform_Effect_2.draw(sprite_batch, (Layer_2_Shake + Pan_Vector) + Platform_2_Shake);
            sprite_batch.End();

            device.SetRenderTarget(finalRender);
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            sprite_batch.Draw(tempRender, Vector2.Zero, new Color(160, 160, 160, 160));
            sprite_batch.End();

            // Battlers
            draw_battler_lower_effects(sprite_batch);

            BattleSpriteRenderer battler_renderer = new BattleSpriteRenderer(
                Reverse, Layer_3_Shake + Pan_Vector, Platform_1_Shake, Platform_2_Shake);

            battler_renderer.draw(sprite_batch, device,
                                  active_battler_sprite, inactive_battler_sprites,
                                  finalRender, tempRender, effectRender);

            device.SetRenderTarget(finalRender);

            if (Weather_Visible == BattleWeathers.Visible)
            {
                draw_upper_weather(sprite_batch, Weather_Opacity);
            }

            draw_battler_upper_effects(sprite_batch);

            draw_hud(sprite_batch);

            if (White_Screen != null)
            {
                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                White_Screen.draw(sprite_batch);
                sprite_batch.End();
            }

            // If level up, darken parts of the screen
            // Always switch to render target 2 for this, it needs to act as a temporary final target for a bit
            device.SetRenderTarget(effectRender);
            device.Clear(Color.Transparent);

            draw_masked_screen_darken(sprite_batch, battle_shader, finalRender);
        }
예제 #2
0
        protected void draw_animation_scene(SpriteBatch sprite_batch, GraphicsDevice device,
                                            RenderTarget2D final_render, RenderTarget2D temp_render, RenderTarget2D effect_render)
        {
            Effect reel_shader = Global.effect_shader();

            // Background
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            Background.draw(sprite_batch);
            sprite_batch.End();
            // Spell Bg
            if (Battler != null)
            {
                Battler.draw_bg_effects(sprite_batch, reel_shader);
            }
            // Platform
            Platform.draw(sprite_batch);
            // Battler

            if (Battler != null)
            {
                BattleSpriteRenderer battler_renderer = new BattleSpriteRenderer(
                    false, Vector2.Zero, Vector2.Zero, Vector2.Zero);
                battler_renderer.draw(sprite_batch, device,
                                      new Tuple <Battler_Sprite, bool>(Battler, false), null,
                                      final_render, temp_render, effect_render);
            }

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);

            /*if (Battler != null) //Debug
             * {
             *  sprite_batch.End();
             *  Battler.draw_lower_effects(sprite_batch, reel_shader);
             *  Battler.draw_lower(sprite_batch, Vector2.Zero, reel_shader);
             *  Battler.draw(sprite_batch, Vector2.Zero, reel_shader);
             *  Battler.draw_upper(sprite_batch, Vector2.Zero, reel_shader);
             *  sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
             * }*/
            // Stats
            if (Message != null)
            {
                foreach (Class_Reel_Stat_Bars bar in Stat_Bars)
                {
                    bar.draw(sprite_batch);
                }
                foreach (TextSprite label in Stat_Labels)
                {
                    label.draw(sprite_batch);
                }
                foreach (TextSprite value in Stat_Values)
                {
                    value.draw(sprite_batch);
                }
                foreach (Icon_Sprite icon in Weapon_Icons)
                {
                    icon.draw(sprite_batch);
                }
                Name_Bg.draw(sprite_batch);
            }
            // Battler
            if (Battler != null)
            {
                sprite_batch.End();
                Battler.draw_upper_effects(sprite_batch, reel_shader);
                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            }
            // Name/Message
            if (Message != null)
            {
                Text_Bg.draw(sprite_batch);
                Name.draw(sprite_batch);
                sprite_batch.End();
                // Message
                Message.draw_background(sprite_batch);
                Message.draw_faces(sprite_batch);
                Message.draw_foreground(sprite_batch);

                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            }
            // Spell Fg
            if (Battler != null)
            {
                sprite_batch.End();
                Battler.draw_fg_effects(sprite_batch, reel_shader);
                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
                White_Flash.draw(sprite_batch);
            }
            // Black Screen
            Black_Screen.draw(sprite_batch);
            Black_Bar1.draw(sprite_batch);
            Black_Bar2.draw(sprite_batch);
            sprite_batch.End();
        }