Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions extern/rstl/include/rstl/single_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
namespace rstl {
template < typename T >
class single_ptr {
mutable T* x0_ptr;
T* x0_ptr;

public:
single_ptr() : x0_ptr(nullptr) {}
single_ptr(T* ptr) : x0_ptr(ptr) {}
single_ptr(const single_ptr& other) : x0_ptr(other.x0_ptr) { other.x0_ptr = nullptr; }
single_ptr(single_ptr& other) : x0_ptr(other.x0_ptr) { other.x0_ptr = nullptr; }
~single_ptr() { delete x0_ptr; }
single_ptr& operator=(single_ptr& other) {
if (&other == this) {
Expand All @@ -32,9 +32,9 @@ class single_ptr {

T* get() const { return x0_ptr; }
// const T* get() const { return x0_ptr; }
T* operator->() const { return x0_ptr; }
T* const operator->() const { return x0_ptr; }
T& operator*() { return *x0_ptr; }
const T& operator*() const { return *x0_ptr; }
T& operator*() const { return *x0_ptr; }

bool null() const { return x0_ptr == nullptr; }
T* release() {
Expand Down
14 changes: 7 additions & 7 deletions src/Kyoto/Graphics/DolphinCTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,15 @@ void* CTexture::CDumpedBitmapDataReloader::TryBuildReloadedBitmapData(CResFactor

SObjectTag tag('TXTR', x4_);
rstl::single_ptr< CInputStream > buf = factory.LoadResourceFromMemorySync(tag, x18_.get());
CInputStream* in = buf.get();
ETexelFormat format = ETexelFormat(in->ReadInt32());
const int w = in->ReadInt16();
const int h = in->ReadInt16();
const int numMips = in->ReadInt32();
CInputStream& in = *buf;
ETexelFormat format = ETexelFormat(in.ReadInt32());
const int w = in.ReadInt16();
const int h = in.ReadInt16();
const int numMips = in.ReadInt32();
const int bitsPerPixel = TexelFormatBitsPerPixel(format);

if (IsCITextureFormat(format)) {
CGraphicsPalette tmp(*in);
CGraphicsPalette tmp(in);
}

int bufLen = 0;
Expand All @@ -305,7 +305,7 @@ void* CTexture::CDumpedBitmapDataReloader::TryBuildReloadedBitmapData(CResFactor
len = 256;
}

in->Get((char*)ptr + off, len);
in.Get((char*)ptr + off, len);
DCFlushRangeNoSync((char*)ptr + off, OSRoundUp32B(len));
}
PPCSync();
Expand Down
3 changes: 2 additions & 1 deletion src/MetroidPrime/CActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ bool CActor::CanDrawStatic() const {
if (!GetActive() || !HasModelData() || static_cast< char >(xb4_drawFlags.GetBlendMode()) > 4) {
return false;
}
if (GetModelData()->IsNull() || GetModelData()->HasAnimation()) {
const CModelData* modelData = GetModelData();
if (modelData->IsNull() || modelData->HasAnimation()) {
return false;
}
return true;
Expand Down
3 changes: 1 addition & 2 deletions src/MetroidPrime/Cameras/CBallCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,8 +1634,7 @@ void CBallCamera::UpdateUsingColliders(float dt, CStateManager& mgr) {
}
}

camDelta = CVector3f(x294_dampedPos[kDX] - desiredPos[kDX], x294_dampedPos[kDY] - desiredPos[kDY],
x294_dampedPos[kDZ] - desiredPos[kDZ]);
camDelta = x294_dampedPos - desiredPos;
float dampDeltaMag = camDelta.Magnitude();
if (camDelta.CanBeNormalized()) {
camDelta.Normalize();
Expand Down
6 changes: 1 addition & 5 deletions src/MetroidPrime/Enemies/CPatterned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,7 @@ CPatterned::CPatterned(const EPatternedAI character, const TUniqueId uid, const

SetRenderParticleDatabaseInside(false);

bool buildBodyController = false;
if (ModelData() && ModelData()->IsNotNull()) {
buildBodyController = true;
}
if (buildBodyController) {
if (HasModelData()) {
x402_27_noXrayModel = !ModelData()->HasModel(CModelData::kWM_XRay);
BuildBodyController(body);
}
Expand Down
Loading