public void Feed(CompileInfo info, System.IO.StreamWriter file)
        {
            if (String.IsNullOrEmpty(JoystickAxis))
            {
                return;
            }

            var parts = JoystickAxis.Split('.');

            file.Write(new string(' ', info.IndentLevel * 4));
            file.Write("iReport."); file.Write(VJoyAxis);
            file.Write(" = (int)(DeadZone(");
            if (Inverted)
            {
                file.Write("(65536 - "); file.Write(JoystickAxis.Replace("joystick", "state")); file.Write(")");
            }
            else
            {
                file.Write(JoystickAxis.Replace("joystick", "state"));
            }
            file.Write(", "); file.Write(parts[0].Replace("joystick", "deadzone")); file.WriteLine(") * axisScale);");
        }
Exemple #2
0
        public void Feed(CompileInfo info, System.IO.StreamWriter file)
        {
            if (String.IsNullOrEmpty(JoystickAxis))
            {
                return;
            }

            file.Write(new string(' ', info.IndentLevel * 4));
            var parts = JoystickAxis.Split('.');

            file.Write("iReport."); file.Write(VJoyPOV); file.Write(" = FakePOV_"); file.Write(IsXDirection ? "X" : "Y"); file.Write("(");
            file.Write("iReport."); file.Write(VJoyPOV);
            file.Write(", ");
            if (Inverted)
            {
                file.Write("(65536 - "); file.Write(JoystickAxis.Replace("joystick", "state")); file.Write(")");
            }
            else
            {
                file.Write(JoystickAxis.Replace("joystick", "state"));
            }
            file.WriteLine(");");
        }