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

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