From ed1f87e456476d53b962b37e5e7fbc8f9fc60499 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 26 Nov 2012 18:29:06 +0100 Subject: linux-variante gefixt --- mariokart01.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mariokart01.cpp b/mariokart01.cpp index f3e0039..955bbe7 100644 --- a/mariokart01.cpp +++ b/mariokart01.cpp @@ -20,7 +20,8 @@ */ -#define FREEBSD +//#define FREEBSD +#define LINUX #include #include @@ -293,6 +294,7 @@ class Joystick { public: Joystick(); + ~Joystick(); void steer(float dir, float dead_zone=0.0); void throttle(float t); void press_a(bool); @@ -307,6 +309,9 @@ class Joystick void send_data(); int fifo_fd; #endif +#ifdef LINUX + int fd; +#endif float throt; int throttle_cnt; @@ -360,6 +365,10 @@ void Joystick::reset() send_data(); } +Joystick::~Joystick() +{ + close(fifo_fd); +} #endif #ifdef LINUX Joystick::Joystick() -- cgit v1.2.3