From 7e1085ea4264d6e7285a32cea945c25a8c242650 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 9 Sep 2024 11:28:24 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adida=20la=20unidad=20service.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/service.cpp | 29 +++++++++++++++++++++++++++++ source/service.h | 15 +++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 source/service.cpp create mode 100644 source/service.h diff --git a/source/service.cpp b/source/service.cpp new file mode 100644 index 0000000..dd8ae34 --- /dev/null +++ b/source/service.cpp @@ -0,0 +1,29 @@ +#include "service.h" + +int checkServiceButton(Input *input) +{ + if (input->checkInput(input_service)) + { + if (input->checkInput(input_start)) + { + return SERVICE_EXIT; + } + + else if (input->checkInput(input_fire_left)) + { + return SERVICE_CONFIG; + } + + else if (input->checkInput(input_fire_center)) + { + return SERVICE_SHADERS; + } + + else if (input->checkInput(input_fire_right)) + { + return SERVICE_PAUSE; + } + } + + return SERVICE_NULL; +} \ No newline at end of file diff --git a/source/service.h b/source/service.h new file mode 100644 index 0000000..754e99d --- /dev/null +++ b/source/service.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include "common/utils.h" +#include "common/input.h" +#include "const.h" + +#define SERVICE_NULL 0 +#define SERVICE_EXIT 1 +#define SERVICE_CONFIG 2 +#define SERVICE_SHADERS 3 +#define SERVICE_PAUSE 4 + +// Comprueba el botón de servicio +int checkServiceButton(Input *input); \ No newline at end of file