1
0
mirror of https://github.com/abakh/nbsdgames.git synced 2024-06-08 17:20:41 +00:00

fix PDCurses conflict

This commit is contained in:
untakenstupidnick 2019-07-31 00:20:57 +04:30
parent f27eb28a8c
commit 1d065062a6
9 changed files with 38 additions and 5 deletions

1
nbsdgames Submodule

@ -0,0 +1 @@
Subproject commit f27eb28a8c22aa899019d1ae194d4d0592317336

View File

@ -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

View File

@ -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;

View File

@ -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<size && minput.x-1<size*2){
py=minput.y-4;
px=(minput.x-1)/2;

View File

@ -116,7 +116,11 @@ void sigint_handler(int x){
}
void mouseinput(void){
MEVENT minput;
#ifdef PDCURSES
nc_getmouse(&minput);
#else
getmouse(&minput);
#endif
if( minput.y-4<size && minput.x-1<size2){
py=minput.y-4;
px=(minput.x-1);

View File

@ -148,7 +148,11 @@ void sigint_handler(int x){
}
void mouseinput(int sy, int sx){
MEVENT minput;
#ifdef PDCURSES
nc_getmouse(&minput);
#else
getmouse(&minput);
#endif
if( minput.y-4-sy<len && minput.x-1-sx<wid*2){
py=minput.y-4-sy;
px=(minput.x-1-sx)/2;

View File

@ -277,7 +277,11 @@ void draw(bitbox board[len][wid]){
void mouseinput(void){
MEVENT minput;
getmouse(&minput);
#ifdef PDCURSES
nc_getmouse(&minput);
#else
getmouse(&minput);
#endif
if( minput.y-4 <len && minput.x-1<wid*2){
py=minput.y-(1+SY);
px=minput.x-(1+SX);

View File

@ -215,7 +215,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;

View File

@ -179,7 +179,11 @@ void sigint_handler(int x){
}
void mouseinput(int sy,int sx){
MEVENT minput;
getmouse(&minput);
#ifdef PDCURSES
nc_getmouse(&minput);
#else
getmouse(&minput);
#endif
if( minput.y-4-sy <len && minput.x-1-sx<wid*2){
py=minput.y-4-sy;
px=(minput.x-1-sx)/2;