Replace magic number 352 with VIEWPORT_HEIGHT (#1232)

This commit is contained in:
Manuel K 2019-06-02 18:51:33 +02:00 committed by Anders Jenbo
commit 896933f55e
13 changed files with 30 additions and 28 deletions

View file

@ -801,7 +801,7 @@ BOOL LeftMouseDown(int wParam)
SetSpell();
} else if (stextflag) {
CheckStoreBtn();
} else if (MouseY < 352) {
} else if (MouseY < VIEWPORT_HEIGHT) {
if (!gmenu_exception() && !TryIconCurs()) {
if (questlog && MouseX > 32 && MouseX < 288 && MouseY > 32 && MouseY < 308) {
QuestlogESC();
@ -844,7 +844,7 @@ BOOL LeftMouseCmd(BOOL bShift)
{
BOOL bNear;
/// ASSERT: assert(MouseY < 352);
/// ASSERT: assert(MouseY < VIEWPORT_HEIGHT);
if (leveltype == DTYPE_TOWN) {
if (pcursitem != -1 && pcurs == CURSOR_HAND)
@ -972,7 +972,7 @@ void RightMouseDown()
} else if (!stextflag) {
if (spselflag) {
SetSpell();
} else if (MouseY >= 352
} else if (MouseY >= VIEWPORT_HEIGHT
|| (!sbookflag || MouseX <= 320)
&& !TryIconCurs()
&& (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem))) {
@ -1210,10 +1210,10 @@ void PressKey(int vkey)
} else if(vkey == VK_TAB) {
DoAutoMap();
} else if(vkey == VK_SPACE) {
if(!chrflag && invflag && MouseX < 480 && MouseY < 352) {
if(!chrflag && invflag && MouseX < 480 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX + 160, MouseY);
}
if(!invflag && chrflag && MouseX > 160 && MouseY < 352) {
if(!invflag && chrflag && MouseX > 160 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX - 160, MouseY);
}
helpflag = 0;
@ -1294,11 +1294,11 @@ void PressChar(int vkey)
sbookflag = 0;
invflag = invflag == 0;
if(!invflag || chrflag) {
if(MouseX < 480 && MouseY < 352) {
if(MouseX < 480 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX + 160, MouseY);
}
} else {
if(MouseX > 160 && MouseY < 352) {
if(MouseX > 160 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX - 160, MouseY);
}
}
@ -1310,11 +1310,11 @@ void PressChar(int vkey)
questlog = FALSE;
chrflag = chrflag == 0;
if(!chrflag || invflag) {
if(MouseX > 160 && MouseY < 352) {
if(MouseX > 160 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX - 160, MouseY);
}
} else {
if(MouseX < 480 && MouseY < 352) {
if(MouseX < 480 && MouseY < VIEWPORT_HEIGHT) {
SetCursorPos(MouseX + 160, MouseY);
}
}