spidey-decomp/weapons.cpp

34 lines
745 B
C++
Raw Normal View History

2024-07-24 17:05:33 +00:00
#include "weapons.h"
2024-07-29 17:05:28 +00:00
#include "validate.h"
#include "mem.h"
2024-07-24 17:05:33 +00:00
2024-07-29 17:05:28 +00:00
// @Ok
CGouradRibbon::CGouradRibbon(i32 NumPoints, i32 LeaveTrail)
2024-07-24 17:05:33 +00:00
{
2024-07-29 17:05:28 +00:00
print_if_false(NumPoints > 1, "NumPoints must be at least 2");
print_if_false((u32)NumPoints <= 0x20, "NumPoints too big for buffer.");
this->NumPoints = NumPoints;
this->mpPoints = static_cast<SRibbonPoint *>(
DCMem_New(
sizeof(SRibbonPoint) * NumPoints,
0,
1,
0,
1));
print_if_false(LeaveTrail == 0 || LeaveTrail == 1, "LeaveTrail must be 0 or 1");
this->mTrail = LeaveTrail;
2024-07-24 17:05:33 +00:00
}
void validate_CGouradRibbon(void)
{
2024-07-29 17:05:28 +00:00
VALIDATE_SIZE(CGouradRibbon, 0x48);
VALIDATE(CGouradRibbon, mTrail, 0x3C);
VALIDATE(CGouradRibbon, NumPoints, 0x40);
VALIDATE(CGouradRibbon, mpPoints, 0x44);
2024-07-24 17:05:33 +00:00
}