/* * GRacer * * Copyright (C) 1999 Takashi Matsuda * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #ifndef __GRACER_CONTROL_H__ #define __GRACER_CONTROL_H__ typedef struct GrControl GrControl; typedef struct GrControlOptKey GrControlOptKey; typedef struct GrControlOptMouse GrControlOptMouse; typedef enum { /* xis func */ GR_CONTROL_AXIS_FUNC_STEERING, GR_CONTROL_AXIS_FUNC_ACCEL_AND_FOOT_BREAK, GR_CONTROL_AXIS_FUNC_FOOT_BREAK_AND__ACCEL, GR_CONTROL_AXIS_FUNC_ACCEL, GR_CONTROL_AXIS_FUNC_FOOT_BREAK, GR_CONTROL_AXIS_FUNC_SIDE_BREAK, /* button func */ GR_CONTROL_BUTTON_FUNC_HOLD_STEERING, GR_CONTROL_BUTTON_FUNC_SHIFT_UP, GR_CONTROL_BUTTON_FUNC_SHIFT_DOWN, GR_CONTROL_BUTTON_FUNC_ACCEL, GR_CONTROL_BUTTON_FUNC_BREAK_FOOT, GR_CONTROL_BUTTON_FUNC_BREAK_SIDE, GR_CONTROL_BUTTON_FUNC_ABORT, } GrControlFuncType; struct GrControl { int changed; /* set true if chance control value(s) */ float steering; /* [-1:1] */ float foot_break; /* [0:1] */ float side_break; /* [0:1] */ float accel; /* [0:1] */ int gear; /* [0:5] */ }; struct GrControlOptKey { int key_pause; int key_steering_left; int key_steering_right; int key_accel; int key_break_foot; int key_break_side; int key_shift_up; int key_shift_down; int key_abort; int key_spc_pause; int key_spc_steering_left; int key_spc_steering_right; int key_spc_accel; int key_spc_break_foot; int key_spc_break_side; int key_spc_shift_up; int key_spc_shift_down; int key_spc_abort; }; struct GrControlOptMouse { float xcalibration; float ycalibration; GrControlFuncType x_axis; GrControlFuncType y_axis; GrControlFuncType button[3]; }; #endif /* __GRACER_CONTROL_H__ */