예제 #1
0
파일: Input2.cs 프로젝트: weimingtom/Sakura
            internal void frame_update()
            {
                Sce.Pss.Core.Input.GamePadData gamePadData = this.m_external_data;
                if (!this.m_external_control)
                {
                    gamePadData = Sce.Pss.Core.Input.GamePad.GetData(this.m_device_index);
                }
                bool flag = true;

                if (gamePadData.Skip)
                {
                    flag = false;
                }
                this.Left.frame_update((gamePadData.Buttons & (GamePadButtons)1) != 0 && flag);
                this.Up.frame_update((gamePadData.Buttons & (GamePadButtons)2) != 0 && flag);
                this.Right.frame_update((gamePadData.Buttons & (GamePadButtons)4) != 0 && flag);
                this.Down.frame_update((gamePadData.Buttons & (GamePadButtons)8) != 0 && flag);
//				this.Square.__isSquare = true;
//				if ((gamePadData.Buttons & (GamePadButtons)16) != 0) //FIXME:added
//				{
//					Debug.WriteLine("=====================");
//				}
                this.Square.frame_update((gamePadData.Buttons & (GamePadButtons)16) != 0 && flag);
                this.Triangle.frame_update((gamePadData.Buttons & (GamePadButtons)32) != 0 && flag);
                this.Circle.frame_update((gamePadData.Buttons & (GamePadButtons)64) != 0 && flag);
                this.Cross.frame_update((gamePadData.Buttons & (GamePadButtons)128) != 0 && flag);
                this.Start.frame_update((gamePadData.Buttons & (GamePadButtons)256) != 0 && flag);
                this.Select.frame_update((gamePadData.Buttons & (GamePadButtons)512) != 0 && flag);
                this.L.frame_update((gamePadData.Buttons & (GamePadButtons)1024) != 0 && flag);
                this.R.frame_update((gamePadData.Buttons & (GamePadButtons)2048) != 0 && flag);
                if (flag)
                {
                    this.Dpad = Math._00;
                    if (this.Left.Down)
                    {
                        this.Dpad -= Math._10;
                    }
                    if (this.Up.Down)
                    {
                        this.Dpad += Math._01;
                    }
                    if (this.Right.Down)
                    {
                        this.Dpad += Math._10;
                    }
                    if (this.Down.Down)
                    {
                        this.Dpad -= Math._01;
                    }
                    this.AnalogLeft.X  = gamePadData.AnalogLeftX;
                    this.AnalogLeft.Y  = gamePadData.AnalogLeftY;
                    this.AnalogRight.X = gamePadData.AnalogRightX;
                    this.AnalogRight.Y = gamePadData.AnalogRightY;
                }
            }
예제 #2
0
파일: Input2.cs 프로젝트: weimingtom/Sakura
 public static void SetData(uint deviceIndex, Sce.Pss.Core.Input.GamePadData data)
 {
     Common.Assert(deviceIndex == 0u);
     Input2.GamePad.s_game_pad_data0.SetData(data);
 }
예제 #3
0
파일: Input2.cs 프로젝트: weimingtom/Sakura
 public void SetData(Sce.Pss.Core.Input.GamePadData data)
 {
     this.m_external_control = true;
     this.m_external_data    = data;
 }