diff --git a/source/proc_mapa.cpp b/source/proc_mapa.cpp index 03c8feb..5fac2f7 100644 --- a/source/proc_mapa.cpp +++ b/source/proc_mapa.cpp @@ -4,6 +4,19 @@ #include "aux_font.h" namespace mapa { + namespace botons + { + const int caminar = 0; + const int parar = 1; + const int cavar = 2; + const int escalar = 3; + const int perforar = 4; + const int escalera = 5; + const int pasarela = 6; + const int corda = 7; + const int suicidi = 8; + const int fastforward = 9; + } namespace arounders { int orientacio_inicial {0}; @@ -148,9 +161,46 @@ namespace mapa } } - int procesar(int mousex, int mousey); + const int procesar() + { + int boto = -1; - void setAroundersNum(const int orient, const int total, const int necessaris); - void setActions(const int parar, const int cavar, const int escalar, const int perforar, const int escalera, const int pasarela, const int corda); + if (input::mouseY() >= 171 && input::mouseY() <= 187 && input::mouseX() >= 5 && input::mouseX() <= 165) { + boto = (input::mouseX()-5) / 16; + + switch(boto) { + case mapa::botons::parar: + if (mapa::accions::parar == 0) boto = -1; + break; + case mapa::botons::cavar: + if (mapa::accions::cavar == 0) boto = -1; + break; + case mapa::botons::escalar: + if (mapa::accions::escalar == 0) boto = -1; + break; + case mapa::botons::perforar: + if (mapa::accions::perforar == 0) boto = -1; + break; + case mapa::botons::escalera: + if (mapa::accions::escalera == 0) boto = -1; + break; + case mapa::botons::pasarela: + if (mapa::accions::pasarela == 0) boto = -1; + break; + case mapa::botons::corda: + if (mapa::accions::corda == 0) boto = -1; + break; + case botons::fastforward: + if (mapa::velocitat == 70) { + mapa::velocitat = 10; + } else { + mapa::velocitat = 70; + } + boto = -1; + break; + } + } + return boto; + } } \ No newline at end of file diff --git a/source/proc_mapa.h b/source/proc_mapa.h index 8b0dced..f1a2b55 100644 --- a/source/proc_mapa.h +++ b/source/proc_mapa.h @@ -29,9 +29,5 @@ namespace mapa void carregar(); void pintar(int accio, int prevista); - int procesar(int mousex, int mousey); - - void setAroundersNum(const int orient, const int total, const int necessaris); - void setActions(const int parar, const int cavar, const int escalar, const int perforar, const int escalera, const int pasarela, const int corda); - + const int procesar(); } \ No newline at end of file