diff --git a/Source/asm_trans_rect.inc b/Source/asm_trans_rect.inc index e34bb1ffe..e192e8eaa 100644 --- a/Source/asm_trans_rect.inc +++ b/Source/asm_trans_rect.inc @@ -15,7 +15,7 @@ __asm { mov edi, gpBuffer ; origin is at 64,160 - add edi, (160 + TRANS_RECT_Y + TRANS_RECT_HEIGHT - 1) * BUFFER_WIDTH + 64 + TRANS_RECT_X + add edi, (SCREEN_Y + TRANS_RECT_Y + TRANS_RECT_HEIGHT - 1) * BUFFER_WIDTH + 64 + TRANS_RECT_X xor eax, eax mov edx, TRANS_RECT_HEIGHT >> 1 yloop: diff --git a/Source/automap.cpp b/Source/automap.cpp index 37f0151e5..d7e0002c1 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -173,7 +173,7 @@ void DrawAutomap() return; } - gpBufEnd = (unsigned char *)&gpBuffer[(VIEWPORT_HEIGHT + 160) * 768]; + gpBufEnd = (unsigned char *)&gpBuffer[(VIEWPORT_HEIGHT + SCREEN_Y) * 768]; MapX = (ViewX - 16) >> 1; while (MapX + AutoMapXOfs < 0) diff --git a/Source/control.cpp b/Source/control.cpp index 9c2ed89c2..29b5d712c 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1652,7 +1652,7 @@ void PrintGameStr(int x, int y, char *str, int color) { BYTE c; int off; - off = PitchTbl[y + 160] + x + 64; + off = PitchTbl[y + SCREEN_Y] + x + 64; while (*str) { c = gbFontTransTbl[(BYTE)*str++]; c = fontframe[c]; @@ -1874,7 +1874,7 @@ void ADD_PlrStringXY(int x, int y, int width, char *pszStr, char col) char *tmp; int nOffset, screen_x, line, widthOffset; - nOffset = x + PitchTbl[y + 160] + 64; + nOffset = x + PitchTbl[y + SCREEN_Y] + 64; widthOffset = width - x + 1; line = 0; screen_x = 0; @@ -1904,7 +1904,7 @@ void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base) char *tmp; int nOffset, screen_x, line, widthOffset; - nOffset = x + PitchTbl[y + 160] + 64; + nOffset = x + PitchTbl[y + SCREEN_Y] + 64; widthOffset = width - x + 1; line = 0; screen_x = 0; diff --git a/Source/engine.cpp b/Source/engine.cpp index 850b2207e..55a16dffb 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -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 >= VIEWPORT_HEIGHT + 160) { + if (y0 < 0 + SCREEN_Y || y0 >= VIEWPORT_HEIGHT + SCREEN_Y) { gbNotInView = TRUE; } - if (y1 < 0 + 160 || y1 >= VIEWPORT_HEIGHT + 160) { + if (y1 < 0 + SCREEN_Y || y1 >= VIEWPORT_HEIGHT + SCREEN_Y) { gbNotInView = TRUE; } diff --git a/Source/interfac.cpp b/Source/interfac.cpp index 25257702c..a1efeffbd 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -41,7 +41,7 @@ void DrawCutscene() for (i = 0; i < sgdwProgress; i++) { DrawProgress( progress_bar_screen_pos[progress_id][0] + i + 64, - progress_bar_screen_pos[progress_id][1] + 160, + progress_bar_screen_pos[progress_id][1] + SCREEN_Y, progress_id); } diff --git a/Source/town.cpp b/Source/town.cpp index 81d0e7e1f..f05f03418 100644 --- a/Source/town.cpp +++ b/Source/town.cpp @@ -1004,7 +1004,7 @@ void T_DrawGame(int x, int y) } /// ASSERT: assert(gpBuffer); - gpBufEnd = &gpBuffer[PitchTbl[160]]; + gpBufEnd = &gpBuffer[PitchTbl[SCREEN_Y]]; for (i = 0; i < 7; i++) { town_draw_upper(x, y, sx, sy, chunks, i, 0); y++;