shithub: cstory

Download patch

ref: 55447a6c49c1095348aae05a24440f5a5adc34de
parent: 379365fd8695b0288a1328aa549ffdfc602cab4e
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Nov 15 20:48:13 EST 2019

Clean-up BossLife.cpp

--- a/src/BossLife.cpp
+++ b/src/BossLife.cpp
@@ -60,27 +60,26 @@
 	if (*gBL.pLife < 1)
 	{
 		gBL.flag = FALSE;
+		return;
 	}
+
+	rcLife.right = (*gBL.pLife * 198) / gBL.max;
+
+	if (gBL.br > *gBL.pLife)
+	{
+		if (++gBL.count > 30)
+			--gBL.br;
+	}
 	else
 	{
-		rcLife.right = 198 * *gBL.pLife / gBL.max;
+		gBL.count = 0;
+	}
 
-		if (gBL.br > *gBL.pLife)
-		{
-			if (++gBL.count > 30)
-				--gBL.br;
-		}
-		else
-		{
-			gBL.count = 0;
-		}
+	rcBr.right = (gBL.br * 198) / gBL.max;
 
-		rcBr.right = 198 * gBL.br / gBL.max;
-
-		PutBitmap3(&grcGame, (WINDOW_WIDTH - 256) / 2, WINDOW_HEIGHT - 20, &rcBox1, SURFACE_ID_TEXT_BOX);
-		PutBitmap3(&grcGame, (WINDOW_WIDTH - 256) / 2, WINDOW_HEIGHT - 12, &rcBox2, SURFACE_ID_TEXT_BOX);
-		PutBitmap3(&grcGame, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 16, &rcBr, SURFACE_ID_TEXT_BOX);
-		PutBitmap3(&grcGame, (WINDOW_WIDTH - 176) / 2, WINDOW_HEIGHT - 16, &rcLife, SURFACE_ID_TEXT_BOX);
-		PutBitmap3(&grcGame, (WINDOW_WIDTH - 240) / 2, WINDOW_HEIGHT - 16, &rcText, SURFACE_ID_TEXT_BOX);
-	}
+	PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 128, WINDOW_HEIGHT - 20, &rcBox1, SURFACE_ID_TEXT_BOX);
+	PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 128, WINDOW_HEIGHT - 12, &rcBox2, SURFACE_ID_TEXT_BOX);
+	PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 88, WINDOW_HEIGHT - 16, &rcBr, SURFACE_ID_TEXT_BOX);
+	PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 88, WINDOW_HEIGHT - 16, &rcLife, SURFACE_ID_TEXT_BOX);
+	PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 120, WINDOW_HEIGHT - 16, &rcText, SURFACE_ID_TEXT_BOX);
 }