コード例 #1
0
        public unsafe void RenderTick(uint *bmpAddress, int bmpWidth, int bmpHeight)
        {
            PBEBattle battle = _battle;

            Font fontDefault = Font.Default;

            uint[] defaultWhite = Font.DefaultWhite;
            _battleBackground.DrawOn(bmpAddress, bmpWidth, bmpHeight, 0, 0, bmpWidth, bmpHeight);
            SpritedBattlePokemon foe  = _spritedParties[1].SpritedParty[0];
            SpritedBattlePokemon ally = _spritedParties[0].SpritedParty[0];

            RenderPkmn(bmpAddress, bmpWidth, bmpHeight, 0.75f, 0.55f, false, foe);
            RenderPkmn(bmpAddress, bmpWidth, bmpHeight, 0.35f, 0.95f, true, ally);

            if (Overworld.ShouldRenderDayTint())
            {
                DayTint.Render(bmpAddress, bmpWidth, bmpHeight);
            }

            if (!_transitionDone)
            {
                float t = _transitionCounter / TransitionDurationF;
                //float t1 = t + 1;
                //_battleBackground.DrawOn(bmpAddress, bmpWidth, bmpHeight, 0, 0, (int)(bmpWidth * t1), (int)(bmpHeight * t1));
                RenderUtils.FillColor(bmpAddress, bmpWidth, bmpHeight, 0, 0, bmpWidth, bmpHeight, (uint)(t * 0xFF) << 24);
                if (--_transitionCounter <= 0)
                {
                    _transitionDone = true;
                    new Thread(battle.Begin)
                    {
                        Name = ThreadName
                    }.Start();
                }
                return;
            }

            RenderPkmnInfo(bmpAddress, bmpWidth, bmpHeight, 0.50f, 0.05f, false, foe);
            RenderPkmnInfo(bmpAddress, bmpWidth, bmpHeight, 0.05f, 0.45f, true, ally);

            string msg = _message;

            if (msg != null)
            {
                RenderUtils.FillColor(bmpAddress, bmpWidth, bmpHeight, 0, (int)(bmpHeight * 0.79f), bmpWidth, (int)(bmpHeight * 0.16f), 0x80313131);
                fontDefault.DrawString(bmpAddress, bmpWidth, bmpHeight, (int)(bmpWidth * 0.10f), (int)(bmpHeight * 0.80f), msg, defaultWhite);
            }

            _actionsGUI?.RenderTick(bmpAddress, bmpWidth, bmpHeight);
            _battleEndedTransition?.RenderTick(bmpAddress, bmpWidth, bmpHeight);
        }
コード例 #2
0
        public unsafe void RCB_RenderTick(uint *bmpAddress, int bmpWidth, int bmpHeight)
        {
            AnimatedImage.UpdateCurrentFrameForAll();
            _battleBackground.DrawSizedOn(bmpAddress, bmpWidth, bmpHeight, 0, 0, bmpWidth, bmpHeight);
            void DoTeam(int i, bool info)
            {
                foreach (PkmnPosition p in _positions[i])
                {
                    bool ally = i == 0;
                    if (info)
                    {
                        if (p.InfoVisible)
                        {
                            RenderPkmnInfo(bmpAddress, bmpWidth, bmpHeight, p);
                        }
                    }
                    else if (p.PkmnVisible)
                    {
                        RenderPkmn(bmpAddress, bmpWidth, bmpHeight, p, ally);
                    }
                }
            }

            DoTeam(1, false);
            DoTeam(0, false);

            if (Overworld.ShouldRenderDayTint())
            {
                DayTint.Render(bmpAddress, bmpWidth, bmpHeight);
            }

            DoTeam(1, true);
            DoTeam(0, true);

            if (_stringPrinter != null)
            {
                _stringWindow.Render(bmpAddress, bmpWidth, bmpHeight);
            }
        }