shithub: cstory

Download patch

ref: 5adc06536bcfe53d8af62dcb7925ac0e37279ec7
parent: 3f2d5c3e25644aec0ddffa38f77c9ea985aea5f7
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Jan 7 17:13:37 EST 2020

More-accurate Triangle.cpp variable arrangement

--- a/src/Triangle.cpp
+++ b/src/Triangle.cpp
@@ -8,15 +8,13 @@
 void InitTriangleTable(void)
 {
 	int i;
-	float a;
-	float b;
 
 	// Sine
 	for (i = 0; i < 0x100; ++i)
-	{
 		gSin[i] = (int)(sin(i * 6.2831998 / 256.0) * 512.0);
-	}
 
+	float a, b;
+
 	// Tangent
 	for (i = 0; i < 0x21; ++i)
 	{
@@ -39,8 +37,8 @@
 
 unsigned char GetArktan(int x, int y)
 {
-	unsigned char a;
 	short k;
+	unsigned char a;
 
 	x *= -1;
 	y *= -1;