Add more derived traits to constants
This commit is contained in:
parent
3cad3b1e29
commit
f4d076b76f
|
@ -4,7 +4,7 @@ use super::ffi::*;
|
||||||
|
|
||||||
// NB: commented-out stuff is from newer versions of libretro.h not yet represented in libretro-sys
|
// NB: commented-out stuff is from newer versions of libretro.h not yet represented in libretro-sys
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Clone, Copy)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum DeviceType {
|
pub enum DeviceType {
|
||||||
None = DEVICE_NONE,
|
None = DEVICE_NONE,
|
||||||
|
@ -23,7 +23,7 @@ impl DeviceType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum InputIndex {
|
pub enum InputIndex {
|
||||||
Left = DEVICE_INDEX_ANALOG_LEFT,
|
Left = DEVICE_INDEX_ANALOG_LEFT,
|
||||||
|
@ -31,7 +31,7 @@ pub enum InputIndex {
|
||||||
// Button = DEVICE_INDEX_ANALOG_BUTTON,
|
// Button = DEVICE_INDEX_ANALOG_BUTTON,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum JoypadButton {
|
pub enum JoypadButton {
|
||||||
B = DEVICE_ID_JOYPAD_B,
|
B = DEVICE_ID_JOYPAD_B,
|
||||||
|
@ -52,14 +52,14 @@ pub enum JoypadButton {
|
||||||
R3 = DEVICE_ID_JOYPAD_R3,
|
R3 = DEVICE_ID_JOYPAD_R3,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum AnalogAxis {
|
pub enum AnalogAxis {
|
||||||
X = DEVICE_ID_ANALOG_X,
|
X = DEVICE_ID_ANALOG_X,
|
||||||
Y = DEVICE_ID_ANALOG_Y,
|
Y = DEVICE_ID_ANALOG_Y,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum MouseButton {
|
pub enum MouseButton {
|
||||||
X = DEVICE_ID_MOUSE_X,
|
X = DEVICE_ID_MOUSE_X,
|
||||||
|
@ -73,7 +73,7 @@ pub enum MouseButton {
|
||||||
HorizWheelDown = DEVICE_ID_MOUSE_HORIZ_WHEELDOWN,
|
HorizWheelDown = DEVICE_ID_MOUSE_HORIZ_WHEELDOWN,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum LightGunButton {
|
pub enum LightGunButton {
|
||||||
// ScreenX = DEVICE_ID_LIGHTGUN_SCREEN_X,
|
// ScreenX = DEVICE_ID_LIGHTGUN_SCREEN_X,
|
||||||
|
@ -95,7 +95,7 @@ pub enum LightGunButton {
|
||||||
Pause = DEVICE_ID_LIGHTGUN_PAUSE,
|
Pause = DEVICE_ID_LIGHTGUN_PAUSE,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum PointerStat {
|
pub enum PointerStat {
|
||||||
X = DEVICE_ID_POINTER_X,
|
X = DEVICE_ID_POINTER_X,
|
||||||
|
@ -103,7 +103,7 @@ pub enum PointerStat {
|
||||||
Pressed = DEVICE_ID_POINTER_PRESSED,
|
Pressed = DEVICE_ID_POINTER_PRESSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum EnvRotation {
|
pub enum EnvRotation {
|
||||||
None = 0,
|
None = 0,
|
||||||
|
@ -113,7 +113,7 @@ pub enum EnvRotation {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: experimental calls
|
// TODO: experimental calls
|
||||||
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
|
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
pub enum EnvCmd {
|
pub enum EnvCmd {
|
||||||
SetRotation = ENVIRONMENT_SET_ROTATION,
|
SetRotation = ENVIRONMENT_SET_ROTATION,
|
||||||
|
|
Loading…
Reference in New Issue