From 1d065062a6adff2154cccb6def004bae952e6f3c Mon Sep 17 00:00:00 2001 From: untakenstupidnick Date: Wed, 31 Jul 2019 00:20:57 +0430 Subject: [PATCH] fix PDCurses conflict --- nbsdgames | 1 + sources/battleship.c | 6 +++++- sources/checkers.c | 6 +++++- sources/fifteen.c | 4 ++++ sources/memoblocks.c | 4 ++++ sources/mines.c | 4 ++++ sources/pipes.c | 6 +++++- sources/reversi.c | 6 +++++- sources/sos.c | 6 +++++- 9 files changed, 38 insertions(+), 5 deletions(-) create mode 160000 nbsdgames diff --git a/nbsdgames b/nbsdgames new file mode 160000 index 0000000..f27eb28 --- /dev/null +++ b/nbsdgames @@ -0,0 +1 @@ +Subproject commit f27eb28a8c22aa899019d1ae194d4d0592317336 diff --git a/sources/battleship.c b/sources/battleship.c index fb09d08..40f41df 100644 --- a/sources/battleship.c +++ b/sources/battleship.c @@ -46,7 +46,11 @@ void sigint_handler(int x){ } void mouseinput(bool ingame){ MEVENT minput; - getmouse(&minput); + #ifdef PDCURSES + nc_getmouse(&minput); + #else + getmouse(&minput); + #endif if(minput.bstate & (BUTTON1_CLICKED|BUTTON1_RELEASED)){ if( minput.y-4 < 10){ if( (ingame && minput.x-23<20 && minput.x-23>=0 ) || (!ingame && minput.x-1<20) ){//it most be on the trackboard if ingame is true diff --git a/sources/checkers.c b/sources/checkers.c index bbbefc6..8dcc5fb 100644 --- a/sources/checkers.c +++ b/sources/checkers.c @@ -440,7 +440,11 @@ void sigint_handler(int x){ void mouseinput(void){ MEVENT minput; - getmouse(&minput); + #ifdef PDCURSES + nc_getmouse(&minput); + #else + getmouse(&minput); + #endif if( minput.y-4 <8 && minput.x-1<16){ py=minput.y-4; px=(minput.x-1)/2; diff --git a/sources/fifteen.c b/sources/fifteen.c index a08c305..410fda0 100644 --- a/sources/fifteen.c +++ b/sources/fifteen.c @@ -135,7 +135,11 @@ void sigint_handler(int x){ } void mouseinput(void){ MEVENT minput; + #ifdef PDCURSES + nc_getmouse(&minput); + #else getmouse(&minput); + #endif if( minput.y-4