metaforce/Runtime/MP1/Tweaks/CTweakGui.cpp

216 lines
6.2 KiB
C++

#include "CTweakGui.hpp"
namespace urde
{
u32 ReadUnknownValx27c(CInputStream& in)
{
u32 tmp = in.readUint32Big();
if (tmp == 1)
return 2;
else if (tmp == 2)
return 4;
else if (tmp == 3)
return 5;
return 0;
}
std::vector<float> ReadScanSpeeds(CInputStream& in)
{
u32 count = in.readUint32Big();
std::vector<float> ret;
ret.reserve(count);
for (u32 i = 0 ; i<count ; ++i)
ret.push_back(in.readFloatBig());
return ret;
}
CTweakGui::CTweakGui(CInputStream& in)
: x4_(in.readBool()),
x8_(in.readFloatBig()),
xc_(in.readFloatBig()),
x10_(in.readFloatBig()),
x14_(in.readFloatBig()),
x18_(in.readFloatBig()),
x1c_(in.readFloatBig()),
x20_(in.readFloatBig()),
x24_(in.readFloatBig()),
x28_(in.readFloatBig()),
x30_(in.readFloatBig()),
x34_(in.readFloatBig()),
x38_(in.readFloatBig()),
x3c_(in.readFloatBig()),
x40_(in.readBool()),
x44_(in.readFloatBig()),
x48_(in.readFloatBig()),
x4c_(in.readFloatBig()),
x50_(in.readFloatBig()),
x54_(in.readFloatBig()),
x58_(in.readFloatBig()),
x5c_(in.readFloatBig()),
x60_(in.readFloatBig()),
x64_(in.readVec3fBig()),
x70_(in.readVec3fBig()),
x7c_(in.readFloatBig()),
x80_(in.readFloatBig()),
x84_(in.readFloatBig()),
x88_(in.readFloatBig()),
x8c_(in.readFloatBig()),
x90_(in.readFloatBig()),
x94_(in.readFloatBig()),
x98_(in.readFloatBig()),
x9c_(in.readFloatBig()),
xa0_(in.readFloatBig()),
xa4_(in.readFloatBig()),
xa8_(in.readUint32Big()),
xac_(in.readUint32Big()),
xb0_(in.readUint32Big()),
xb4_(in.readFloatBig()),
xb8_(in.readFloatBig()),
xbc_(in.readFloatBig()),
xc0_(in.readFloatBig()),
xc4_(in.readFloatBig()),
xc8_(in.readFloatBig()),
xcc_(in.readFloatBig()),
xd0_(in.readFloatBig()),
xd4_(in.readUint32Big()),
xd8_(6.2831855f * (0.0027777778f * in.readFloatBig())),
xdc_(6.2831855f * (0.0027777778f * in.readFloatBig())),
xe0_(in.readFloatBig()),
xe4_(in.readFloatBig()),
xe8_(in.readFloatBig()),
xec_(in.readFloatBig()),
xf0_(in.readFloatBig()),
xf4_(in.readFloatBig()),
xf8_(in.readUint32Big()),
xfc_(in.readUint32Big()),
x100_(in.readUint32Big()),
x104_(in.readUint32Big()),
x108_(in.readUint32Big()),
x10c_(in.readUint32Big()),
x110_(in.readFloatBig()),
x114_(in.readFloatBig()),
x11c_(in.readFloatBig()),
x120_(in.readFloatBig()),
x124_(in.readFloatBig()),
x128_(in.readFloatBig()),
x12c_(in.readFloatBig()),
x130_(in.readBool()),
x134_(in.readFloatBig()),
x138_(in.readFloatBig()),
x13c_(float(in.readUint32Big())),
x140_(float(in.readUint32Big())),
x144_(float(in.readUint32Big())),
x148_(float(in.readUint32Big())),
x14c_(float(in.readUint32Big())),
x150_(in.readString()),
x160_(in.readString()),
x170_(in.readString()),
x180_(in.readString()),
x190_(in.readString()),
x1a0_(in.readFloatBig()),
x1a4_(in.readFloatBig()),
x1a8_(in.readFloatBig()),
x1ac_(in.readFloatBig()),
x1b0_(in.readFloatBig()),
x1b4_(in.readFloatBig()),
x1b8_(in.readFloatBig()),
x1bc_(in.readFloatBig()),
x1c0_(in.readFloatBig()),
x1c4_(in.readFloatBig()),
x1c8_(in.readFloatBig()),
x1cc_(in.readBool()),
x1cd_(in.readBool()),
x1d0_(in.readFloatBig()),
x1d4_(in.readFloatBig()),
x1d8_(in.readFloatBig()),
x1dc_(in.readFloatBig()),
x1e0_(in.readFloatBig()),
x1e4_(in.readFloatBig()),
x1e8_(in.readFloatBig()),
x1ec_(in.readFloatBig()),
x1f0_(in.readFloatBig()),
x1f4_(in.readFloatBig()),
x1f8_(in.readFloatBig()),
x1fc_(in.readFloatBig()),
x200_(x1f4_ * 0.25f, x1f8_ * 0.25f, x1fc_ * 0.25f, 1.0f),
x20c_(in.readFloatBig()),
x210_(6.2831855f * (0.0027777778f * in.readFloatBig())),
x214_(in.readFloatBig()),
x218_(in.readFloatBig()),
x21c_(in.readFloatBig()),
x220_(in.readFloatBig()),
x224_(in.readFloatBig()),
x228_(x220_ + x224_),
x22c_(in.readFloatBig()),
x230_(in.readFloatBig()),
x234_(in.readFloatBig()),
x238_(in.readFloatBig()),
x23c_(in.readFloatBig()),
x240_(in.readFloatBig()),
x244_(in.readFloatBig()),
x248_(in.readFloatBig()),
x24c_(in.readFloatBig()),
x250_(in.readFloatBig()),
x254_(in.readFloatBig()),
x258_(in.readFloatBig()),
x25c_(in.readFloatBig()),
x260_(in.readFloatBig()),
x264_(in.readFloatBig()),
x268_(in.readFloatBig()),
x26c_(in.readFloatBig()),
x270_(in.readFloatBig()),
x274_(in.readBool()),
x278_(in.readFloatBig()),
x27c_(ReadUnknownValx27c(in)),
x280_(in.readFloatBig()),
x284_(in.readFloatBig()),
x288_(in.readVec4fBig()),
x28c_(in.readFloatBig()),
x290_(in.readVec4fBig()),
x294_(in.readVec4fBig()),
x298_(in.readVec4fBig()),
x29c_(in.readVec4fBig()),
x2a0_(in.readVec4fBig()),
x2a4_(in.readVec4fBig()),
x2a8_(in.readVec4fBig()),
x2ac_(in.readVec4fBig()),
x2b0_(in.readVec4fBig()),
x2b4_(in.readVec4fBig()),
x2b8_(in.readFloatBig()),
x2bc_(in.readFloatBig()),
x2c0_(in.readFloatBig()),
x2c4_scanSpeeds(ReadScanSpeeds(in)),
x2d0_(in.readString()),
x2e0_(in.readString()),
x2f0_(in.readString()),
x300_(in.readVec4fBig()),
x304_(in.readVec4fBig()),
x308_(in.readFloatBig()),
x30c_(in.readFloatBig()),
x310_(in.readFloatBig()),
x314_(in.readString()),
x324_(in.readString()),
x334_(in.readString()),
x344_(in.readVec4fBig()),
x348_(in.readVec4fBig()),
x34c_(in.readVec4fBig()),
x350_(in.readVec4fBig()),
x354_(in.readVec4fBig()),
x358_(in.readVec4fBig()),
x35c_(in.readFloatBig()),
x360_(in.readFloatBig()),
x364_(in.readFloatBig())
{
x84_ *= 2.0f;
}
float CTweakGui::GetScanSpeed(s32 idx) const
{
if (idx < 0 || idx >= x2c4_scanSpeeds.size())
return 0.f;
return x2c4_scanSpeeds[idx];
}
}