Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -1,65 +0,0 @@
|
|||
#include "Utility/AffineMatrix.h"
|
||||
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
|
||||
float ClientSin(float radians) {
|
||||
return std::sin(radians);
|
||||
}
|
||||
|
||||
float ClientCos(float radians) {
|
||||
return std::cos(radians);
|
||||
}
|
||||
|
||||
namespace {
|
||||
// OFFSET: 0x00554280
|
||||
// FUNCTION: fn_02021
|
||||
// The six adjacent arrays are one contiguous addressing domain: negative lookup indices intentionally reach
|
||||
// the preceding array's tail, not abs(index) in the negative array.
|
||||
struct AngleTables {
|
||||
float radians[361];
|
||||
float negativeRadians[361];
|
||||
float sine[361];
|
||||
float negativeSine[361];
|
||||
float cosine[361];
|
||||
float negativeCosine[361];
|
||||
|
||||
AngleTables() {
|
||||
for (int index = 0; index <= 360; ++index) {
|
||||
const float angle = (static_cast<float>(index) / 180.0f) * 3.141592f;
|
||||
radians[index] = angle;
|
||||
sine[index] = ClientSin(angle);
|
||||
cosine[index] = ClientCos(angle);
|
||||
negativeRadians[index] = -angle;
|
||||
negativeSine[index] = -sine[index];
|
||||
negativeCosine[index] = -cosine[index];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const AngleTables tables;
|
||||
int Wrapped(int degrees) {
|
||||
return degrees > 360 || degrees < -360 ? degrees % 360 : degrees;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00554420
|
||||
// FUNCTION: fn_02024
|
||||
float ClientRadians(int degrees) {
|
||||
const int index = Wrapped(degrees);
|
||||
return tables.radians[index >= 0 ? index : 361 + index];
|
||||
}
|
||||
|
||||
// OFFSET: 0x00554470
|
||||
// FUNCTION: fn_02025
|
||||
float ClientSine(int degrees) {
|
||||
const int index = Wrapped(degrees);
|
||||
return tables.sine[index >= 0 ? index : 361 + index];
|
||||
}
|
||||
|
||||
// OFFSET: 0x005543D0
|
||||
// FUNCTION: fn_02023
|
||||
float ClientCosine(int degrees) {
|
||||
const int index = Wrapped(degrees);
|
||||
return tables.cosine[index >= 0 ? index : 361 + index];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue