Add more derived traits to constants

This commit is contained in:
Vivian Lim 2021-08-17 15:23:48 -07:00
parent 3cad3b1e29
commit f4d076b76f
1 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,7 @@ use super::ffi::*;
// 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)]
pub enum DeviceType {
None = DEVICE_NONE,
@ -23,7 +23,7 @@ impl DeviceType {
}
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum InputIndex {
Left = DEVICE_INDEX_ANALOG_LEFT,
@ -31,7 +31,7 @@ pub enum InputIndex {
// Button = DEVICE_INDEX_ANALOG_BUTTON,
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum JoypadButton {
B = DEVICE_ID_JOYPAD_B,
@ -52,14 +52,14 @@ pub enum JoypadButton {
R3 = DEVICE_ID_JOYPAD_R3,
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum AnalogAxis {
X = DEVICE_ID_ANALOG_X,
Y = DEVICE_ID_ANALOG_Y,
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum MouseButton {
X = DEVICE_ID_MOUSE_X,
@ -73,7 +73,7 @@ pub enum MouseButton {
HorizWheelDown = DEVICE_ID_MOUSE_HORIZ_WHEELDOWN,
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum LightGunButton {
// ScreenX = DEVICE_ID_LIGHTGUN_SCREEN_X,
@ -95,7 +95,7 @@ pub enum LightGunButton {
Pause = DEVICE_ID_LIGHTGUN_PAUSE,
}
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum PointerStat {
X = DEVICE_ID_POINTER_X,
@ -103,7 +103,7 @@ pub enum PointerStat {
Pressed = DEVICE_ID_POINTER_PRESSED,
}
#[derive(TryFromPrimitive, IntoPrimitive)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum EnvRotation {
None = 0,
@ -113,7 +113,7 @@ pub enum EnvRotation {
}
// TODO: experimental calls
#[derive(TryFromPrimitive, IntoPrimitive, Debug)]
#[derive(TryFromPrimitive, IntoPrimitive, Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[repr(u32)]
pub enum EnvCmd {
SetRotation = ENVIRONMENT_SET_ROTATION,