mirror of
https://github.com/diasurgical/devilution.git
synced 2026-05-21 05:40:54 +00:00
Replace magic number 352 with VIEWPORT_HEIGHT (#1232)
This commit is contained in:
+1
-1
@@ -173,7 +173,7 @@ void DrawAutomap()
|
||||
return;
|
||||
}
|
||||
|
||||
gpBufEnd = (unsigned char *)&gpBuffer[(352 + 160) * 768];
|
||||
gpBufEnd = (unsigned char *)&gpBuffer[(VIEWPORT_HEIGHT + 160) * 768];
|
||||
|
||||
MapX = (ViewX - 16) >> 1;
|
||||
while (MapX + AutoMapXOfs < 0)
|
||||
|
||||
+4
-4
@@ -2092,7 +2092,7 @@ void RedBack()
|
||||
add edi, SCREENXY(0, 0)
|
||||
mov ebx, pLightTbl
|
||||
add ebx, idx
|
||||
mov edx, 352
|
||||
mov edx, VIEWPORT_HEIGHT
|
||||
lx_label1:
|
||||
mov ecx, 640
|
||||
lx_label2:
|
||||
@@ -2110,7 +2110,7 @@ void RedBack()
|
||||
add edi, SCREENXY(0, 0)
|
||||
mov ebx, pLightTbl
|
||||
add ebx, idx
|
||||
mov edx, 352
|
||||
mov edx, VIEWPORT_HEIGHT
|
||||
l4_label1:
|
||||
mov ecx, 640
|
||||
l4_label2:
|
||||
@@ -2133,7 +2133,7 @@ void RedBack()
|
||||
if (leveltype != DTYPE_HELL) {
|
||||
dst = &gpBuffer[SCREENXY(0, 0)];
|
||||
tbl = &pLightTbl[idx];
|
||||
for (h = 352; h; h--, dst += 768 - 640) {
|
||||
for (h = VIEWPORT_HEIGHT; h; h--, dst += 768 - 640) {
|
||||
for (w = 640; w; w--) {
|
||||
*dst = tbl[*dst];
|
||||
dst++;
|
||||
@@ -2142,7 +2142,7 @@ void RedBack()
|
||||
} else {
|
||||
dst = &gpBuffer[SCREENXY(0, 0)];
|
||||
tbl = &pLightTbl[idx];
|
||||
for (h = 352; h; h--, dst += 768 - 640) {
|
||||
for (h = VIEWPORT_HEIGHT; h; h--, dst += 768 - 640) {
|
||||
for (w = 640; w; w--) {
|
||||
if (*dst >= 32)
|
||||
*dst = tbl[*dst];
|
||||
|
||||
+3
-3
@@ -190,8 +190,8 @@ void CheckCursMove()
|
||||
sx = 0;
|
||||
}
|
||||
}
|
||||
if(sy > 351 && track_isscrolling()) {
|
||||
sy = 351;
|
||||
if(sy > VIEWPORT_HEIGHT - 1 && track_isscrolling()) {
|
||||
sy = VIEWPORT_HEIGHT - 1;
|
||||
}
|
||||
if(!zoomflag) {
|
||||
sx >>= 1;
|
||||
@@ -271,7 +271,7 @@ void CheckCursMove()
|
||||
cursmy = my;
|
||||
return;
|
||||
}
|
||||
if(MouseY > 352) {
|
||||
if(MouseY > VIEWPORT_HEIGHT) {
|
||||
CheckPanelInfo();
|
||||
return;
|
||||
}
|
||||
|
||||
+9
-9
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -2123,10 +2123,10 @@ void DrawLine(int x0, int y0, int x1, int y1, BYTE col)
|
||||
if (x1 < 0 + 64 || x1 >= 640 + 64) {
|
||||
gbNotInView = TRUE;
|
||||
}
|
||||
if (y0 < 0 + 160 || y0 >= 352 + 160) {
|
||||
if (y0 < 0 + 160 || y0 >= VIEWPORT_HEIGHT + 160) {
|
||||
gbNotInView = TRUE;
|
||||
}
|
||||
if (y1 < 0 + 160 || y1 >= 352 + 160) {
|
||||
if (y1 < 0 + 160 || y1 >= VIEWPORT_HEIGHT + 160) {
|
||||
gbNotInView = TRUE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -539,7 +539,7 @@ void SetDungeonMicros()
|
||||
|
||||
if (zoomflag) {
|
||||
scr_pix_width = 640;
|
||||
scr_pix_height = 352;
|
||||
scr_pix_height = VIEWPORT_HEIGHT;
|
||||
dword_5C2FF8 = 10;
|
||||
dword_5C2FFC = 11;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -359,7 +359,7 @@ BOOL gmenu_left_mouse(BOOL isDown)
|
||||
if (!sgpCurrentMenu) {
|
||||
return FALSE;
|
||||
}
|
||||
if (MouseY >= 352) {
|
||||
if (MouseY >= VIEWPORT_HEIGHT) {
|
||||
return FALSE;
|
||||
}
|
||||
if (MouseY - 117 >= 0) {
|
||||
|
||||
+1
-1
@@ -1363,7 +1363,7 @@ void CheckInvItem()
|
||||
void CheckInvScrn()
|
||||
{
|
||||
if (MouseX > 190 && MouseX < 437
|
||||
&& MouseY > 352 && MouseY < 385) {
|
||||
&& MouseY > VIEWPORT_HEIGHT && MouseY < 385) {
|
||||
CheckInvItem();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3618,7 +3618,7 @@ void CheckPlrSpell()
|
||||
}
|
||||
|
||||
if (pcurs != CURSOR_HAND
|
||||
|| MouseY >= 352
|
||||
|| MouseY >= VIEWPORT_HEIGHT
|
||||
|| (chrflag && MouseX < 320 || invflag && MouseX > 320)
|
||||
&& rspell != SPL_HEAL
|
||||
&& rspell != SPL_IDENTIFY
|
||||
|
||||
+2
-2
@@ -432,7 +432,7 @@ void DrawGame(int x, int y)
|
||||
int i, sx, sy, chunks, blocks;
|
||||
|
||||
scr_pix_width = 640;
|
||||
scr_pix_height = 352;
|
||||
scr_pix_height = VIEWPORT_HEIGHT;
|
||||
dword_5C2FF8 = 10;
|
||||
dword_5C2FFC = 11;
|
||||
|
||||
@@ -505,7 +505,7 @@ void DrawGame(int x, int y)
|
||||
sy += 16;
|
||||
}
|
||||
/// ASSERT: assert(gpBuffer);
|
||||
gpBufEnd = &gpBuffer[PitchTbl[352 + SCREEN_Y]];
|
||||
gpBufEnd = &gpBuffer[PitchTbl[VIEWPORT_HEIGHT + SCREEN_Y]];
|
||||
for (i = 0; i < blocks; i++) {
|
||||
scrollrt_draw_lower(x, y, sx, sy, chunks, 0);
|
||||
y++;
|
||||
|
||||
+2
-2
@@ -931,7 +931,7 @@ void T_DrawGame(int x, int y)
|
||||
int i, sx, sy, chunks, blocks;
|
||||
|
||||
scr_pix_width = 640;
|
||||
scr_pix_height = 352;
|
||||
scr_pix_height = VIEWPORT_HEIGHT;
|
||||
dword_5C2FF8 = 10;
|
||||
dword_5C2FFC = 11;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ void SetTownMicros()
|
||||
|
||||
if (zoomflag) {
|
||||
scr_pix_width = 640;
|
||||
scr_pix_height = 352;
|
||||
scr_pix_height = VIEWPORT_HEIGHT;
|
||||
dword_5C2FF8 = 10;
|
||||
dword_5C2FFC = 11;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -654,7 +654,7 @@ void CheckTrigForce()
|
||||
{
|
||||
trigflag = FALSE;
|
||||
|
||||
if(MouseY > 352 - 1) {
|
||||
if(MouseY > VIEWPORT_HEIGHT - 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user