ref: 77fc01311ff6541134fff682ee72435c011ddb62
parent: d52a69b0e6aad617fb2e8366b895f132d31d3755
author: Clownacy <[email protected]>
date: Fri Feb 1 08:49:45 EST 2019
Cleanup, accuracy, and a fix
--- a/src/Escape.cpp
+++ b/src/Escape.cpp
@@ -1,12 +1,15 @@
+#include "Escape.h"
+
#include "WindowsWrapper.h"
#include "Draw.h"
#include "KeyControl.h"
+#include "Main.h"
int Call_Escape()
{
RECT rc = {0, 128, 208, 144};
- while (Flip_SystemTask())
+ do
{
//Get pressed keys
GetTrg();
@@ -30,8 +33,9 @@
//Draw screen
CortBox(&grcFull, 0x000000);
PutBitmap3(&grcFull, 56, 112, &rc, 26);
- //PutFramePerSecound();
+ PutFramePerSecound();
}
+ while (Flip_SystemTask());
//Quit if window is closed
gKeyTrg = 0;
--- a/src/Flags.cpp
+++ b/src/Flags.cpp
@@ -1,3 +1,5 @@
+#include "Flags.h"
+
#include <cstring>
#include <stdint.h>
--- a/src/Triangle.cpp
+++ b/src/Triangle.cpp
@@ -9,17 +9,17 @@
//Sine
for (int i = 0; i < 0x100; ++i )
{
- float v0 = (float)i * 6.2831998 / 256.0;
+ float v0 = i * 6.2831998 / 256.0;
gSin[i] = (int)(sinf(v0) * 512.0);
}
//Tangent
- for (int ia = 0; ia < 0x21; ++ia )
+ for (int i = 0; i < 0x21; ++i )
{
- float a = (float)ia * 6.2831855 / 256.0;
+ float a = i * 6.2831855 / 256.0;
float v2 = sinf(a);
float b = v2 / cosf(a);
- gTan[ia] = (int16_t)(b * 8192.0);
+ gTan[i] = (int16_t)(b * 8192.0);
}
}