Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def MatchingFor(*versions):
Object(NonMatching, "SB/Game/zNPCGoalVillager.cpp", extra_cflags=["-sym on"]),
Object(Matching, "SB/Game/zNPCGoalSubBoss.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Core/x/xShadowSimple.cpp"),
Object(NonMatching, "SB/Core/x/xUpdateCull.cpp"),
Object(Matching, "SB/Core/x/xUpdateCull.cpp"),
Object(NonMatching, "SB/Game/zDiscoFloor.cpp"),
Object(NonMatching, "SB/Game/zNPCTypeBossSandy.cpp"),
Object(NonMatching, "SB/Game/zNPCTypeKingJelly.cpp"),
Expand All @@ -621,7 +621,7 @@ def MatchingFor(*versions):
Object(NonMatching, "SB/Core/x/xDecal.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Core/x/xLaserBolt.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Game/zCameraTweak.cpp"),
Object(NonMatching, "SB/Core/x/xPtankPool.cpp"),
Object(Matching, "SB/Core/x/xPtankPool.cpp"),
Object(Equivalent, "SB/Core/gc/iTRC.cpp"),
Object(NonMatching, "SB/Game/zNPCSupplement.cpp"),
Object(NonMatching, "SB/Game/zNPCGlyph.cpp", extra_cflags=["-sym on"]),
Expand Down
27 changes: 14 additions & 13 deletions include/rwsdk/rwplcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ struct RwStringFunctions
};

#define RwMalloc(_s) ((RWSRCGLOBAL(memoryFuncs).rwmalloc)((_s)))
#define RwMallocL(_s, _h, _l) ((RWSRCGLOBAL(memoryFuncs).rwmalloc)((_s), (_h)))
#define RwFree(_p) ((RWSRCGLOBAL(memoryFuncs).rwfree)((_p)))
#define RwCalloc(_n, _s) ((RWSRCGLOBAL(memoryFuncs).rwcalloc)((_n), (_s)))
#define RwRealloc(_p, _s) ((RWSRCGLOBAL(memoryFuncs).rwrealloc)((_p), (_s)))
Expand Down Expand Up @@ -796,22 +797,22 @@ struct rwGameCube2DVertex
RwReal u;
RwReal v;

rwGameCube2DVertex& operator=(const rwGameCube2DVertex& rhs)
{
this->x = rhs.x;
this->y = rhs.y;
this->z = rhs.z;
rwGameCube2DVertex& operator=(const rwGameCube2DVertex& rhs)
{
this->x = rhs.x;
this->y = rhs.y;
this->z = rhs.z;

this->emissiveColor.red = rhs.emissiveColor.red;
this->emissiveColor.green = rhs.emissiveColor.green;
this->emissiveColor.blue = rhs.emissiveColor.blue;
this->emissiveColor.alpha = rhs.emissiveColor.alpha;
this->emissiveColor.red = rhs.emissiveColor.red;
this->emissiveColor.green = rhs.emissiveColor.green;
this->emissiveColor.blue = rhs.emissiveColor.blue;
this->emissiveColor.alpha = rhs.emissiveColor.alpha;

this->u = rhs.u;
this->v = rhs.v;
this->u = rhs.u;
this->v = rhs.v;

return *this;
}
return *this;
}
};

typedef rwGameCube2DVertex RwIm2DVertex;
Expand Down
55 changes: 26 additions & 29 deletions src/SB/Core/x/xPtankPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,14 @@ namespace
}

const F32 f1 = 1.0f;
frame->modelling.at.z = f1;
frame->modelling.up.y = f1;
frame->modelling.right.x = f1;
frame->modelling.right.x = frame->modelling.up.y = frame->modelling.at.z = f1;

const F32 f0 = 0.0f;
frame->modelling.up.x = f0;
frame->modelling.right.z = f0;
frame->modelling.right.y = f0;
frame->modelling.right.y = frame->modelling.right.z = frame->modelling.up.x = f0;

frame->modelling.at.y = f0;
frame->modelling.at.x = f0;
frame->modelling.up.z = f0;
frame->modelling.up.z = frame->modelling.at.x = frame->modelling.at.y = f0;

frame->modelling.pos.z = f0;
frame->modelling.pos.y = f0;
frame->modelling.pos.x = f0;
frame->modelling.pos.x = frame->modelling.pos.y = frame->modelling.pos.z = f0;

frame->modelling.flags = frame->modelling.flags | rpPTANKDFLAGCNS2DROTATE |
rpPTANKDFLAGCOLOR | rpPTANKDFLAGPOSITION;
Expand Down Expand Up @@ -243,6 +235,28 @@ namespace
return 0;
}

U32 create_ptanks(group_data& group, unsigned long count);
} // namespace

void xPTankPoolSceneEnter()
{
inited = 1;
init_groups();

group_data* it = groups;
group_data* end = groups + MAX_PGT;
while (it != end)
{
double f = it->max_size - 0.f;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these need to be Heavy Iron-typed? We have F64 for doubles and u32 for unsigned long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't know as I didn't actually do the function, just fixed it. Will update that now.

float scaled = float(f) * 0.25f + 0.5f;
create_ptanks(*it, (unsigned long)scaled);

it++;
}
}

namespace
{
U32 create_ptanks(group_data& group, unsigned long count)
{
U32 initial_size = group.size;
Expand Down Expand Up @@ -275,23 +289,6 @@ namespace

} // namespace

void xPTankPoolSceneEnter()
{
inited = 1;
init_groups();

group_data* it = groups;
group_data* end = groups + MAX_PGT;
while (it != end)
{
double f = it->max_size - 0.f;
float scaled = float(f) * 0.25f + 0.5f;
create_ptanks(*it, (unsigned long)scaled);

it++;
}
}

void xPTankPoolSceneExit()
{
inited = 0;
Expand Down
Loading