diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f661877d785ad068877f95b58696476c6b2d2571 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +onearmedbandit diff --git a/display.c b/display.c index 421b31ecf5f3e160660d96dbe03ca5b7da9e5439..e702172b79f95e7282719978e4081dd49ef7c8f9 100644 --- a/display.c +++ b/display.c @@ -3,10 +3,11 @@ #include <assert.h> #include <unistd.h> #include <pthread.h> -#include "utilities.h" -#include "display.h" #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> +#include "utilities.h" +#include "display.h" +#include "wheel.h" // the following global variables are defined for graphical objects only: // the images size is 104x128 pixels @@ -56,7 +57,7 @@ void *display_func(void *param) // ------------------------- // managing events: // ------------------------- - + SDL_DestroyTexture(objects_texture); SDL_DestroyTexture(one_arm_texture); @@ -68,7 +69,7 @@ void *display_func(void *param) -int wheel_func(double index){ +int wheel_func(double index){ // rename? // ------------------------- diff --git a/display.o b/display.o deleted file mode 100644 index c70f3a8922462cb97750d7361c5d1b6518643b02..0000000000000000000000000000000000000000 Binary files a/display.o and /dev/null differ diff --git a/one_armed_bandit b/one_armed_bandit deleted file mode 100755 index 5f449a5a9e3c854950b6e70bde110117ea52a8e5..0000000000000000000000000000000000000000 Binary files a/one_armed_bandit and /dev/null differ diff --git a/one_armed_bandit.c b/one_armed_bandit.c index 96bd75b5278f68dae0807e0e1fa4508d5bb1c62b..87dd396c3c6d6128a793bfe7c9b663f55e8f618e 100644 --- a/one_armed_bandit.c +++ b/one_armed_bandit.c @@ -4,22 +4,24 @@ #include <stdbool.h> #include <assert.h> #include <unistd.h> -#include <pthread.h> +// #include <pthread.h> #include <semaphore.h> #include "utilities.h" #include "display.h" #include "one_armed_bandit.h" +// #include "wheel.h" +#include "threads.h" int insert_coin(){ - + return -1; } int set_wheel_speed(int index){ - + return -1; } int next_wheel(){ - + return -1; } diff --git a/one_armed_bandit.h b/one_armed_bandit.h index 13d21dbf7a4d5245a3afcf5aaef04a769e944f76..ddc610e3f09a7c65024af7f96e0dbb03c0b19ea4 100644 --- a/one_armed_bandit.h +++ b/one_armed_bandit.h @@ -1,6 +1,7 @@ #ifndef ONE_ARM_H #define ONE_ARM_H +#include "wheel.h" #define OBJECT_NB 7 #define WHEEL_NB 3 diff --git a/one_armed_bandit.o b/one_armed_bandit.o deleted file mode 100644 index 3befc5d830bdc07e6e9109c566c5e2ca22f21591..0000000000000000000000000000000000000000 Binary files a/one_armed_bandit.o and /dev/null differ diff --git a/threads.h b/threads.h index 437e6efae56813c4ebe534778cd397100b1f7361..fe3df24879fb9caa5d82052277b2dfb46db81e02 100644 --- a/threads.h +++ b/threads.h @@ -3,19 +3,9 @@ * Small library to ease the use of pthread */ +//TODO: MALLOOOOOOOCC -/* - ___ _ - / _ )___ _________(_)__ ____ - / _ / _ `/ __/ __/ / -_) __/ - /____/\_,_/_/ /_/ /_/\__/_/ - |^| |^| |^| |^| - | |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| | - | |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| | - | |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| |-| | - -*/ #define __GNU_SOURCE // #include <stdio.h> diff --git a/utilities.o b/utilities.o deleted file mode 100644 index 2428ff3883394c0af87942959a341e1fe4796001..0000000000000000000000000000000000000000 Binary files a/utilities.o and /dev/null differ diff --git a/wheel.c b/wheel.c index 716c7910d46e889a6a986771672a770bfad4e71d..bff12f2c4db7f22937f421899ad7aa7207de2fbe 100644 --- a/wheel.c +++ b/wheel.c @@ -1,7 +1,7 @@ int set_speed(int s){ - + return -1; } int get_current_px(){ - + return -1; }