mirror of
https://github.com/PrimeDecomp/prime.git
synced 2026-07-12 18:18:56 -07:00
@@ -1,4 +1,3 @@
|
||||
// #pragma once
|
||||
#ifndef _CGUNWEAPON
|
||||
#define _CGUNWEAPON
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ CMRay::CMRay(const CVector3f& start, const CVector3f& end, float length, float i
|
||||
, mDelta(mEnd - mStart)
|
||||
, mLength(length)
|
||||
, mInvLength(invLength)
|
||||
, mDir(mInvLength * mDelta) {
|
||||
}
|
||||
, mDir(mInvLength * mDelta) {}
|
||||
|
||||
CMRay::CMRay(const CVector3f& start, const CVector3f& dir, float length)
|
||||
: mStart(start)
|
||||
@@ -18,7 +17,6 @@ CMRay::CMRay(const CVector3f& start, const CVector3f& dir, float length)
|
||||
, mInvLength(1.f / length)
|
||||
, mDir(dir) {}
|
||||
|
||||
|
||||
CMRay CMRay::GetInvUnscaledTransformRay(const CTransform4f& xf) const {
|
||||
CTransform4f invXf = xf.GetQuickInverse();
|
||||
return CMRay(invXf * mStart, invXf * mEnd, mLength, mInvLength);
|
||||
|
||||
@@ -7,24 +7,19 @@ COBBox::COBBox(const CTransform4f& xf, const CVector3f& extents)
|
||||
|
||||
COBBox::COBBox(CInputStream& in) : mTransform(in), mExtents(in) {}
|
||||
|
||||
CAABox COBBox::CalculateAABox(const CTransform4f& xf) const {
|
||||
}
|
||||
CAABox COBBox::CalculateAABox(const CTransform4f& xf) const {}
|
||||
|
||||
COBBox COBBox::FromAABox(const CAABox& box, const CTransform4f& xf) {
|
||||
CVector3f center = box.GetCenterPoint();
|
||||
CVector3f extents = box.GetMaxPoint() - center;
|
||||
CTransform4f final = xf * CTransform4f::Translate(center);
|
||||
return COBBox(final, extents);
|
||||
return COBBox(final, extents);
|
||||
}
|
||||
|
||||
bool COBBox::LineIntersectsBox(const CMRay& ray, float& penetration) const {
|
||||
|
||||
}
|
||||
bool COBBox::LineIntersectsBox(const CMRay& ray, float& penetration) const {}
|
||||
|
||||
bool COBBox::AABoxIntersectsBox(const CAABox& box) const {
|
||||
return OBBIntersectsBox(FromAABox(box, CTransform4f::Identity()));
|
||||
}
|
||||
|
||||
bool COBBox::OBBIntersectsBox(const COBBox& box) const {
|
||||
return false;
|
||||
}
|
||||
bool COBBox::OBBIntersectsBox(const COBBox& box) const { return false; }
|
||||
|
||||
+1
-3
@@ -345,9 +345,7 @@ void DTKNextTrack() {
|
||||
}
|
||||
}
|
||||
|
||||
u32 DTKGetState() {
|
||||
return __DTKState;
|
||||
}
|
||||
u32 DTKGetState() { return __DTKState; }
|
||||
|
||||
void DTKSetVolume(u8 left, u8 right) {
|
||||
__DTKVolumeL = left;
|
||||
|
||||
@@ -78,7 +78,7 @@ int COsContext::OpenWindow(const char* title, int x, int y, int w, int h, bool f
|
||||
if (mProgressiveMode) {
|
||||
x30_renderMode.viTVmode = VI_TVMODE_NTSC_PROG;
|
||||
x30_renderMode.xFBmode = VI_XFBMODE_SF;
|
||||
u8 progressiveFilterPattern[7] = {4, 4, 16, 16, 16, 4, 4 };
|
||||
u8 progressiveFilterPattern[7] = {4, 4, 16, 16, 16, 4, 4};
|
||||
memcpy(x30_renderMode.vfilter, progressiveFilterPattern, 7);
|
||||
}
|
||||
VIConfigure(&x30_renderMode);
|
||||
|
||||
@@ -4,20 +4,17 @@
|
||||
CStopwatch::CSWData CStopwatch::mData;
|
||||
CStopwatch CStopwatch::mGlobalTimer;
|
||||
|
||||
|
||||
bool CStopwatch::InitGlobalTimer() {
|
||||
mGlobalTimer.Reset();
|
||||
return true;
|
||||
mGlobalTimer.Reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CStopwatch::Wait(float wait) {
|
||||
if (fabs(wait) < 0.0010000000474974512) {
|
||||
mData.Wait(0.f);
|
||||
} else {
|
||||
mData.Wait(wait);
|
||||
}
|
||||
if (fabs(wait) < 0.0010000000474974512) {
|
||||
mData.Wait(0.f);
|
||||
} else {
|
||||
mData.Wait(wait);
|
||||
}
|
||||
}
|
||||
|
||||
CStopwatch& CStopwatch::GetGlobalTimerObj() {
|
||||
return mGlobalTimer;
|
||||
}
|
||||
CStopwatch& CStopwatch::GetGlobalTimerObj() { return mGlobalTimer; }
|
||||
|
||||
@@ -121,8 +121,8 @@ void ErrorHandler(OSError code, OSContext* context, int arg1, int arg2) {
|
||||
}
|
||||
|
||||
void SetErrorHandlers() {
|
||||
OSSetErrorHandler(2, (OSErrorHandler*) ErrorHandler);
|
||||
OSSetErrorHandler(3, (OSErrorHandler*) ErrorHandler);
|
||||
OSSetErrorHandler(5, (OSErrorHandler*) ErrorHandler);
|
||||
OSSetErrorHandler(15, (OSErrorHandler*) ErrorHandler);
|
||||
}
|
||||
OSSetErrorHandler(2, (OSErrorHandler*)ErrorHandler);
|
||||
OSSetErrorHandler(3, (OSErrorHandler*)ErrorHandler);
|
||||
OSSetErrorHandler(5, (OSErrorHandler*)ErrorHandler);
|
||||
OSSetErrorHandler(15, (OSErrorHandler*)ErrorHandler);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ float CLight::GetRadius() const {
|
||||
}
|
||||
|
||||
float CLight::CalculateLightRadius() const {
|
||||
if (x28_distL < gkEpsilon32 && x2c_distQ < gkEpsilon32) {
|
||||
if (x28_distL < gkEpsilon32 && x2c_distQ < gkEpsilon32) {
|
||||
return FLT_MAX;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,9 @@ float CLight::GetIntensity() const {
|
||||
if (x1c_type == kLT_Custom) {
|
||||
coef = x30_angleC;
|
||||
}
|
||||
x48_cachedIntensity = coef * rstl::max_val(x18_color.GetRed(), rstl::max_val(x18_color.GetGreen(), x18_color.GetBlue()));
|
||||
x48_cachedIntensity =
|
||||
coef *
|
||||
rstl::max_val(x18_color.GetRed(), rstl::max_val(x18_color.GetGreen(), x18_color.GetBlue()));
|
||||
}
|
||||
return x48_cachedIntensity;
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ const char* SObjectTag::Type2Text(FourCC type) {
|
||||
text[0] = toupper((type >> 24) & 0xFF);
|
||||
text[1] = toupper((type >> 16) & 0xFF);
|
||||
text[2] = toupper((type >> 8) & 0xFF);
|
||||
text[3] = toupper(type & 0xFF);
|
||||
text[3] = toupper(type & 0xFF);
|
||||
text[4] = '\0';
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
#include "Kyoto/Math/CMath.hpp"
|
||||
|
||||
CPlane::CPlane(const CVector3f& a, const CVector3f& b, const CVector3f& c)
|
||||
: x0_normal(CVector3f::Cross(b - a, c - a))
|
||||
, xc_constant(CVector3f::Dot(x0_normal, a)) {
|
||||
}
|
||||
: x0_normal(CVector3f::Cross(b - a, c - a)), xc_constant(CVector3f::Dot(x0_normal, a)) {}
|
||||
|
||||
float CPlane::ClipLineSegment(const CVector3f& start, const CVector3f& end) const {
|
||||
float dist = -(CVector3f::Dot(start, GetNormal()) - GetConstant()) / CVector3f::Dot(end - start, GetNormal());
|
||||
float dist = -(CVector3f::Dot(start, GetNormal()) - GetConstant()) /
|
||||
CVector3f::Dot(end - start, GetNormal());
|
||||
return dist <= 0.f ? 0.f : (dist >= 1.f ? 1.f : dist);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "Kyoto/Math/CUnitVector3f.hpp"
|
||||
|
||||
CUnitVector3f::CUnitVector3f(const CVector3f& vec)
|
||||
: CVector3f(vec.IsNonZero() ? vec.AsNormalized() : CVector3f::Zero()) {
|
||||
}
|
||||
: CVector3f(vec.IsNonZero() ? vec.AsNormalized() : CVector3f::Zero()) {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "Kyoto/Math/CVector3i.hpp"
|
||||
|
||||
CVector3i::CVector3i(int x, int y, int z)
|
||||
: mX(x), mY(y), mZ(z) {}
|
||||
CVector3i::CVector3i(int x, int y, int z) : mX(x), mY(y), mZ(z) {}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
#include "Kyoto/Math/CMath.hpp"
|
||||
|
||||
float CMath::SqrtF(float x) { return 0.f; }
|
||||
|
||||
float CMath::SqrtF(float x) {
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
double CMath::SqrtD(double x) {
|
||||
return 0.0;
|
||||
}
|
||||
double CMath::SqrtD(double x) { return 0.0; }
|
||||
|
||||
@@ -1,33 +1,23 @@
|
||||
#include <Kyoto/Text/CTextParser.hpp>
|
||||
|
||||
#include <Kyoto/Text/CTextExecuteBuffer.hpp>
|
||||
#include <Kyoto/IObjectStore.hpp>
|
||||
#include <Kyoto/Text/CTextExecuteBuffer.hpp>
|
||||
|
||||
CTextParser::CTextParser(IObjectStore& store)
|
||||
: mObjectStore(store) {}
|
||||
CTextParser::CTextParser(IObjectStore& store) : mObjectStore(store) {}
|
||||
|
||||
void CTextParser::ParseText(CTextExecuteBuffer& buffer, const wchar_t* str, int len) {
|
||||
}
|
||||
void CTextParser::ParseText(CTextExecuteBuffer& buffer, const wchar_t* str, int len) {}
|
||||
|
||||
uint CTextParser::GetAssetIdFromString(const rstl::string& str) {
|
||||
uint CTextParser::GetAssetIdFromString(const rstl::string& str) {}
|
||||
|
||||
}
|
||||
uint CTextParser::GetFont(const wchar_t* str, int len) { return -1; }
|
||||
|
||||
uint CTextParser::GetFont(const wchar_t* str, int len) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint CTextParser::GetImage(const wchar_t* str, int len) {
|
||||
return -1;
|
||||
}
|
||||
uint CTextParser::GetImage(const wchar_t* str, int len) { return -1; }
|
||||
|
||||
uint CTextParser::HandleUserTag(CTextExecuteBuffer& buffer, const wchar_t* string, int len) {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CTextParser::ParseTag(CTextExecuteBuffer& buffer, const wchar_t* string, int len) {
|
||||
|
||||
}
|
||||
void CTextParser::ParseTag(CTextExecuteBuffer& buffer, const wchar_t* string, int len) {}
|
||||
|
||||
bool CTextParser::BeginsWith(const wchar_t* str1, int len, const wchar_t* str2) {
|
||||
int i = 0;
|
||||
@@ -36,19 +26,19 @@ bool CTextParser::BeginsWith(const wchar_t* str1, int len, const wchar_t* str2)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return str2[i] == L'\x0';
|
||||
}
|
||||
|
||||
bool CTextParser::Equals(const wchar_t* str1, int len, const wchar_t* str2) {
|
||||
int i = 0;
|
||||
for (;str2[i] != L'\x0' && i < len; ++i) {
|
||||
if (str1[i] != str2[i]) {
|
||||
return false;
|
||||
}
|
||||
int i = 0;
|
||||
for (; str2[i] != L'\x0' && i < len; ++i) {
|
||||
if (str1[i] != str2[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return str2[i] == L'\x0';
|
||||
return str2[i] == L'\x0';
|
||||
}
|
||||
|
||||
uint CTextParser::ParseInt(const wchar_t* str, int len, bool signVal) {
|
||||
@@ -84,16 +74,16 @@ uint CTextParser::FromHex(wchar_t ch) {
|
||||
}
|
||||
|
||||
uint CTextParser::GetColorValue(const wchar_t* str) {
|
||||
uint a = (FromHex(str[0]) << 4);
|
||||
uint b = FromHex(str[1]);
|
||||
return b + a;
|
||||
uint a = (FromHex(str[0]) << 4);
|
||||
uint b = FromHex(str[1]);
|
||||
return b + a;
|
||||
}
|
||||
|
||||
CTextColor CTextParser::ParseColor(const wchar_t* str, int len) {
|
||||
uint r = GetColorValue(str + 1);
|
||||
uint g = GetColorValue(str + 3);
|
||||
uint b = GetColorValue(str + 5);
|
||||
uint a = len == 9 ? GetColorValue(str + 7) : 255;
|
||||
uint r = GetColorValue(str + 1);
|
||||
uint g = GetColorValue(str + 3);
|
||||
uint b = GetColorValue(str + 5);
|
||||
uint a = len == 9 ? GetColorValue(str + 7) : 255;
|
||||
|
||||
return CTextColor(r, g, b, a);
|
||||
return CTextColor(r, g, b, a);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
#include "MetroidPrime/CArchMsgParmControllerStatus.hpp"
|
||||
#include "Kyoto/Alloc/CMemory.hpp"
|
||||
|
||||
|
||||
CArchMsgParmControllerStatus::CArchMsgParmControllerStatus(short channel, bool connected)
|
||||
: mChannel(channel)
|
||||
, mConnected(connected) {
|
||||
}
|
||||
|
||||
: mChannel(channel), mConnected(connected) {}
|
||||
|
||||
CArchMsgParmControllerStatus::~CArchMsgParmControllerStatus() {}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "MetroidPrime/CArchMsgParmInt32.hpp"
|
||||
#include "Kyoto/Alloc/CMemory.hpp"
|
||||
|
||||
CArchMsgParmInt32::CArchMsgParmInt32(int val)
|
||||
: mVal(val) {}
|
||||
|
||||
CArchMsgParmInt32::CArchMsgParmInt32(int val) : mVal(val) {}
|
||||
|
||||
CArchMsgParmInt32::~CArchMsgParmInt32() {}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include "Kyoto/Alloc/CMemory.hpp"
|
||||
|
||||
CArchMsgParmInt32Int32VoidPtr::CArchMsgParmInt32Int32VoidPtr(int val1, int val2, const void* ptr)
|
||||
: mInt1(val1)
|
||||
, mInt2(val2)
|
||||
, mPtr(ptr) {}
|
||||
: mInt1(val1), mInt2(val2), mPtr(ptr) {}
|
||||
|
||||
CArchMsgParmInt32Int32VoidPtr::~CArchMsgParmInt32Int32VoidPtr() {}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "MetroidPrime/CArchMsgParmReal32.hpp"
|
||||
#include "Kyoto/Alloc/CMemory.hpp"
|
||||
|
||||
CArchMsgParmReal32::CArchMsgParmReal32(float val)
|
||||
: mVal(val) {}
|
||||
|
||||
CArchMsgParmReal32::CArchMsgParmReal32(float val) : mVal(val) {}
|
||||
|
||||
CArchMsgParmReal32::~CArchMsgParmReal32() {}
|
||||
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
#include "Kyoto/Alloc/CMemory.hpp"
|
||||
|
||||
CArchMsgParmUserInput::CArchMsgParmUserInput(const CFinalInput& input)
|
||||
: mInput(input) {}
|
||||
CArchMsgParmUserInput::CArchMsgParmUserInput(const CFinalInput& input) : mInput(input) {}
|
||||
|
||||
CArchMsgParmUserInput::~CArchMsgParmUserInput() {}
|
||||
|
||||
const CFinalInput& CArchMsgParmUserInput::GetUserInput() const {
|
||||
return mInput;
|
||||
}
|
||||
const CFinalInput& CArchMsgParmUserInput::GetUserInput() const { return mInput; }
|
||||
|
||||
@@ -5,33 +5,25 @@ const CAxisAngle CAxisAngle::sIdentity;
|
||||
CAxisAngle::CAxisAngle(const CVector3f& vec) : mVector(vec) {}
|
||||
CAxisAngle::CAxisAngle(const CUnitVector3f& vec, float angle) : mVector(vec * angle) {}
|
||||
|
||||
void CAxisAngle::FromVector(const CVector3f& axis) {
|
||||
mVector = axis;
|
||||
}
|
||||
void CAxisAngle::FromVector(const CVector3f& axis) { mVector = axis; }
|
||||
|
||||
const CAxisAngle& CAxisAngle::Identity() {
|
||||
return sIdentity;
|
||||
}
|
||||
const CAxisAngle& CAxisAngle::Identity() { return sIdentity; }
|
||||
|
||||
const CVector3f& CAxisAngle::GetVector() const {
|
||||
return mVector;
|
||||
}
|
||||
const CVector3f& CAxisAngle::GetVector() const { return mVector; }
|
||||
|
||||
float CAxisAngle::GetAngle() const {
|
||||
return mVector.Magnitude();
|
||||
}
|
||||
float CAxisAngle::GetAngle() const { return mVector.Magnitude(); }
|
||||
|
||||
const CAxisAngle& CAxisAngle::operator*=(const float& rhs) {
|
||||
mVector *= rhs;
|
||||
mVector *= rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
const CAxisAngle& CAxisAngle::operator+=(const CAxisAngle& rhs) {
|
||||
mVector += rhs.mVector;
|
||||
mVector += rhs.mVector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
CAxisAngle operator*(const CAxisAngle& lhs,const float& rhs) {
|
||||
CAxisAngle operator*(const CAxisAngle& lhs, const float& rhs) {
|
||||
CAxisAngle angle;
|
||||
angle.mVector = lhs.mVector * rhs;
|
||||
return angle;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user