From 408c665a3c952ed1a4e2c195181a880fb6efafee Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 6 Jun 2022 12:37:31 +0200 Subject: [PATCH] Remove duplicate code in DRLG_MRectTrans --- Source/gendung.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 590b36e46..4ce913a0b 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -476,30 +476,24 @@ void DRLG_InitTrans() TransVal = 1; } -void DRLG_MRectTrans(int x1, int y1, int x2, int y2) +void DRLG_RectTrans(int x1, int y1, int x2, int y2) { - x1 = 2 * x1 + 17; - y1 = 2 * y1 + 17; - x2 = 2 * x2 + 16; - y2 = 2 * y2 + 16; - for (int j = y1; j <= y2; j++) { for (int i = x1; i <= x2; i++) { dTransVal[i][j] = TransVal; } } - TransVal++; } -void DRLG_RectTrans(int x1, int y1, int x2, int y2) +void DRLG_MRectTrans(int x1, int y1, int x2, int y2) { - for (int j = y1; j <= y2; j++) { - for (int i = x1; i <= x2; i++) { - dTransVal[i][j] = TransVal; - } - } - TransVal++; + x1 = 2 * x1 + 17; + y1 = 2 * y1 + 17; + x2 = 2 * x2 + 16; + y2 = 2 * y2 + 16; + + DRLG_RectTrans(x1, y1, x2, y2); } void DRLG_CopyTrans(int sx, int sy, int dx, int dy)