mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-09-03 01:53:44 -04:00
Rename modelfiledata to modeldef
This commit is contained in:
+40
-40
@@ -157,15 +157,15 @@ u32 bodyGetRace(s32 bodynum)
|
||||
|
||||
bool bodyLoad(s32 bodynum)
|
||||
{
|
||||
if (!g_HeadsAndBodies[bodynum].filedata) {
|
||||
g_HeadsAndBodies[bodynum].filedata = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
if (!g_HeadsAndBodies[bodynum].modeldef) {
|
||||
g_HeadsAndBodies[bodynum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyfiledata, struct modelfiledata *headfiledata, bool sunglasses, struct model *model, bool isplayer, u8 varyheight)
|
||||
struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modeldef *bodymodeldef, struct modeldef *headmodeldef, bool sunglasses, struct model *model, bool isplayer, u8 varyheight)
|
||||
{
|
||||
f32 scale = g_HeadsAndBodies[bodynum].scale * 0.10000001f;
|
||||
f32 animscale = g_HeadsAndBodies[bodynum].animscale;
|
||||
@@ -176,43 +176,43 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
|
||||
scale *= 0.8f;
|
||||
}
|
||||
|
||||
if (bodyfiledata == NULL) {
|
||||
if (g_HeadsAndBodies[bodynum].filedata == NULL) {
|
||||
g_HeadsAndBodies[bodynum].filedata = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
if (bodymodeldef == NULL) {
|
||||
if (g_HeadsAndBodies[bodynum].modeldef == NULL) {
|
||||
g_HeadsAndBodies[bodynum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
}
|
||||
|
||||
bodyfiledata = g_HeadsAndBodies[bodynum].filedata;
|
||||
bodymodeldef = g_HeadsAndBodies[bodynum].modeldef;
|
||||
}
|
||||
|
||||
modelAllocateRwData(bodyfiledata);
|
||||
modelAllocateRwData(bodymodeldef);
|
||||
|
||||
if (!g_HeadsAndBodies[bodynum].unk00_01) {
|
||||
if (bodyfiledata->skel == &g_SkelChr) {
|
||||
node = modelGetPart(bodyfiledata, MODELPART_CHR_HEADSPOT);
|
||||
if (bodymodeldef->skel == &g_SkelChr) {
|
||||
node = modelGetPart(bodymodeldef, MODELPART_CHR_HEADSPOT);
|
||||
|
||||
if (node != NULL) {
|
||||
if (headnum < 0) {
|
||||
headfiledata = func0f18e57c(-1 - headnum, &headnum);
|
||||
bodyfiledata->rwdatalen += headfiledata->rwdatalen;
|
||||
headmodeldef = func0f18e57c(-1 - headnum, &headnum);
|
||||
bodymodeldef->rwdatalen += headmodeldef->rwdatalen;
|
||||
} else if (headnum > 0) {
|
||||
if (headfiledata == NULL) {
|
||||
if (headmodeldef == NULL) {
|
||||
if (g_Vars.normmplayerisrunning && !IS4MB()) {
|
||||
headfiledata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
g_HeadsAndBodies[headnum].filedata = headfiledata;
|
||||
headmodeldef = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
g_HeadsAndBodies[headnum].modeldef = headmodeldef;
|
||||
g_FileInfo[g_HeadsAndBodies[headnum].filenum].loadedsize = 0;
|
||||
bodyCalculateHeadOffset(headfiledata, headnum, bodynum);
|
||||
bodyCalculateHeadOffset(headmodeldef, headnum, bodynum);
|
||||
} else {
|
||||
if (g_HeadsAndBodies[headnum].filedata == NULL) {
|
||||
g_HeadsAndBodies[headnum].filedata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
if (g_HeadsAndBodies[headnum].modeldef == NULL) {
|
||||
g_HeadsAndBodies[headnum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
}
|
||||
|
||||
headfiledata = g_HeadsAndBodies[headnum].filedata;
|
||||
headmodeldef = g_HeadsAndBodies[headnum].modeldef;
|
||||
}
|
||||
}
|
||||
|
||||
modelAllocateRwData(headfiledata);
|
||||
modelAllocateRwData(headmodeldef);
|
||||
|
||||
bodyfiledata->rwdatalen += headfiledata->rwdatalen;
|
||||
bodymodeldef->rwdatalen += headmodeldef->rwdatalen;
|
||||
|
||||
if (g_HeadsAndBodies[bodynum].canvaryheight && varyheight) {
|
||||
// Set height to between 95% and 115%
|
||||
@@ -235,7 +235,7 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (bodyfiledata->skel == &g_SkelSkedar) {
|
||||
} else if (bodymodeldef->skel == &g_SkelSkedar) {
|
||||
if (g_HeadsAndBodies[bodynum].canvaryheight && varyheight && bodynum == BODY_SKEDAR) {
|
||||
// Set height to between 65% and 85%
|
||||
f32 frac = RANDOMFRAC();
|
||||
@@ -247,25 +247,25 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
|
||||
}
|
||||
|
||||
if (model) {
|
||||
if (model->rwdatalen < bodyfiledata->rwdatalen);
|
||||
if (model->rwdatalen < bodymodeldef->rwdatalen);
|
||||
} else {
|
||||
model = modelmgrInstantiateModelWithAnim(bodyfiledata);
|
||||
model = modelmgrInstantiateModelWithAnim(bodymodeldef);
|
||||
}
|
||||
|
||||
if (model) {
|
||||
modelSetScale(model, scale);
|
||||
modelSetAnimScale(model, animscale);
|
||||
|
||||
if (headfiledata && !g_HeadsAndBodies[bodynum].unk00_01) {
|
||||
bodyfiledata->rwdatalen -= headfiledata->rwdatalen;
|
||||
if (headmodeldef && !g_HeadsAndBodies[bodynum].unk00_01) {
|
||||
bodymodeldef->rwdatalen -= headmodeldef->rwdatalen;
|
||||
|
||||
modelmgrAttachHead(model, node, headfiledata);
|
||||
modelmgrAttachHead(model, node, headmodeldef);
|
||||
|
||||
if ((s16)*(s32 *)&headfiledata->skel == SKEL_HEAD) {
|
||||
if ((s16)*(s32 *)&headmodeldef->skel == SKEL_HEAD) {
|
||||
struct modelnode *node2;
|
||||
|
||||
if (!sunglasses) {
|
||||
node2 = modelGetPart(headfiledata, MODELPART_HEAD_SUNGLASSES);
|
||||
node2 = modelGetPart(headmodeldef, MODELPART_HEAD_SUNGLASSES);
|
||||
|
||||
if (node2) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, node2);
|
||||
@@ -273,7 +273,7 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
|
||||
}
|
||||
}
|
||||
|
||||
node2 = modelGetPart(headfiledata, MODELPART_HEAD_HUDPIECE);
|
||||
node2 = modelGetPart(headmodeldef, MODELPART_HEAD_HUDPIECE);
|
||||
|
||||
if (node2) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, node2);
|
||||
@@ -286,9 +286,9 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf
|
||||
return model;
|
||||
}
|
||||
|
||||
struct model *body0f02d338(s32 bodynum, s32 headnum, struct modelfiledata *bodyfiledata, struct modelfiledata *headfiledata, bool sunglasses, u8 varyheight)
|
||||
struct model *body0f02d338(s32 bodynum, s32 headnum, struct modeldef *bodymodeldef, struct modeldef *headmodeldef, bool sunglasses, u8 varyheight)
|
||||
{
|
||||
return body0f02ce8c(bodynum, headnum, bodyfiledata, headfiledata, sunglasses, NULL, false, varyheight);
|
||||
return body0f02ce8c(bodynum, headnum, bodymodeldef, headmodeldef, sunglasses, NULL, false, varyheight);
|
||||
}
|
||||
|
||||
struct model *bodyAllocateModel(s32 bodynum, s32 headnum, u32 spawnflags)
|
||||
@@ -348,7 +348,7 @@ void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex)
|
||||
struct pad pad;
|
||||
s16 rooms[2];
|
||||
struct chrdata *chr;
|
||||
struct modelfiledata *headfiledata;
|
||||
struct modeldef *headmodeldef;
|
||||
struct model *model;
|
||||
struct prop *prop;
|
||||
s32 bodynum;
|
||||
@@ -382,7 +382,7 @@ void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex)
|
||||
}
|
||||
|
||||
headnum = -55555;
|
||||
headfiledata = NULL;
|
||||
headmodeldef = NULL;
|
||||
|
||||
if (packed->bodynum == 255) {
|
||||
bodynum = body0f02d3f8();
|
||||
@@ -402,10 +402,10 @@ void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex)
|
||||
index = -1 - headnum;
|
||||
|
||||
if (index >= 0 && index < 22) {
|
||||
headfiledata = func0f18e57c(index, &headnum);
|
||||
headmodeldef = func0f18e57c(index, &headnum);
|
||||
}
|
||||
|
||||
model = body0f02ce8c(bodynum, headnum, NULL, headfiledata, false, NULL, false, false);
|
||||
model = body0f02ce8c(bodynum, headnum, NULL, headmodeldef, false, NULL, false, false);
|
||||
} else {
|
||||
model = bodyAllocateModel(bodynum, headnum, packed->spawnflags);
|
||||
}
|
||||
@@ -633,7 +633,7 @@ void body0f02ddbf(void)
|
||||
* any tweaking. This function is used in multiplayer where players can put any
|
||||
* heads on any bodies.
|
||||
*/
|
||||
void bodyCalculateHeadOffset(struct modelfiledata *headfiledata, s32 headnum, s32 bodynum)
|
||||
void bodyCalculateHeadOffset(struct modeldef *headmodeldef, s32 headnum, s32 bodynum)
|
||||
{
|
||||
struct modelnode *node;
|
||||
struct modelnode *prev;
|
||||
@@ -671,7 +671,7 @@ void bodyCalculateHeadOffset(struct modelfiledata *headfiledata, s32 headnum, s3
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((s16)(*(s32 *)&headfiledata->skel) == SKEL_HEAD) {
|
||||
if ((s16)(*(s32 *)&headmodeldef->skel) == SKEL_HEAD) {
|
||||
#if VERSION >= VERSION_JPN_FINAL
|
||||
if (g_HeadsAndBodies[headnum].type == g_HeadsAndBodies[bodynum].type && offset == 0) {
|
||||
return;
|
||||
@@ -769,7 +769,7 @@ void bodyCalculateHeadOffset(struct modelfiledata *headfiledata, s32 headnum, s3
|
||||
do {
|
||||
prev = node;
|
||||
|
||||
modelIterateDisplayLists(headfiledata, &node, &gdl);
|
||||
modelIterateDisplayLists(headmodeldef, &node, &gdl);
|
||||
|
||||
if (node && node != prev && node->type == MODELNODETYPE_DL) {
|
||||
struct modelrodata_dl *rodata = &node->rodata->dl;
|
||||
@@ -780,7 +780,7 @@ void bodyCalculateHeadOffset(struct modelfiledata *headfiledata, s32 headnum, s3
|
||||
}
|
||||
} while (node);
|
||||
|
||||
bbox = modelFileDataFindBboxRodata(headfiledata);
|
||||
bbox = modeldefFindBboxRodata(headmodeldef);
|
||||
|
||||
if (bbox != NULL) {
|
||||
bbox->ymin += offset;
|
||||
|
||||
@@ -283,7 +283,7 @@ void bodiesReset(s32 stagenum)
|
||||
s32 j;
|
||||
|
||||
for (i = 0; g_HeadsAndBodies[i].filenum; i++) {
|
||||
g_HeadsAndBodies[i].filedata = NULL;
|
||||
g_HeadsAndBodies[i].modeldef = NULL;
|
||||
}
|
||||
|
||||
var80062c80 = random() % g_NumBondBodies;
|
||||
|
||||
+42
-42
@@ -514,7 +514,7 @@ bool bgunTestGunVisCommand(struct gunviscmd *cmd, struct hand *hand)
|
||||
return result;
|
||||
}
|
||||
|
||||
void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct modelfiledata *filedata)
|
||||
void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct modeldef *modeldef)
|
||||
{
|
||||
struct modelnode *node;
|
||||
|
||||
@@ -529,7 +529,7 @@ void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct mod
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node = modelGetPart(filedata, partnum);
|
||||
node = modelGetPart(modeldef, partnum);
|
||||
|
||||
if (node) {
|
||||
struct modelrodata_toggle *rodata = &node->rodata->toggle;
|
||||
@@ -539,7 +539,7 @@ void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct mod
|
||||
}
|
||||
}
|
||||
|
||||
void bgunExecuteGunVisCommands(struct hand *hand, struct modelfiledata *filedata, struct gunviscmd *commands)
|
||||
void bgunExecuteGunVisCommands(struct hand *hand, struct modeldef *modeldef, struct gunviscmd *commands)
|
||||
{
|
||||
struct gunviscmd *cmd = commands;
|
||||
bool done = false;
|
||||
@@ -551,19 +551,19 @@ void bgunExecuteGunVisCommands(struct hand *hand, struct modelfiledata *filedata
|
||||
while (!done) {
|
||||
if (bgunTestGunVisCommand(cmd, hand)) {
|
||||
if (cmd->op == GUNVISOP_IFTRUE_SETVISIBLE) {
|
||||
bgunSetPartVisible(cmd->partnum, true, hand, filedata);
|
||||
bgunSetPartVisible(cmd->partnum, true, hand, modeldef);
|
||||
}
|
||||
|
||||
if (cmd->op == GUNVISOP_IFTRUE_SETHIDDEN) {
|
||||
bgunSetPartVisible(cmd->partnum, false, hand, filedata);
|
||||
bgunSetPartVisible(cmd->partnum, false, hand, modeldef);
|
||||
}
|
||||
|
||||
if (cmd->op == GUNVISOP_SETVISIBILITY) {
|
||||
bgunSetPartVisible(cmd->partnum, true, hand, filedata);
|
||||
bgunSetPartVisible(cmd->partnum, true, hand, modeldef);
|
||||
}
|
||||
} else {
|
||||
if (cmd->op == GUNVISOP_SETVISIBILITY) {
|
||||
bgunSetPartVisible(cmd->partnum, false, hand, filedata);
|
||||
bgunSetPartVisible(cmd->partnum, false, hand, modeldef);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,22 +575,22 @@ void bgunExecuteGunVisCommands(struct hand *hand, struct modelfiledata *filedata
|
||||
}
|
||||
}
|
||||
|
||||
void bgun0f098030(struct hand *hand, struct modelfiledata *filedata)
|
||||
void bgun0f098030(struct hand *hand, struct modeldef *modeldef)
|
||||
{
|
||||
struct weapon *weapon = weaponFindById(hand->gset.weaponnum);
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
bgunExecuteGunVisCommands(hand, filedata, weapon->gunviscmds);
|
||||
bgunSetPartVisible(MODELPART_0042, false, hand, filedata);
|
||||
bgunExecuteGunVisCommands(hand, modeldef, weapon->gunviscmds);
|
||||
bgunSetPartVisible(MODELPART_0042, false, hand, modeldef);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (weapon->ammos[i] && (weapon->ammos[i]->flags & AMMOFLAG_QTYAFFECTSPARTVIS)) {
|
||||
for (j = 0; j < hand->clipsizes[i]; j++) {
|
||||
if (j >= hand->loadedammo[i]) {
|
||||
bgunSetPartVisible(j + 100, false, hand, filedata);
|
||||
bgunSetPartVisible(j + 100, false, hand, modeldef);
|
||||
} else {
|
||||
bgunSetPartVisible(j + 100, true, hand, filedata);
|
||||
bgunSetPartVisible(j + 100, true, hand, modeldef);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,7 +610,7 @@ f32 bgun0f09815c(struct hand *hand)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void bgun0f0981e8(struct hand *hand, struct modelfiledata *modeldef)
|
||||
void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef)
|
||||
{
|
||||
#if VERSION >= VERSION_PAL_BETA
|
||||
f32 s4;
|
||||
@@ -3600,7 +3600,7 @@ u32 bgunGetGunMemType(void)
|
||||
return g_Vars.currentplayer->gunctrl.gunmemtype;
|
||||
}
|
||||
|
||||
struct modelfiledata *bgun0f09dddc(void)
|
||||
struct modeldef *bgun0f09dddc(void)
|
||||
{
|
||||
return g_Vars.currentplayer->gunctrl.gunmodeldef;
|
||||
}
|
||||
@@ -3764,7 +3764,7 @@ void bgunTickGunLoad(void)
|
||||
u32 loadsize;
|
||||
u32 ptr;
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
struct modelfiledata *modeldef;
|
||||
struct modeldef *modeldef;
|
||||
struct fileinfo *fileinfo;
|
||||
struct fileinfo *gunfileinfo;
|
||||
s32 newvalue;
|
||||
@@ -4254,7 +4254,7 @@ bool bgun0f09eae4(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct modelfiledata *bgunGetCartModeldef(void)
|
||||
struct modeldef *bgunGetCartModeldef(void)
|
||||
{
|
||||
return g_Vars.currentplayer->gunctrl.cartmodeldef;
|
||||
}
|
||||
@@ -4645,10 +4645,10 @@ void bgunUpdateHeldRocket(s32 handnum)
|
||||
propDeregisterRooms(objprop);
|
||||
}
|
||||
|
||||
model->matrices = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf));
|
||||
model->matrices = gfxAllocate(model->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
mtx4Copy(&hand->muzzlemat, &model->matrices[0]);
|
||||
modelUpdateRelationsQuick(model, model->filedata->rootnode);
|
||||
modelUpdateRelationsQuick(model, model->definition->rootnode);
|
||||
|
||||
objprop->flags |= PROPFLAG_ONANYSCREENTHISTICK | PROPFLAG_ONTHISSCREENTHISTICK;
|
||||
objprop->z = -model->matrices[0].m[3][2];
|
||||
@@ -4862,7 +4862,7 @@ void bgunCreateFiredProjectile(s32 handnum)
|
||||
struct coord sp6c;
|
||||
struct coord sp60;
|
||||
|
||||
if (weapon->base.model && weapon->base.model->filedata) {
|
||||
if (weapon->base.model && weapon->base.model->definition) {
|
||||
weapon->timer240 = funcdef->timer60;
|
||||
|
||||
if (weapon->timer240 != -1) {
|
||||
@@ -6765,7 +6765,7 @@ void bgunUpdateSmoke(struct hand *hand, s32 handnum, s32 weaponnum, struct weapo
|
||||
/**
|
||||
* Update the red beam and dot (used by the Falcon 2 and its variants).
|
||||
*/
|
||||
void bgunUpdateLasersight(struct hand *hand, struct modelfiledata *modeldef, s32 handnum, u8 *allocation)
|
||||
void bgunUpdateLasersight(struct hand *hand, struct modeldef *modeldef, s32 handnum, u8 *allocation)
|
||||
{
|
||||
struct modelnode *node;
|
||||
struct coord beamfar;
|
||||
@@ -6865,7 +6865,7 @@ void bgunUpdateLasersight(struct hand *hand, struct modelfiledata *modeldef, s32
|
||||
/**
|
||||
* Increment the main barrel spinning, play sounds and (probably) fire shots.
|
||||
*/
|
||||
void bgunUpdateReaper(struct hand *hand, struct modelfiledata *modeldef)
|
||||
void bgunUpdateReaper(struct hand *hand, struct modeldef *modeldef)
|
||||
{
|
||||
struct modelnode *node;
|
||||
f32 f2;
|
||||
@@ -6962,7 +6962,7 @@ void bgunUpdateReaper(struct hand *hand, struct modelfiledata *modeldef)
|
||||
/**
|
||||
* Move/extend the scope on the gun model when the zoom function is used.
|
||||
*/
|
||||
void bgunUpdateSniperRifle(struct modelfiledata *modeldef, u8 *allocation)
|
||||
void bgunUpdateSniperRifle(struct modeldef *modeldef, u8 *allocation)
|
||||
{
|
||||
struct modelnode *nodes[4];
|
||||
f32 sp88[4] = {0, 0, 0, 0};
|
||||
@@ -7006,7 +7006,7 @@ void bgunUpdateSniperRifle(struct modelfiledata *modeldef, u8 *allocation)
|
||||
/**
|
||||
* Animate the cartridge slider thing in the Devastator model.
|
||||
*/
|
||||
void bgunUpdateDevastator(struct hand *hand, u8 *allocation, struct modelfiledata *modeldef)
|
||||
void bgunUpdateDevastator(struct hand *hand, u8 *allocation, struct modeldef *modeldef)
|
||||
{
|
||||
struct modelnode *node = modelGetPart(modeldef, MODELPART_DEVASTATOR_0028);
|
||||
|
||||
@@ -7039,7 +7039,7 @@ void bgunUpdateDevastator(struct hand *hand, u8 *allocation, struct modelfiledat
|
||||
* starburst when the trigger is pressed while the shotgun has the double blast
|
||||
* function.
|
||||
*/
|
||||
void bgunUpdateShotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modelfiledata *modeldef)
|
||||
void bgunUpdateShotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modeldef *modeldef)
|
||||
{
|
||||
if (hand->flashon) {
|
||||
hand->matmot1 = 1.0f;
|
||||
@@ -7091,7 +7091,7 @@ void bgunUpdateLaser(struct hand *hand)
|
||||
/**
|
||||
* Create ammo casing so they can be ejected during reload.
|
||||
*/
|
||||
void bgunUpdateMagnum(struct hand *hand, s32 handnum, struct modelfiledata *modeldef, Mtxf *mtx)
|
||||
void bgunUpdateMagnum(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx)
|
||||
{
|
||||
f32 ground = g_Vars.currentplayer->vv_ground;
|
||||
s32 i;
|
||||
@@ -7131,23 +7131,23 @@ void bgunUpdateRocketLauncher(struct hand *hand, s32 handnum, struct weaponfunc_
|
||||
}
|
||||
}
|
||||
|
||||
void bgun0f0a45d0(struct hand *hand, struct modelfiledata *filedata, bool isdetonator)
|
||||
void bgun0f0a45d0(struct hand *hand, struct modeldef *modeldef, bool isdetonator)
|
||||
{
|
||||
struct modelnode *node = NULL;
|
||||
|
||||
switch (hand->ejecttype) {
|
||||
case EJECTTYPE_GUN:
|
||||
if (isdetonator) {
|
||||
node = modelGetPart(filedata, 0x2a);
|
||||
node = modelGetPart(modeldef, 0x2a);
|
||||
} else {
|
||||
node = modelGetPart(filedata, 0x37);
|
||||
node = modelGetPart(modeldef, 0x37);
|
||||
}
|
||||
break;
|
||||
case EJECTTYPE_GRENADEPIN:
|
||||
node = modelGetPart(filedata, 0x2b);
|
||||
node = modelGetPart(modeldef, 0x2b);
|
||||
break;
|
||||
case EJECTTYPE_TRANQCASE:
|
||||
node = modelGetPart(filedata, 0x2b);
|
||||
node = modelGetPart(modeldef, 0x2b);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7164,7 +7164,7 @@ void bgun0f0a45d0(struct hand *hand, struct modelfiledata *filedata, bool isdeto
|
||||
* when reloading, and the pulled pin on grenades and nbombs appears to move
|
||||
* with the model rather than detaching properly.
|
||||
*/
|
||||
void bgunTickEject(struct hand *hand, struct modelfiledata *modeldef, bool isdetonator)
|
||||
void bgunTickEject(struct hand *hand, struct modeldef *modeldef, bool isdetonator)
|
||||
{
|
||||
f32 lvupdate;
|
||||
struct coord spd0;
|
||||
@@ -7268,7 +7268,7 @@ void bgunTickEject(struct hand *hand, struct modelfiledata *modeldef, bool isdet
|
||||
}
|
||||
}
|
||||
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modelfiledata *modeldef,
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modeldef *modeldef,
|
||||
struct weaponfunc *funcdef, s32 maxburst, u8 *allocation, s32 weaponnum,
|
||||
bool **arg7, s32 mtxindex, Mtxf *arg9, Mtxf *arg10)
|
||||
{
|
||||
@@ -7360,7 +7360,7 @@ void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modelfiled
|
||||
* Create casing and beam for a fired weapon,
|
||||
* and uncloak if the weapon is a throwable or fired projectile.
|
||||
*/
|
||||
void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s32 weaponnum, struct modelfiledata *modeldef, u8 *allocation)
|
||||
void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s32 weaponnum, struct modeldef *modeldef, u8 *allocation)
|
||||
{
|
||||
f32 ground;
|
||||
bool createbeam = true;
|
||||
@@ -7467,7 +7467,7 @@ void bgun0f0a5550(s32 handnum)
|
||||
u8 *mtxallocation;
|
||||
Mtxf sp2c4;
|
||||
Mtxf sp284;
|
||||
struct modelfiledata *modeldef = NULL;
|
||||
struct modeldef *modeldef = NULL;
|
||||
struct coord sp274 = {0, 0, 0};
|
||||
Mtxf sp234;
|
||||
Mtxf sp1f4;
|
||||
@@ -7837,7 +7837,7 @@ void bgun0f0a5550(s32 handnum)
|
||||
spc8 = player->hands[HAND_RIGHT].unk0dd8;
|
||||
spc4 = hand->gunmodel.matrices;
|
||||
|
||||
for (spcc = 0; spcc < hand->gunmodel.filedata->nummatrices; spcc++) {
|
||||
for (spcc = 0; spcc < hand->gunmodel.definition->nummatrices; spcc++) {
|
||||
mtx00015be4(&sp2c4, spc8, spc4);
|
||||
spc8++;
|
||||
spc4++;
|
||||
@@ -10911,10 +10911,10 @@ void bgunRender(Gfx **gdlptr)
|
||||
|
||||
// There is support for guns having a TV screen on them
|
||||
// but no guns have this model part so it's not used.
|
||||
node = modelGetPart(hand->gunmodel.filedata, MODELPART_0010);
|
||||
node = modelGetPart(hand->gunmodel.definition, MODELPART_0010);
|
||||
|
||||
if (node) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(&hand->gunmodel, modelGetPart(hand->gunmodel.filedata, MODELPART_0011));
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(&hand->gunmodel, modelGetPart(hand->gunmodel.definition, MODELPART_0011));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->toggle.visible = true;
|
||||
@@ -10993,12 +10993,12 @@ void bgunRender(Gfx **gdlptr)
|
||||
bool sp94 = false;
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
if (rocketmodel && rocketmodel->filedata) {
|
||||
if (rocketmodel && rocketmodel->definition) {
|
||||
sp94 = true;
|
||||
|
||||
modelRender(&renderdata, rocketmodel);
|
||||
|
||||
mtxF2LBulk(rocketmodel->matrices, rocketmodel->filedata->nummatrices);
|
||||
mtxF2LBulk(rocketmodel->matrices, rocketmodel->definition->nummatrices);
|
||||
|
||||
if (hand->firedrocket) {
|
||||
hand->rocket = NULL;
|
||||
@@ -11009,7 +11009,7 @@ void bgunRender(Gfx **gdlptr)
|
||||
#else
|
||||
modelRender(&renderdata, rocketmodel);
|
||||
|
||||
mtxF2LBulk(rocketmodel->matrices, rocketmodel->filedata->nummatrices);
|
||||
mtxF2LBulk(rocketmodel->matrices, rocketmodel->definition->nummatrices);
|
||||
|
||||
if (hand->firedrocket) {
|
||||
hand->rocket = NULL;
|
||||
@@ -11029,7 +11029,7 @@ void bgunRender(Gfx **gdlptr)
|
||||
|
||||
// Slide the laser's liquid texture
|
||||
if (PLAYERCOUNT() == 1) {
|
||||
node = modelGetPart(hand->gunmodel.filedata, MODELPART_LASER_0041);
|
||||
node = modelGetPart(hand->gunmodel.definition, MODELPART_LASER_0041);
|
||||
|
||||
// a5c
|
||||
if (node) {
|
||||
@@ -11075,7 +11075,7 @@ void bgunRender(Gfx **gdlptr)
|
||||
gSPClearGeometryMode(gdl++, G_CULL_BOTH);
|
||||
}
|
||||
|
||||
mtxF2LBulk(hand->gunmodel.matrices, hand->gunmodel.filedata->nummatrices);
|
||||
mtxF2LBulk(hand->gunmodel.matrices, hand->gunmodel.definition->nummatrices);
|
||||
mtx00016784();
|
||||
|
||||
gSPPerspNormalize(gdl++, viGetPerspScale());
|
||||
|
||||
@@ -34,7 +34,7 @@ void bheadReset(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
modelInit(&g_Vars.currentplayer->model, &g_PlayerModelFileData, g_Vars.currentplayer->bondheadsave, false);
|
||||
modelInit(&g_Vars.currentplayer->model, &g_PlayerModeldef, g_Vars.currentplayer->bondheadsave, false);
|
||||
animInit(g_Vars.currentplayer->model.anim);
|
||||
modelSetScale(&g_Vars.currentplayer->model, 0.1000000089407f);
|
||||
modelSetAnimPlaySpeed(&g_Vars.currentplayer->model, (PAL ? 1.2f : 1), 0);
|
||||
|
||||
+4
-4
@@ -2816,11 +2816,11 @@ void func0f14f1d4(s16 *src, s32 len, s32 *dst)
|
||||
}
|
||||
}
|
||||
|
||||
s32 func0f14f2b4(struct modelfiledata *filedata, struct gfxvtx **dst, u32 *len)
|
||||
s32 func0f14f2b4(struct modeldef *modeldef, struct gfxvtx **dst, u32 *len)
|
||||
{
|
||||
struct modelnode *node1 = modelGetPart(filedata, MODELPART_HEAD_0190);
|
||||
struct modelnode *node2 = modelGetPart(filedata, MODELPART_HEAD_0191);
|
||||
struct modelnode *node3 = modelGetPart(filedata, MODELPART_HEAD_0192);
|
||||
struct modelnode *node1 = modelGetPart(modeldef, MODELPART_HEAD_0190);
|
||||
struct modelnode *node2 = modelGetPart(modeldef, MODELPART_HEAD_0191);
|
||||
struct modelnode *node3 = modelGetPart(modeldef, MODELPART_HEAD_0192);
|
||||
|
||||
s32 totalverts = 0;
|
||||
|
||||
|
||||
+42
-42
@@ -858,7 +858,7 @@ bool chr0f01f378(struct model *model, struct coord *arg1, struct coord *arg2, f3
|
||||
chr->ground = ground;
|
||||
|
||||
if (chr->chrflags & CHRCFLAG_00000001) {
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
nodetype = (u8)node->type;
|
||||
|
||||
arg2->y += yincrement + chr->ground - manground;
|
||||
@@ -1320,10 +1320,10 @@ struct prop *chr0f020b14(struct prop *prop, struct model *model,
|
||||
chr0f0220ac(chr);
|
||||
modelSetRootPosition(model, &prop->pos);
|
||||
|
||||
nodetype = chr->model->filedata->rootnode->type;
|
||||
nodetype = chr->model->definition->rootnode->type;
|
||||
|
||||
if ((nodetype & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(chr->model, chr->model->filedata->rootnode);
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(chr->model, chr->model->definition->rootnode);
|
||||
rwdata->chrinfo.ground = ground;
|
||||
}
|
||||
|
||||
@@ -1588,7 +1588,7 @@ void chrHandleJointPositioned(s32 joint, Mtxf *mtx)
|
||||
f32 yrot; // eg. twist left/right or shaking head
|
||||
f32 zrot; // eg. cartwheeling
|
||||
|
||||
if (g_CurModelChr->model->filedata->skel == &g_SkelRobot) {
|
||||
if (g_CurModelChr->model->definition->skel == &g_SkelRobot) {
|
||||
// Handle Chicago robot guns
|
||||
theta = chrGetInverseTheta(g_CurModelChr);
|
||||
|
||||
@@ -1650,12 +1650,12 @@ void chrHandleJointPositioned(s32 joint, Mtxf *mtx)
|
||||
|
||||
mtx00015be0(camGetWorldToScreenMtxf(), mtx);
|
||||
} else {
|
||||
if (g_CurModelChr->model->filedata->skel == &g_SkelChr) {
|
||||
if (g_CurModelChr->model->definition->skel == &g_SkelChr) {
|
||||
lshoulderjoint = 2;
|
||||
rshoulderjoint = 3;
|
||||
waistjoint = 1;
|
||||
neckjoint = 0;
|
||||
} else if (g_CurModelChr->model->filedata->skel == &g_SkelSkedar) {
|
||||
} else if (g_CurModelChr->model->definition->skel == &g_SkelSkedar) {
|
||||
lshoulderjoint = 3;
|
||||
rshoulderjoint = 4;
|
||||
waistjoint = 2;
|
||||
@@ -1979,7 +1979,7 @@ void chr0f022214(struct chrdata *chr, struct prop *prop, bool fulltick)
|
||||
thing.unk00 = sp104;
|
||||
}
|
||||
|
||||
thing.unk10 = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf));
|
||||
thing.unk10 = gfxAllocate(model->definition->nummatrices * sizeof(Mtxf));
|
||||
modelSetMatrices(&thing, model);
|
||||
|
||||
func0f07063c(prop, fulltick);
|
||||
@@ -2688,7 +2688,7 @@ s32 chrTick(struct prop *prop)
|
||||
sp210.unk00 = camGetWorldToScreenMtxf();
|
||||
}
|
||||
|
||||
sp210.unk10 = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf));
|
||||
sp210.unk10 = gfxAllocate(model->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
if (fulltick && g_CurModelChr->flinchcnt >= 0) {
|
||||
g_CurModelChr->flinchcnt += g_Vars.lvupdate60;
|
||||
@@ -2821,8 +2821,8 @@ s32 chrTick(struct prop *prop)
|
||||
}
|
||||
}
|
||||
|
||||
if (model->filedata->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(model->filedata, MODELPART_CHR_HEADSPOT);
|
||||
if (model->definition->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(model->definition, MODELPART_CHR_HEADSPOT);
|
||||
|
||||
if (headspotnode && headspotnode->type == MODELNODETYPE_HEADSPOT) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, headspotnode);
|
||||
@@ -2893,10 +2893,10 @@ void chrDropConcealedItems(struct chrdata *chr)
|
||||
|
||||
void chrSetHudpieceVisible(struct chrdata *chr, bool visible)
|
||||
{
|
||||
struct modelfiledata *modelfiledata = chr->model->filedata;
|
||||
struct modeldef *modeldef = chr->model->definition;
|
||||
|
||||
if (modelfiledata->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(modelfiledata, MODELPART_CHR_HEADSPOT);
|
||||
if (modeldef->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(modeldef, MODELPART_CHR_HEADSPOT);
|
||||
|
||||
if (headspotnode && headspotnode->type == MODELNODETYPE_HEADSPOT) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(chr->model, headspotnode);
|
||||
@@ -2979,7 +2979,7 @@ bool chr0f024738(struct chrdata *chr)
|
||||
struct doorobj *door = prop->door;
|
||||
struct coord pos;
|
||||
|
||||
if (obj->model->filedata->skel != &g_SkelWindowedDoor
|
||||
if (obj->model->definition->skel != &g_SkelWindowedDoor
|
||||
&& door->doortype != DOORTYPE_EYE
|
||||
&& door->doortype != DOORTYPE_IRIS
|
||||
&& door->doortype != DOORTYPE_FALLAWAY
|
||||
@@ -3258,7 +3258,7 @@ void chrRenderAttachedObject(struct prop *prop, struct modelrenderdata *renderda
|
||||
}
|
||||
|
||||
if (xlupass) {
|
||||
mtxF2LBulk(model->matrices, model->filedata->nummatrices);
|
||||
mtxF2LBulk(model->matrices, model->definition->nummatrices);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3492,9 +3492,9 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass)
|
||||
}
|
||||
|
||||
// Set Skedar eyes open or closed
|
||||
if (model->filedata->skel == &g_SkelSkedar) {
|
||||
struct modelnode *node1 = modelGetPart(model->filedata, MODELPART_SKEDAR_EYESOPEN);
|
||||
struct modelnode *node2 = modelGetPart(model->filedata, MODELPART_SKEDAR_EYESCLOSED);
|
||||
if (model->definition->skel == &g_SkelSkedar) {
|
||||
struct modelnode *node1 = modelGetPart(model->definition, MODELPART_SKEDAR_EYESOPEN);
|
||||
struct modelnode *node2 = modelGetPart(model->definition, MODELPART_SKEDAR_EYESCLOSED);
|
||||
|
||||
if (node1 && node2) {
|
||||
union modelrwdata *data1 = modelGetNodeRwData(model, node1);
|
||||
@@ -3510,8 +3510,8 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass)
|
||||
|| chr->headnum == HEAD_ELVIS
|
||||
|| chr->headnum == HEAD_MAIAN_S
|
||||
|| chr->headnum == HEAD_ELVIS_GOGS) {
|
||||
if (model->filedata->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(model->filedata, MODELPART_CHR_HEADSPOT);
|
||||
if (model->definition->skel == &g_SkelChr) {
|
||||
struct modelnode *headspotnode = modelGetPart(model->definition, MODELPART_CHR_HEADSPOT);
|
||||
|
||||
if (headspotnode && headspotnode->type == MODELNODETYPE_HEADSPOT) {
|
||||
union modelrwdata *headrwdata = modelGetNodeRwData(model, headspotnode);
|
||||
@@ -3609,7 +3609,7 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass)
|
||||
}
|
||||
}
|
||||
|
||||
mtxF2LBulk(model->matrices, model->filedata->nummatrices);
|
||||
mtxF2LBulk(model->matrices, model->definition->nummatrices);
|
||||
|
||||
if (USINGDEVICE(DEVICE_IRSCANNER)) {
|
||||
gdl = chrRenderShield(gdl, chr, 0x80);
|
||||
@@ -4393,7 +4393,7 @@ void chr0f0260c4(struct model *model, s32 hitpart, struct modelnode *node, struc
|
||||
|
||||
// Do a pass over the entire model's tree, looking for vertices that share
|
||||
// the chosen vertex, and darken then.
|
||||
curnode = model->filedata->rootnode;
|
||||
curnode = model->definition->rootnode;
|
||||
|
||||
while (curnode) {
|
||||
nodetype = curnode->type & 0xff;
|
||||
@@ -4675,7 +4675,7 @@ void chrBruise(struct model *model, s32 hitpart, struct modelnode *node, struct
|
||||
|
||||
// Do a pass over the entire model's tree, looking for vertices that share
|
||||
// the chosen vertex, and darken then.
|
||||
curnode = model->filedata->rootnode;
|
||||
curnode = model->definition->rootnode;
|
||||
|
||||
while (curnode) {
|
||||
nodetype = curnode->type & 0xff;
|
||||
@@ -4852,7 +4852,7 @@ void chrDisfigure(struct chrdata *chr, struct coord *exppos, f32 damageradius)
|
||||
}
|
||||
|
||||
// Iterate the nodes in the chr model
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
switch (node->type & 0xff) {
|
||||
@@ -5104,7 +5104,7 @@ void chr0f027994(struct prop *prop, struct shotdata *shotdata, bool arg2, bool a
|
||||
hitpart = modelTestForHit(model, &shotdata->unk00, &shotdata->unk0c, &node);
|
||||
|
||||
if (hitpart > 0) {
|
||||
if (func0f06bea0(model, model->filedata->rootnode, model->filedata->rootnode, &shotdata->unk00,
|
||||
if (func0f06bea0(model, model->definition->rootnode, model->definition->rootnode, &shotdata->unk00,
|
||||
&shotdata->unk0c, &sp88.unk00, &sp70, &node, &hitpart, &sp84, &sp80)) {
|
||||
mtx4TransformVec(camGetProjectionMtxF(), &sp88.unk00, &spdc);
|
||||
mtx4RotateVec(camGetProjectionMtxF(), &sp88.unk0c, &spd0);
|
||||
@@ -5573,14 +5573,14 @@ bool chrCalculateAutoAim(struct prop *prop, struct coord *arg1, f32 *arg2, f32 *
|
||||
Mtxf *mtx1;
|
||||
Mtxf *mtx2;
|
||||
|
||||
if (model->filedata->skel == &g_SkelChr) {
|
||||
if (model->definition->skel == &g_SkelChr) {
|
||||
mtx1 = &model->matrices[0];
|
||||
mtx2 = &model->matrices[1];
|
||||
arg1->z = mtx2->m[3][2] + (mtx1->m[3][2] - mtx2->m[3][2]) * 0.5f;
|
||||
} else if (model->filedata->skel == &g_SkelSkedar) {
|
||||
} else if (model->definition->skel == &g_SkelSkedar) {
|
||||
mtx2 = &model->matrices[0];
|
||||
arg1->z = mtx2->m[3][2];
|
||||
} else if (model->filedata->skel == &g_SkelDrCaroll) {
|
||||
} else if (model->definition->skel == &g_SkelDrCaroll) {
|
||||
mtx2 = &model->matrices[0];
|
||||
arg1->z = mtx2->m[3][2];
|
||||
} else {
|
||||
@@ -5588,13 +5588,13 @@ bool chrCalculateAutoAim(struct prop *prop, struct coord *arg1, f32 *arg2, f32 *
|
||||
}
|
||||
|
||||
if (arg1->z < 0) {
|
||||
if (model->filedata->skel == &g_SkelChr) {
|
||||
if (model->definition->skel == &g_SkelChr) {
|
||||
arg1->x = mtx2->m[3][0] + (mtx1->m[3][0] - mtx2->m[3][0]) * 0.5f;
|
||||
arg1->y = mtx2->m[3][1] + (mtx1->m[3][1] - mtx2->m[3][1]) * 0.5f;
|
||||
} else if (model->filedata->skel == &g_SkelSkedar) {
|
||||
} else if (model->definition->skel == &g_SkelSkedar) {
|
||||
arg1->x = mtx2->m[3][0];
|
||||
arg1->y = mtx2->m[3][1];
|
||||
} else if (model->filedata->skel == &g_SkelDrCaroll) {
|
||||
} else if (model->definition->skel == &g_SkelDrCaroll) {
|
||||
arg1->x = mtx2->m[3][0];
|
||||
arg1->y = mtx2->m[3][1];
|
||||
} else {
|
||||
@@ -5621,7 +5621,7 @@ bool chr0f028d50(struct prop *arg0, struct prop *arg1, struct modelnode *node, s
|
||||
return true;
|
||||
}
|
||||
|
||||
*total += model->filedata->nummatrices;
|
||||
*total += model->definition->nummatrices;
|
||||
|
||||
if (arg0->child && chr0f028d50(arg0->child, arg1, node, model, total) > 0) {
|
||||
return true;
|
||||
@@ -5660,8 +5660,8 @@ bool chr0f028e6c(s32 arg0, struct prop *prop, struct prop **propptr, struct mode
|
||||
|
||||
if (1);
|
||||
|
||||
if (arg0 >= model->filedata->nummatrices) {
|
||||
arg0 -= model->filedata->nummatrices;
|
||||
if (arg0 >= model->definition->nummatrices) {
|
||||
arg0 -= model->definition->nummatrices;
|
||||
|
||||
if (prop->child) {
|
||||
result = chr0f028e6c(arg0, prop->child, propptr, nodeptr, modelptr);
|
||||
@@ -5863,7 +5863,7 @@ s32 chr0f0293ec(struct prop *prop, s32 cmnum)
|
||||
|
||||
if (model == parentmodel->attachedtomodel) {
|
||||
if (node == parentmodel->attachedtonode) {
|
||||
result = chr0f028e18(child, parentmodel->filedata->rootnode, parentmodel, prop);
|
||||
result = chr0f028e18(child, parentmodel->definition->rootnode, parentmodel, prop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5904,7 +5904,7 @@ s32 chr0f0294cc(struct prop *prop, s32 arg1)
|
||||
|
||||
if (parent->attachedtomodel == model2->attachedtomodel) {
|
||||
if (parent->attachedtonode == model2->attachedtonode) {
|
||||
result = chr0f028e18(child, parent->filedata->rootnode, parent, prop);
|
||||
result = chr0f028e18(child, parent->definition->rootnode, parent, prop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6721,10 +6721,10 @@ Gfx *shieldhitRender(Gfx *gdl, struct prop *prop1, struct prop *prop2, s32 alpha
|
||||
model = chr->model;
|
||||
} else {
|
||||
model = prop2->obj->model;
|
||||
specificnode = modelGetPart(model->filedata, MODELPART_BASIC_0067);
|
||||
specificnode = modelGetPart(model->definition, MODELPART_BASIC_0067);
|
||||
}
|
||||
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
if ((node->type & 0xff) == MODELNODETYPE_BBOX) {
|
||||
@@ -6846,7 +6846,7 @@ Gfx *chrRenderCloak(Gfx *gdl, struct prop *chrprop, struct prop *thisprop)
|
||||
model = thisprop->chr->model;
|
||||
} else {
|
||||
model = thisprop->obj->model;
|
||||
bbox = modelGetPart(model->filedata, MODELPART_BASIC_0067);
|
||||
bbox = modelGetPart(model->definition, MODELPART_BASIC_0067);
|
||||
}
|
||||
|
||||
if (thisprop->parent == NULL) {
|
||||
@@ -6875,7 +6875,7 @@ Gfx *chrRenderCloak(Gfx *gdl, struct prop *chrprop, struct prop *thisprop)
|
||||
}
|
||||
|
||||
// Iterate nodes in the prop and render each
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
if ((node->type & 0xff) == MODELNODETYPE_BBOX) {
|
||||
@@ -7165,8 +7165,8 @@ void chrSetDrCarollImages(struct chrdata *drcaroll, s32 imageleft, s32 imagerigh
|
||||
// Parts 0-5 are the left image
|
||||
// Parts 6-11 are the right image
|
||||
for (i = 0; i < 6; i++) {
|
||||
nodes[0] = modelGetPart(model->filedata, i);
|
||||
nodes[1] = modelGetPart(model->filedata, i + 6);
|
||||
nodes[0] = modelGetPart(model->definition, i);
|
||||
nodes[1] = modelGetPart(model->definition, i + 6);
|
||||
|
||||
for (j = 0; j < 2; j++) {
|
||||
if (nodes[j]) {
|
||||
|
||||
+16
-16
@@ -5710,7 +5710,7 @@ void chrNavTickMagic(struct chrdata *chr, struct waydata *waydata, f32 speed, st
|
||||
|
||||
modelSetRootPosition(chr->model, &prop->pos);
|
||||
|
||||
rwdata = modelGetNodeRwData(chr->model, chr->model->filedata->rootnode);
|
||||
rwdata = modelGetNodeRwData(chr->model, chr->model->definition->rootnode);
|
||||
rwdata->chrinfo.ground = ground;
|
||||
|
||||
chr->chrflags |= CHRCFLAG_00000001;
|
||||
@@ -9138,7 +9138,7 @@ bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, bool fi
|
||||
struct defaultobj *gun = gunprop->obj;
|
||||
gunmodel = gun->model;
|
||||
sp114 = 0;
|
||||
burstnode = modelGetPart(gunmodel->filedata, MODELPART_CHRGUN_GUNFIRE);
|
||||
burstnode = modelGetPart(gunmodel->definition, MODELPART_CHRGUN_GUNFIRE);
|
||||
|
||||
if (burstnode) {
|
||||
sp108 = modelFindNodeMtx(gunmodel, burstnode, 0);
|
||||
@@ -9161,7 +9161,7 @@ bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, bool fi
|
||||
sp118.z = spb8.z;
|
||||
}
|
||||
} else {
|
||||
posnode = modelGetPart(gunmodel->filedata, MODELPART_CHRGUN_0001);
|
||||
posnode = modelGetPart(gunmodel->definition, MODELPART_CHRGUN_0001);
|
||||
|
||||
if (posnode) {
|
||||
spb0 = modelFindNodeMtx(gunmodel, posnode, 0);
|
||||
@@ -9203,7 +9203,7 @@ bool func0f03e9f4(struct chrdata *chr, struct attackanimconfig *animcfg, bool fi
|
||||
aimendsideback += M_BADTAU;
|
||||
}
|
||||
|
||||
chrrwdata = modelGetNodeRwData(chr->model, chr->model->filedata->rootnode);
|
||||
chrrwdata = modelGetNodeRwData(chr->model, chr->model->definition->rootnode);
|
||||
|
||||
if (chrrwdata->unk5c > 0.0f) {
|
||||
aimendsideback -= chrrwdata->unk5c * chrrwdata->unk58;
|
||||
@@ -9583,7 +9583,7 @@ bool chrGetGunPos(struct chrdata *chr, s32 handnum, struct coord *gunpos)
|
||||
model = obj->model;
|
||||
|
||||
if ((chr->prop->flags & PROPFLAG_ONTHISSCREENTHISTICK) && (weaponprop->flags & PROPFLAG_ONTHISSCREENTHISTICK)) {
|
||||
if ((part0 = modelGetPart(model->filedata, MODELPART_0000))) {
|
||||
if ((part0 = modelGetPart(model->definition, MODELPART_0000))) {
|
||||
spac = modelFindNodeMtx(model, part0, 0);
|
||||
rodata = &part0->rodata->chrgunfire;
|
||||
|
||||
@@ -9594,7 +9594,7 @@ bool chrGetGunPos(struct chrdata *chr, s32 handnum, struct coord *gunpos)
|
||||
mtx00015be4(camGetProjectionMtxF(), spac, &sp6c);
|
||||
mtx4TransformVecInPlace(&sp6c, gunpos);
|
||||
result = true;
|
||||
} else if ((part1 = modelGetPart(model->filedata, MODELPART_0001))) {
|
||||
} else if ((part1 = modelGetPart(model->definition, MODELPART_0001))) {
|
||||
sp64 = modelFindNodeMtx(model, part1, 0);
|
||||
|
||||
mtx00015be4(camGetProjectionMtxF(), sp64, &sp24);
|
||||
@@ -9660,7 +9660,7 @@ void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord
|
||||
mtx4RotateVec(worldtoscreenmtx, vector, &sp118);
|
||||
|
||||
isdifferentmtx = (camGetWorldToScreenMtxf() != worldtoscreenmtx);
|
||||
node = chr->model->filedata->rootnode;
|
||||
node = chr->model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
if ((node->type & 0xff) == MODELNODETYPE_BBOX) {
|
||||
@@ -9747,7 +9747,7 @@ void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord
|
||||
// If no node was found above, search the model for the torso bbox
|
||||
// and return that.
|
||||
if (!done) {
|
||||
node = chr->model->filedata->rootnode;
|
||||
node = chr->model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
|
||||
@@ -10793,7 +10793,7 @@ void robotSetMuzzleFlash(struct chrdata *chr, bool right, bool visible)
|
||||
partnum = MODELPART_ROBOT_LGUNFIRE;
|
||||
}
|
||||
|
||||
node = modelGetPart(chr->model->filedata, partnum);
|
||||
node = modelGetPart(chr->model->definition, partnum);
|
||||
|
||||
if (node) {
|
||||
rwdata = modelGetNodeRwData(chr->model, node);
|
||||
@@ -10879,7 +10879,7 @@ void chrTickRobotAttack(struct chrdata *chr)
|
||||
|
||||
func0f0429d8(chr, 0.085f, invtheta);
|
||||
|
||||
if (chr->model->filedata->skel != &g_SkelRobot) {
|
||||
if (chr->model->definition->skel != &g_SkelRobot) {
|
||||
act->finished = true;
|
||||
return;
|
||||
}
|
||||
@@ -10918,7 +10918,7 @@ void chrTickRobotAttack(struct chrdata *chr)
|
||||
Mtxf spa4;
|
||||
|
||||
aimy = targetprop->pos.y - 20.0f;
|
||||
rodata = modelGetPartRodata(chr->model->filedata, (i ? MODELPART_ROBOT_0000 : MODELPART_ROBOT_0001));
|
||||
rodata = modelGetPartRodata(chr->model->definition, (i ? MODELPART_ROBOT_0000 : MODELPART_ROBOT_0001));
|
||||
|
||||
act->pos[i].x = rodata->position.pos.x;
|
||||
act->pos[i].y = rodata->position.pos.y - 300.0f;
|
||||
@@ -11185,7 +11185,7 @@ void chrTickAttackRoll(struct chrdata *chr)
|
||||
}
|
||||
|
||||
if (chr->act_attack.animcfg->unk0c != 0.0f) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, model->filedata->rootnode);
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, model->definition->rootnode);
|
||||
rwdata->chrinfo.unk5c = sp34;
|
||||
rwdata->chrinfo.unk58 = -chr->act_attack.animcfg->unk0c / sp34;
|
||||
|
||||
@@ -15297,10 +15297,10 @@ bool chrMoveToPos(struct chrdata *chr, struct coord *pos, s16 *rooms, f32 angle,
|
||||
chr0f0220ac(chr);
|
||||
modelSetRootPosition(chr->model, &pos2);
|
||||
|
||||
nodetype = chr->model->filedata->rootnode->type;
|
||||
nodetype = chr->model->definition->rootnode->type;
|
||||
|
||||
if ((nodetype & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
rwdata = modelGetNodeRwData(chr->model, chr->model->filedata->rootnode);
|
||||
rwdata = modelGetNodeRwData(chr->model, chr->model->definition->rootnode);
|
||||
rwdata->chrinfo.ground = ground;
|
||||
}
|
||||
|
||||
@@ -16088,8 +16088,8 @@ Gfx *chrsRenderChrStats(Gfx *gdl, s16 *rooms)
|
||||
|
||||
void chrToggleModelPart(struct chrdata *chr, s32 partnum)
|
||||
{
|
||||
if (chr && chr->model && chr->model->filedata) {
|
||||
struct modelnode *node = modelGetPart(chr->model->filedata, partnum);
|
||||
if (chr && chr->model && chr->model->definition) {
|
||||
struct modelnode *node = modelGetPart(chr->model->definition, partnum);
|
||||
union modelrwdata *rwdata = NULL;
|
||||
|
||||
if (node) {
|
||||
|
||||
+3
-3
@@ -1765,7 +1765,7 @@ void beamTick(struct beam *beam)
|
||||
|
||||
bool g_CasingsActive = false;
|
||||
|
||||
struct casing *casingCreate(struct modelfiledata *modeldef, Mtxf *mtx)
|
||||
struct casing *casingCreate(struct modeldef *modeldef, Mtxf *mtx)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
@@ -1814,7 +1814,7 @@ void casingCreateForHand(s32 handnum, f32 ground, Mtxf *mtx)
|
||||
struct weaponfunc *func = gsetGetWeaponFunction2(&player->hands[handnum].gset);
|
||||
struct weapon *weapondef = weaponFindById(player->gunctrl.weaponnum);
|
||||
struct weaponfunc_shoot *shootfunc = NULL;
|
||||
struct modelfiledata *modeldef;
|
||||
struct modeldef *modeldef;
|
||||
|
||||
if ((func->type & 0xff) == INVENTORYFUNCTYPE_SHOOT) {
|
||||
shootfunc = (struct weaponfunc_shoot *)func;
|
||||
@@ -1959,7 +1959,7 @@ void casingCreateForHand(s32 handnum, f32 ground, Mtxf *mtx)
|
||||
void casingRender(struct casing *casing, Gfx **gdlptr)
|
||||
{
|
||||
Gfx *gdl = *gdlptr;
|
||||
struct modelfiledata *modeldef = casing->modeldef;
|
||||
struct modeldef *modeldef = casing->modeldef;
|
||||
Mtxf *matrices = gfxAllocate(modeldef->nummatrices * sizeof(Mtxf));
|
||||
struct model model;
|
||||
struct modelrenderdata renderdata = { NULL, true, 3 };
|
||||
|
||||
@@ -10,7 +10,7 @@ struct modelrodata_chrinfo var8007c124;
|
||||
struct modelrodata_position var8007c130;
|
||||
struct modelrodata_position var8007c148;
|
||||
|
||||
struct modelfiledata g_PlayerModelFileData = {
|
||||
struct modeldef g_PlayerModeldef = {
|
||||
(struct modelnode *) &var8007c0dc,
|
||||
&g_Skel0B,
|
||||
NULL,
|
||||
|
||||
+15
-15
@@ -106,7 +106,7 @@ struct skeleton *g_Skeletons[] = {
|
||||
&g_SkelBB,
|
||||
};
|
||||
|
||||
void modeldef0f1a7560(struct modelfiledata *modeldef, u16 filenum, u32 arg2, struct modelfiledata *modeldef2, struct texpool *texpool, bool arg5)
|
||||
void modeldef0f1a7560(struct modeldef *modeldef, u16 filenum, u32 arg2, struct modeldef *modeldef2, struct texpool *texpool, bool arg5)
|
||||
{
|
||||
s32 allocsize;
|
||||
s32 loadedsize;
|
||||
@@ -162,45 +162,45 @@ void modeldef0f1a7560(struct modelfiledata *modeldef, u16 filenum, u32 arg2, str
|
||||
}
|
||||
}
|
||||
|
||||
void modelPromoteTypeToPointer(struct modelfiledata *filedata)
|
||||
void modelPromoteTypeToPointer(struct modeldef *modeldef)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
if ((u32)filedata->skel < 0x10000) {
|
||||
if ((u32)modeldef->skel < 0x10000) {
|
||||
for (i = 0; g_Skeletons[i] != NULL; i++) {
|
||||
if ((s16)filedata->skel == g_Skeletons[i]->skel) {
|
||||
filedata->skel = g_Skeletons[i];
|
||||
if ((s16)modeldef->skel == g_Skeletons[i]->skel) {
|
||||
modeldef->skel = g_Skeletons[i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct modelfiledata *modeldefLoad(u16 fileid, u8 *dst, s32 size, struct texpool *arg3)
|
||||
struct modeldef *modeldefLoad(u16 fileid, u8 *dst, s32 size, struct texpool *arg3)
|
||||
{
|
||||
struct modelfiledata *filedata;
|
||||
struct modeldef *modeldef;
|
||||
|
||||
g_LoadType = LOADTYPE_MODEL;
|
||||
|
||||
if (dst) {
|
||||
filedata = fileLoadToAddr(fileid, FILELOADMETHOD_EXTRAMEM, dst, size);
|
||||
modeldef = fileLoadToAddr(fileid, FILELOADMETHOD_EXTRAMEM, dst, size);
|
||||
} else {
|
||||
filedata = fileLoadToNew(fileid, FILELOADMETHOD_EXTRAMEM);
|
||||
modeldef = fileLoadToNew(fileid, FILELOADMETHOD_EXTRAMEM);
|
||||
}
|
||||
|
||||
modelPromoteTypeToPointer(filedata);
|
||||
modelPromoteOffsetsToPointers(filedata, 0x5000000, (u32) filedata);
|
||||
modeldef0f1a7560(filedata, fileid, 0x5000000, filedata, arg3, dst == NULL);
|
||||
modelPromoteTypeToPointer(modeldef);
|
||||
modelPromoteOffsetsToPointers(modeldef, 0x5000000, (u32) modeldef);
|
||||
modeldef0f1a7560(modeldef, fileid, 0x5000000, modeldef, arg3, dst == NULL);
|
||||
|
||||
return filedata;
|
||||
return modeldef;
|
||||
}
|
||||
|
||||
struct modelfiledata *modeldefLoadToNew(u16 fileid)
|
||||
struct modeldef *modeldefLoadToNew(u16 fileid)
|
||||
{
|
||||
return modeldefLoad(fileid, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
struct modelfiledata *modeldefLoadToAddr(u16 fileid, u8 *dst, s32 size)
|
||||
struct modeldef *modeldefLoadToAddr(u16 fileid, u8 *dst, s32 size)
|
||||
{
|
||||
return modeldefLoad(fileid, dst, size, NULL);
|
||||
}
|
||||
|
||||
+12
-12
@@ -26,7 +26,7 @@ s32 g_ModelMostAnims = 0;
|
||||
#define NUMTYPE2() (IS4MB() ? 24 : 25)
|
||||
#define NUMTYPE3() (IS4MB() ? 0 : 20)
|
||||
|
||||
bool modelmgrCanSlotFitRwdata(struct model *modelslot, struct modelfiledata *modeldef)
|
||||
bool modelmgrCanSlotFitRwdata(struct model *modelslot, struct modeldef *modeldef)
|
||||
{
|
||||
return modeldef->rwdatalen <= 0
|
||||
|| (modelslot->rwdatas != NULL && modelslot->rwdatalen >= modeldef->rwdatalen);
|
||||
@@ -60,7 +60,7 @@ void modelmgrPrintCounts(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
if (g_ModelSlots[i].filedata) {
|
||||
if (g_ModelSlots[i].definition) {
|
||||
nummodels++;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ void modelmgrPrintCounts(void)
|
||||
if (IS4MB());
|
||||
}
|
||||
|
||||
struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool withanim)
|
||||
struct model *modelmgrInstantiateModel(struct modeldef *modeldef, bool withanim)
|
||||
{
|
||||
struct model *model = NULL;
|
||||
union modelrwdata **rwdatas = NULL;
|
||||
@@ -113,7 +113,7 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
|
||||
// If it's being allocated mid-gameplay, look through all slots
|
||||
// and find any slot that's big enough.
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
if (g_ModelSlots[i].filedata == NULL && modelmgrCanSlotFitRwdata(&g_ModelSlots[i], modeldef)) {
|
||||
if (g_ModelSlots[i].definition == NULL && modelmgrCanSlotFitRwdata(&g_ModelSlots[i], modeldef)) {
|
||||
model = &g_ModelSlots[i];
|
||||
rwdatas = g_ModelSlots[i].rwdatas;
|
||||
datalen = g_ModelSlots[i].rwdatalen;
|
||||
@@ -127,7 +127,7 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
|
||||
|
||||
// Find any spare slot or allocate a new one
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
if (g_ModelSlots[i].filedata == NULL) {
|
||||
if (g_ModelSlots[i].definition == NULL) {
|
||||
model = &g_ModelSlots[i];
|
||||
break;
|
||||
}
|
||||
@@ -249,9 +249,9 @@ struct model *modelmgrInstantiateModel(struct modelfiledata *modeldef, bool with
|
||||
return model;
|
||||
}
|
||||
|
||||
struct model *modelmgrInstantiateModelWithoutAnim(struct modelfiledata *modelfiledata)
|
||||
struct model *modelmgrInstantiateModelWithoutAnim(struct modeldef *modeldef)
|
||||
{
|
||||
return modelmgrInstantiateModel(modelfiledata, false);
|
||||
return modelmgrInstantiateModel(modeldef, false);
|
||||
}
|
||||
|
||||
void modelmgrFreeModel(struct model *model)
|
||||
@@ -311,17 +311,17 @@ void modelmgrFreeModel(struct model *model)
|
||||
model->anim = NULL;
|
||||
}
|
||||
|
||||
model->filedata = NULL;
|
||||
model->definition = NULL;
|
||||
}
|
||||
|
||||
struct model *modelmgrInstantiateModelWithAnim(struct modelfiledata *modelfiledata)
|
||||
struct model *modelmgrInstantiateModelWithAnim(struct modeldef *modeldef)
|
||||
{
|
||||
return modelmgrInstantiateModel(modelfiledata, true);
|
||||
return modelmgrInstantiateModel(modeldef, true);
|
||||
}
|
||||
|
||||
void modelmgrAttachHead(struct model *model, struct modelnode *node, struct modelfiledata *headmodeldef)
|
||||
void modelmgrAttachHead(struct model *model, struct modelnode *node, struct modeldef *headmodeldef)
|
||||
{
|
||||
modelAttachHead(model, model->filedata, node, headmodeldef);
|
||||
modelAttachHead(model, model->definition, node, headmodeldef);
|
||||
modelInitRwData(model, headmodeldef->rootnode);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ void modelmgrAllocateSlots(s32 numobjs, s32 numchrs)
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
g_ModelSlots[i].filedata = NULL;
|
||||
g_ModelSlots[i].definition = NULL;
|
||||
g_ModelSlots[i].rwdatas = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ struct mpsetup g_MpSetup;
|
||||
struct bossfile g_BossFile;
|
||||
u32 var800acc1c;
|
||||
struct mplockinfo g_MpLockInfo;
|
||||
struct modelfiledata *var800acc28[18];
|
||||
struct modeldef *var800acc28[18];
|
||||
|
||||
// Forward declaractions
|
||||
struct mpweaponset g_MpWeaponSets[12];
|
||||
@@ -3937,7 +3937,7 @@ void func0f18e558(void)
|
||||
}
|
||||
}
|
||||
|
||||
struct modelfiledata *func0f18e57c(s32 index, s32 *headnum)
|
||||
struct modeldef *func0f18e57c(s32 index, s32 *headnum)
|
||||
{
|
||||
return var800acc28[index];
|
||||
}
|
||||
|
||||
+27
-27
@@ -894,8 +894,8 @@ bool playerSpawnAnti(struct chrdata *hostchr, bool force)
|
||||
modelCopyAnimData(hostchr->model, playerchr->model);
|
||||
func0f02e9a0(playerchr, 12);
|
||||
|
||||
chrrootrwdata = modelGetNodeRwData(hostchr->model, hostchr->model->filedata->rootnode);
|
||||
playerrootrwdata = modelGetNodeRwData(playerchr->model, playerchr->model->filedata->rootnode);
|
||||
chrrootrwdata = modelGetNodeRwData(hostchr->model, hostchr->model->definition->rootnode);
|
||||
playerrootrwdata = modelGetNodeRwData(playerchr->model, playerchr->model->definition->rootnode);
|
||||
|
||||
playerrootrwdata->chrinfo = chrrootrwdata->chrinfo;
|
||||
|
||||
@@ -1277,9 +1277,9 @@ void playerTickChrBody(void)
|
||||
if (g_Vars.currentplayer->haschrbody == false) {
|
||||
struct chrdata *chr;
|
||||
struct texpool texpool;
|
||||
struct modelfiledata *bodyfiledata;
|
||||
struct modelfiledata *headfiledata = NULL;
|
||||
struct modelfiledata *weaponfiledata;
|
||||
struct modeldef *bodymodeldef;
|
||||
struct modeldef *headmodeldef = NULL;
|
||||
struct modeldef *weaponmodeldef;
|
||||
s32 offset1 = 0;
|
||||
u8 *allocation;
|
||||
void *spe8;
|
||||
@@ -1399,21 +1399,21 @@ void playerTickChrBody(void)
|
||||
bgunCalculateGunMemCapacity();
|
||||
spe8 = g_Vars.currentplayer->gunmem2 + offset2;
|
||||
texInitPool(&texpool, spe8, bgunCalculateGunMemCapacity() - offset2);
|
||||
bodyfiledata = modeldefLoad(g_HeadsAndBodies[bodynum].filenum, allocation + offset1, offset2 - offset1, &texpool);
|
||||
bodymodeldef = modeldefLoad(g_HeadsAndBodies[bodynum].filenum, allocation + offset1, offset2 - offset1, &texpool);
|
||||
offset1 = ALIGN64(fileGetLoadedSize(g_HeadsAndBodies[bodynum].filenum) + offset1);
|
||||
|
||||
if (headnum >= 0) {
|
||||
headfiledata = modeldefLoad(g_HeadsAndBodies[headnum].filenum, allocation + offset1, offset2 - offset1, &texpool);
|
||||
headmodeldef = modeldefLoad(g_HeadsAndBodies[headnum].filenum, allocation + offset1, offset2 - offset1, &texpool);
|
||||
offset1 = ALIGN64(fileGetLoadedSize(g_HeadsAndBodies[headnum].filenum) + offset1);
|
||||
}
|
||||
|
||||
modelAllocateRwData(bodyfiledata);
|
||||
modelAllocateRwData(bodymodeldef);
|
||||
|
||||
if (headfiledata != NULL) {
|
||||
modelAllocateRwData(headfiledata);
|
||||
if (headmodeldef != NULL) {
|
||||
modelAllocateRwData(headmodeldef);
|
||||
}
|
||||
|
||||
modelInit(model, bodyfiledata, rwdatas, false);
|
||||
modelInit(model, bodymodeldef, rwdatas, false);
|
||||
animInit(model->anim);
|
||||
|
||||
model->rwdatalen = 256;
|
||||
@@ -1429,31 +1429,31 @@ void playerTickChrBody(void)
|
||||
texGetPoolLeftPos(&texpool);
|
||||
} else {
|
||||
// 2-4 players
|
||||
if (g_HeadsAndBodies[bodynum].filedata == NULL) {
|
||||
g_HeadsAndBodies[bodynum].filedata = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
if (g_HeadsAndBodies[bodynum].modeldef == NULL) {
|
||||
g_HeadsAndBodies[bodynum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum);
|
||||
}
|
||||
|
||||
bodyfiledata = g_HeadsAndBodies[bodynum].filedata;
|
||||
bodymodeldef = g_HeadsAndBodies[bodynum].modeldef;
|
||||
|
||||
if (g_HeadsAndBodies[bodynum].unk00_01) {
|
||||
headnum = -1;
|
||||
} else if (sp60) {
|
||||
headfiledata = func0f18e57c(headnum, &headnum);
|
||||
headmodeldef = func0f18e57c(headnum, &headnum);
|
||||
} else if (g_Vars.normmplayerisrunning && IS8MB()) {
|
||||
g_HeadsAndBodies[headnum].filedata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
headfiledata = g_HeadsAndBodies[headnum].filedata;
|
||||
g_HeadsAndBodies[headnum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
headmodeldef = g_HeadsAndBodies[headnum].modeldef;
|
||||
g_FileInfo[g_HeadsAndBodies[headnum].filenum].loadedsize = 0;
|
||||
bodyCalculateHeadOffset(headfiledata, headnum, bodynum);
|
||||
bodyCalculateHeadOffset(headmodeldef, headnum, bodynum);
|
||||
} else {
|
||||
if (g_HeadsAndBodies[headnum].filedata == NULL) {
|
||||
g_HeadsAndBodies[headnum].filedata = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
if (g_HeadsAndBodies[headnum].modeldef == NULL) {
|
||||
g_HeadsAndBodies[headnum].modeldef = modeldefLoadToNew(g_HeadsAndBodies[headnum].filenum);
|
||||
}
|
||||
|
||||
headfiledata = g_HeadsAndBodies[headnum].filedata;
|
||||
headmodeldef = g_HeadsAndBodies[headnum].modeldef;
|
||||
}
|
||||
}
|
||||
|
||||
g_Vars.currentplayer->model00d4 = body0f02ce8c(bodynum, headnum, bodyfiledata, headfiledata, false, model, true, true);
|
||||
g_Vars.currentplayer->model00d4 = body0f02ce8c(bodynum, headnum, bodymodeldef, headmodeldef, false, model, true, true);
|
||||
|
||||
chr0f020b14(g_Vars.currentplayer->prop, g_Vars.currentplayer->model00d4, &g_Vars.currentplayer->prop->pos,
|
||||
g_Vars.currentplayer->prop->rooms, turnangle, 0);
|
||||
@@ -1501,15 +1501,15 @@ void playerTickChrBody(void)
|
||||
|
||||
if (weaponmodelnum >= 0) {
|
||||
if (g_Vars.mplayerisrunning == false) {
|
||||
weaponfiledata = modeldefLoad(g_ModelStates[weaponmodelnum].fileid, allocation + offset1, offset2 - offset1, &texpool);
|
||||
weaponmodeldef = modeldefLoad(g_ModelStates[weaponmodelnum].fileid, allocation + offset1, offset2 - offset1, &texpool);
|
||||
fileGetLoadedSize(g_ModelStates[weaponmodelnum].fileid);
|
||||
modelAllocateRwData(weaponfiledata);
|
||||
modelAllocateRwData(weaponmodeldef);
|
||||
} else {
|
||||
weaponobj = NULL;
|
||||
weaponfiledata = NULL;
|
||||
weaponmodeldef = NULL;
|
||||
}
|
||||
|
||||
weaponCreateForChr(chr, weaponmodelnum, weaponnum, 0, weaponobj, weaponfiledata);
|
||||
weaponCreateForChr(chr, weaponmodelnum, weaponnum, 0, weaponobj, weaponmodeldef);
|
||||
}
|
||||
|
||||
chr->fireslots[0] = bgunAllocateFireslot();
|
||||
@@ -5289,7 +5289,7 @@ s32 playerTickThirdPerson(struct prop *prop)
|
||||
chr0f0220ac(prop->chr);
|
||||
|
||||
if (prop->flags & PROPFLAG_ONTHISSCREENTHISTICK) {
|
||||
if (player->model00d4->filedata->skel == &g_SkelChr) {
|
||||
if (player->model00d4->definition->skel == &g_SkelChr) {
|
||||
spe8 = player->model00d4->matrices;
|
||||
} else {
|
||||
spe8 = player->model00d4->matrices;
|
||||
|
||||
+164
-164
File diff suppressed because it is too large
Load Diff
+21
-21
@@ -409,9 +409,9 @@ void setupCreateObject(struct defaultobj *obj, s32 cmdindex)
|
||||
|
||||
if (obj->flags & OBJFLAG_INSIDEANOTHEROBJ) {
|
||||
if (obj->type == OBJTYPE_WEAPON) {
|
||||
func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].filedata);
|
||||
func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].modeldef);
|
||||
} else {
|
||||
objInitWithModelDef(obj, g_ModelStates[modelnum].filedata);
|
||||
objInitWithModelDef(obj, g_ModelStates[modelnum].modeldef);
|
||||
}
|
||||
|
||||
modelSetScale(obj->model, obj->model->scale * scale);
|
||||
@@ -423,9 +423,9 @@ void setupCreateObject(struct defaultobj *obj, s32 cmdindex)
|
||||
|
||||
if (chr && chr->prop && chr->model) {
|
||||
if (obj->type == OBJTYPE_WEAPON) {
|
||||
prop = func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].filedata);
|
||||
prop = func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].modeldef);
|
||||
} else {
|
||||
prop = objInitWithModelDef(obj, g_ModelStates[modelnum].filedata);
|
||||
prop = objInitWithModelDef(obj, g_ModelStates[modelnum].modeldef);
|
||||
}
|
||||
|
||||
modelSetScale(obj->model, obj->model->scale * scale);
|
||||
@@ -434,9 +434,9 @@ void setupCreateObject(struct defaultobj *obj, s32 cmdindex)
|
||||
} else {
|
||||
if (obj->pad < 0) {
|
||||
if (obj->type == OBJTYPE_WEAPON) {
|
||||
func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].filedata);
|
||||
func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].modeldef);
|
||||
} else {
|
||||
objInitWithModelDef(obj, g_ModelStates[modelnum].filedata);
|
||||
objInitWithModelDef(obj, g_ModelStates[modelnum].modeldef);
|
||||
}
|
||||
|
||||
modelSetScale(obj->model, obj->model->scale * scale);
|
||||
@@ -473,7 +473,7 @@ void setupCreateObject(struct defaultobj *obj, s32 cmdindex)
|
||||
}
|
||||
|
||||
if (obj->type == OBJTYPE_WEAPON) {
|
||||
prop2 = func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].filedata);
|
||||
prop2 = func0f08ae0c((struct weaponobj *)obj, g_ModelStates[modelnum].modeldef);
|
||||
} else {
|
||||
prop2 = objInitWithAutoModel(obj);
|
||||
}
|
||||
@@ -798,7 +798,7 @@ void setupCreateCctv(struct cctvobj *cctv, s32 cmdindex)
|
||||
|
||||
if (cctv->lookatpadnum >= 0) {
|
||||
struct coord lenspos;
|
||||
union modelrodata *lens = modelGetPartRodata(obj->model->filedata, MODELPART_CCTV_CASING);
|
||||
union modelrodata *lens = modelGetPartRodata(obj->model->definition, MODELPART_CCTV_CASING);
|
||||
struct pad pad;
|
||||
f32 xdiff;
|
||||
f32 ydiff;
|
||||
@@ -936,13 +936,13 @@ void setupCreateSingleMonitor(struct singlemonitorobj *monitor, s32 cmdindex)
|
||||
monitor->base.model->attachedtomodel = owner->model;
|
||||
|
||||
if (monitor->ownerpart == MODELPART_0000) {
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->filedata, MODELPART_0000);
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->definition, MODELPART_0000);
|
||||
} else if (monitor->ownerpart == MODELPART_0001) {
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->filedata, MODELPART_0001);
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->definition, MODELPART_0001);
|
||||
} else if (monitor->ownerpart == MODELPART_0002) {
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->filedata, MODELPART_0002);
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->definition, MODELPART_0002);
|
||||
} else {
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->filedata, MODELPART_0003);
|
||||
monitor->base.model->attachedtonode = modelGetPart(owner->model->definition, MODELPART_0003);
|
||||
}
|
||||
|
||||
propReparent(prop, owner->prop);
|
||||
@@ -1098,7 +1098,7 @@ void setupCreateDoor(struct doorobj *door, s32 cmdindex)
|
||||
f32 zscale;
|
||||
struct modelrodata_bbox *bbox;
|
||||
|
||||
bbox = modelFileDataFindBboxRodata(g_ModelStates[modelnum].filedata);
|
||||
bbox = modeldefFindBboxRodata(g_ModelStates[modelnum].modeldef);
|
||||
|
||||
mtx00016d58(&sp110, 0, 0, 0,
|
||||
-pad.look.x, -pad.look.y, -pad.look.z,
|
||||
@@ -1307,7 +1307,7 @@ void setupLoadFiles(s32 stagenum)
|
||||
g_DoorScale = 1;
|
||||
|
||||
for (i = 0; i < NUM_MODELS; i++) {
|
||||
g_ModelStates[i].filedata = NULL;
|
||||
g_ModelStates[i].modeldef = NULL;
|
||||
}
|
||||
|
||||
if (stagenum < STAGE_TITLE) {
|
||||
@@ -1654,20 +1654,20 @@ void setupCreateProps(s32 stagenum)
|
||||
setupLoadModeldef(modelnum);
|
||||
modelstate = &g_ModelStates[modelnum];
|
||||
|
||||
if (modelstate->filedata) {
|
||||
if (modelGetPartRodata(modelstate->filedata, 1)) {
|
||||
if (modelstate->modeldef) {
|
||||
if (modelGetPartRodata(modelstate->modeldef, 1)) {
|
||||
obj->geocount++;
|
||||
}
|
||||
if (modelGetPartRodata(modelstate->filedata, 2)) {
|
||||
if (modelGetPartRodata(modelstate->modeldef, 2)) {
|
||||
obj->geocount++;
|
||||
}
|
||||
if (modelGetPartRodata(modelstate->filedata, 3)) {
|
||||
if (modelGetPartRodata(modelstate->modeldef, 3)) {
|
||||
obj->geocount++;
|
||||
}
|
||||
if (modelGetPartRodata(modelstate->filedata, 4)) {
|
||||
if (modelGetPartRodata(modelstate->modeldef, 4)) {
|
||||
obj->geocount++;
|
||||
}
|
||||
if (modelGetPartRodata(modelstate->filedata, 6)) {
|
||||
if (modelGetPartRodata(modelstate->modeldef, 6)) {
|
||||
obj->geocount++;
|
||||
}
|
||||
}
|
||||
@@ -1824,7 +1824,7 @@ void setupCreateProps(s32 stagenum)
|
||||
setupCreateObject(obj, index);
|
||||
|
||||
if (obj->model) {
|
||||
struct modelnode *node = modelGetPart(obj->model->filedata, 5);
|
||||
struct modelnode *node = modelGetPart(obj->model->definition, 5);
|
||||
|
||||
if (node) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(obj->model, node);
|
||||
|
||||
@@ -153,9 +153,9 @@ u32 setupGetCmdIndexByProp(struct prop *prop)
|
||||
|
||||
bool setupLoadModeldef(s32 modelnum)
|
||||
{
|
||||
if (g_ModelStates[modelnum].filedata == NULL) {
|
||||
g_ModelStates[modelnum].filedata = modeldefLoadToNew(g_ModelStates[modelnum].fileid);
|
||||
modelAllocateRwData(g_ModelStates[modelnum].filedata);
|
||||
if (g_ModelStates[modelnum].modeldef == NULL) {
|
||||
g_ModelStates[modelnum].modeldef = modeldefLoadToNew(g_ModelStates[modelnum].fileid);
|
||||
modelAllocateRwData(g_ModelStates[modelnum].modeldef);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ struct defaultobj *setupGetObjByCmdIndex(u32 cmdindex)
|
||||
* hat caller is unreachable because hats don't exist in PD. So it's only used
|
||||
* for weapons which means the candidate logic isn't used.
|
||||
*/
|
||||
struct defaultobj *setupFindObjForReuse(s32 wanttype, struct defaultobj **offscreenobjptr, struct defaultobj **anyobjptr, bool musthaveprop, bool musthavemodel, struct modelfiledata *filedata)
|
||||
struct defaultobj *setupFindObjForReuse(s32 wanttype, struct defaultobj **offscreenobjptr, struct defaultobj **anyobjptr, bool musthaveprop, bool musthavemodel, struct modeldef *modeldef)
|
||||
{
|
||||
struct defaultobj *offscreenobj = NULL;
|
||||
struct defaultobj *anyobj = NULL;
|
||||
@@ -324,7 +324,7 @@ struct defaultobj *setupFindObjForReuse(s32 wanttype, struct defaultobj **offscr
|
||||
&& (obj->flags & OBJFLAG_00800000) == 0
|
||||
#endif
|
||||
&& obj->prop->parent == NULL
|
||||
&& (!musthavemodel || modelmgrCanSlotFitRwdata(obj->model, filedata))) {
|
||||
&& (!musthavemodel || modelmgrCanSlotFitRwdata(obj->model, modeldef))) {
|
||||
if (offscreenobj == NULL && (obj->prop->flags & (PROPFLAG_ONTHISSCREENTHISTICK | PROPFLAG_ONANYSCREENTHISTICK | PROPFLAG_ONANYSCREENPREVTICK)) == 0) {
|
||||
offscreenobj = obj;
|
||||
}
|
||||
|
||||
+58
-58
@@ -556,39 +556,39 @@ void titleInitPdLogo(void)
|
||||
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
g_ModelStates[MODEL_NLOGO].filedata = modeldefLoad(g_ModelStates[MODEL_NLOGO].fileid, nextaddr, 0x47800, 0);
|
||||
g_ModelStates[MODEL_NLOGO].modeldef = modeldefLoad(g_ModelStates[MODEL_NLOGO].fileid, nextaddr, 0x47800, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_NLOGO].fileid));
|
||||
nextaddr += size;
|
||||
remaining = 0x47800 - size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NLOGO].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NLOGO].modeldef);
|
||||
|
||||
g_TitleModel = modelmgrInstantiateModelWithAnim(g_ModelStates[MODEL_NLOGO].filedata);
|
||||
g_TitleModel = modelmgrInstantiateModelWithAnim(g_ModelStates[MODEL_NLOGO].modeldef);
|
||||
modelSetScale(g_TitleModel, 1);
|
||||
modelSetRootPosition(g_TitleModel, &coord);
|
||||
}
|
||||
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
g_ModelStates[MODEL_NLOGO2].filedata = modeldefLoad(g_ModelStates[MODEL_NLOGO2].fileid, nextaddr, remaining, 0);
|
||||
g_ModelStates[MODEL_NLOGO2].modeldef = modeldefLoad(g_ModelStates[MODEL_NLOGO2].fileid, nextaddr, remaining, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_NLOGO2].fileid));
|
||||
nextaddr += size;
|
||||
remaining -= size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NLOGO2].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NLOGO2].modeldef);
|
||||
|
||||
g_TitleModelNLogo2 = modelmgrInstantiateModelWithAnim(g_ModelStates[MODEL_NLOGO2].filedata);
|
||||
g_TitleModelNLogo2 = modelmgrInstantiateModelWithAnim(g_ModelStates[MODEL_NLOGO2].modeldef);
|
||||
modelSetScale(g_TitleModelNLogo2, 1);
|
||||
modelSetRootPosition(g_TitleModelNLogo2, &coord);
|
||||
}
|
||||
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
g_ModelStates[MODEL_PDTWO].filedata = modeldefLoad(g_ModelStates[MODEL_PDTWO].fileid, nextaddr, remaining, 0);
|
||||
g_ModelStates[MODEL_PDTWO].modeldef = modeldefLoad(g_ModelStates[MODEL_PDTWO].fileid, nextaddr, remaining, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_PDTWO].fileid));
|
||||
nextaddr += size;
|
||||
remaining -= size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_PDTWO].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_PDTWO].modeldef);
|
||||
|
||||
g_TitleModelPdTwo = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_PDTWO].filedata);
|
||||
g_TitleModelPdTwo = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_PDTWO].modeldef);
|
||||
modelSetScale(g_TitleModelPdTwo, 1);
|
||||
modelSetRootPosition(g_TitleModelPdTwo, &coord);
|
||||
}
|
||||
@@ -596,26 +596,26 @@ void titleInitPdLogo(void)
|
||||
#if VERSION == VERSION_JPN_FINAL
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
g_ModelStates[MODEL_JPNLOGO].filedata = modeldefLoad(g_ModelStates[MODEL_JPNLOGO].fileid, nextaddr, remaining, 0);
|
||||
g_ModelStates[MODEL_JPNLOGO].modeldef = modeldefLoad(g_ModelStates[MODEL_JPNLOGO].fileid, nextaddr, remaining, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_JPNLOGO].fileid));
|
||||
nextaddr += size;
|
||||
remaining -= size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_JPNLOGO].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_JPNLOGO].modeldef);
|
||||
|
||||
g_TitleModelJpnLogo1 = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNLOGO].filedata);
|
||||
g_TitleModelJpnLogo2 = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNLOGO].filedata);
|
||||
g_TitleModelJpnLogo1 = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNLOGO].modeldef);
|
||||
g_TitleModelJpnLogo2 = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNLOGO].modeldef);
|
||||
modelSetScale(g_TitleModelJpnLogo1, 1);
|
||||
modelSetScale(g_TitleModelJpnLogo2, 1);
|
||||
modelSetRootPosition(g_TitleModelJpnLogo1, &coord);
|
||||
modelSetRootPosition(g_TitleModelJpnLogo2, &coord);
|
||||
|
||||
g_ModelStates[MODEL_JPNPD].filedata = modeldefLoad(g_ModelStates[MODEL_JPNPD].fileid, nextaddr, remaining, 0);
|
||||
g_ModelStates[MODEL_JPNPD].modeldef = modeldefLoad(g_ModelStates[MODEL_JPNPD].fileid, nextaddr, remaining, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_JPNPD].fileid));
|
||||
nextaddr += size;
|
||||
remaining -= size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_JPNPD].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_JPNPD].modeldef);
|
||||
|
||||
g_TitleModelJpnPd = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNPD].filedata);
|
||||
g_TitleModelJpnPd = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_JPNPD].modeldef);
|
||||
modelSetScale(g_TitleModelJpnPd, 1);
|
||||
modelSetRootPosition(g_TitleModelJpnPd, &coord);
|
||||
}
|
||||
@@ -623,19 +623,19 @@ void titleInitPdLogo(void)
|
||||
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
g_ModelStates[MODEL_PDTHREE].filedata = modeldefLoad(g_ModelStates[MODEL_PDTHREE].fileid, nextaddr, remaining, 0);
|
||||
g_ModelStates[MODEL_PDTHREE].modeldef = modeldefLoad(g_ModelStates[MODEL_PDTHREE].fileid, nextaddr, remaining, 0);
|
||||
size = ALIGN64(fileGetLoadedSize(g_ModelStates[MODEL_PDTHREE].fileid));
|
||||
nextaddr += size;
|
||||
remaining -= size;
|
||||
modelAllocateRwData(g_ModelStates[MODEL_PDTHREE].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_PDTHREE].modeldef);
|
||||
|
||||
g_TitleModelPdThree = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_PDTHREE].filedata);
|
||||
g_TitleModelPdThree = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_PDTHREE].modeldef);
|
||||
modelSetScale(g_TitleModelPdThree, 1);
|
||||
modelSetRootPosition(g_TitleModelPdThree, &coord);
|
||||
}
|
||||
|
||||
{
|
||||
struct modelrodata_dl *rodata = (struct modelrodata_dl *)modelGetPartRodata(g_ModelStates[MODEL_PDTWO].filedata, MODELPART_LOGO_0002);
|
||||
struct modelrodata_dl *rodata = (struct modelrodata_dl *)modelGetPartRodata(g_ModelStates[MODEL_PDTWO].modeldef, MODELPART_LOGO_0002);
|
||||
|
||||
size = ALIGN8(rodata->numvertices * sizeof(struct gfxvtx));
|
||||
|
||||
@@ -760,10 +760,10 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
||||
struct colour *s2;
|
||||
Mtxf sp6c;
|
||||
|
||||
tmp = modelGetNodeRwData(model, modelGetPart(model->filedata, MODELPART_LOGO_0000));
|
||||
tmp = modelGetNodeRwData(model, modelGetPart(model->definition, MODELPART_LOGO_0000));
|
||||
tmp->toggle.visible = arg2;
|
||||
|
||||
tmp = modelGetNodeRwData(model, modelGetPart(model->filedata, MODELPART_LOGO_0001));
|
||||
tmp = modelGetNodeRwData(model, modelGetPart(model->definition, MODELPART_LOGO_0001));
|
||||
tmp->toggle.visible = !arg2;
|
||||
|
||||
s6 = arg3 * 65536.0f;
|
||||
@@ -804,17 +804,17 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (i == 0) {
|
||||
node1 = modelGetPart(model->filedata, MODELPART_LOGO_0002);
|
||||
node2 = modelGetPart(model->filedata, MODELPART_LOGO_0003);
|
||||
node1 = modelGetPart(model->definition, MODELPART_LOGO_0002);
|
||||
node2 = modelGetPart(model->definition, MODELPART_LOGO_0003);
|
||||
} else if (i == 1) {
|
||||
node1 = modelGetPart(model->filedata, MODELPART_LOGO_0004);
|
||||
node2 = modelGetPart(model->filedata, MODELPART_LOGO_0005);
|
||||
node1 = modelGetPart(model->definition, MODELPART_LOGO_0004);
|
||||
node2 = modelGetPart(model->definition, MODELPART_LOGO_0005);
|
||||
} else if (i == 2) {
|
||||
node1 = modelGetPart(model->filedata, MODELPART_LOGO_0006);
|
||||
node2 = modelGetPart(model->filedata, MODELPART_LOGO_0007);
|
||||
node1 = modelGetPart(model->definition, MODELPART_LOGO_0006);
|
||||
node2 = modelGetPart(model->definition, MODELPART_LOGO_0007);
|
||||
} else {
|
||||
node1 = modelGetPart(model->filedata, MODELPART_LOGO_0008);
|
||||
node2 = modelGetPart(model->filedata, MODELPART_LOGO_0009);
|
||||
node1 = modelGetPart(model->definition, MODELPART_LOGO_0008);
|
||||
node2 = modelGetPart(model->definition, MODELPART_LOGO_0009);
|
||||
}
|
||||
|
||||
if (node1 && node2) {
|
||||
@@ -880,7 +880,7 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
||||
gDPSetPrimColor(gdl++, 0, 0, 0x00, 0x00, 0x00, alpha1);
|
||||
|
||||
renderdata.unk00 = arg6;
|
||||
renderdata.unk10 = gfxAllocate(model->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(model->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
mtx4Copy(arg6, renderdata.unk10);
|
||||
|
||||
@@ -896,7 +896,7 @@ Gfx *titleRenderPdLogoModel(Gfx *gdl, struct model *model, bool arg2, f32 arg3,
|
||||
|
||||
gdl = renderdata.gdl;
|
||||
|
||||
for (j = 0, k = 0; j < model->filedata->nummatrices; j++, k += sizeof(Mtxf)) {
|
||||
for (j = 0, k = 0; j < model->definition->nummatrices; j++, k += sizeof(Mtxf)) {
|
||||
mtx4Copy((Mtxf *)((u32)model->matrices + k), &sp6c);
|
||||
mtxF2L(&sp6c, model->matrices + j);
|
||||
}
|
||||
@@ -7445,7 +7445,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
numvertices = 0;
|
||||
numcolours = 0;
|
||||
|
||||
node = modelGetPart(model->filedata, MODELPART_LOGO_0002);
|
||||
node = modelGetPart(model->definition, MODELPART_LOGO_0002);
|
||||
|
||||
if (node) {
|
||||
Gfx *tmp;
|
||||
@@ -7461,7 +7461,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
gSPBranchList(tmp++, rodata->primary);
|
||||
}
|
||||
|
||||
node = modelGetPart(model->filedata, MODELPART_LOGO_0004);
|
||||
node = modelGetPart(model->definition, MODELPART_LOGO_0004);
|
||||
|
||||
if (node) {
|
||||
Gfx *tmp;
|
||||
@@ -7481,7 +7481,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
}
|
||||
}
|
||||
|
||||
node = modelGetPart(model->filedata, MODELPART_LOGO_0006);
|
||||
node = modelGetPart(model->definition, MODELPART_LOGO_0006);
|
||||
|
||||
if (node) {
|
||||
Gfx *tmp;
|
||||
@@ -7501,7 +7501,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
}
|
||||
}
|
||||
|
||||
node = modelGetPart(model->filedata, MODELPART_LOGO_0008);
|
||||
node = modelGetPart(model->definition, MODELPART_LOGO_0008);
|
||||
|
||||
if (node) {
|
||||
Gfx *tmp;
|
||||
@@ -7566,7 +7566,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
mtx4Copy(&sp1b0, &sp2b0);
|
||||
|
||||
renderdata.unk00 = &sp2b0;
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnLogo2->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnLogo2->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
mtx4Copy(&sp2b0, renderdata.unk10);
|
||||
|
||||
@@ -7587,7 +7587,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
{
|
||||
s32 j;
|
||||
|
||||
for (sp19c = 0, j = 0; sp19c < g_TitleModelJpnLogo2->filedata->nummatrices; sp19c++, j += sizeof(Mtxf)) {
|
||||
for (sp19c = 0, j = 0; sp19c < g_TitleModelJpnLogo2->definition->nummatrices; sp19c++, j += sizeof(Mtxf)) {
|
||||
mtx4Copy((Mtxf *)((u32)g_TitleModelJpnLogo2->matrices + j), &sp158);
|
||||
mtxF2L(&sp158, g_TitleModelJpnLogo2->matrices + sp19c);
|
||||
}
|
||||
@@ -7624,7 +7624,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
|
||||
renderdata.unk00 = &sp230;
|
||||
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnPd->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnPd->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
mtx4Copy(&sp230, renderdata.unk10);
|
||||
|
||||
@@ -7648,7 +7648,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
{
|
||||
s32 j;
|
||||
|
||||
for (sp14c = 0, j = 0; sp14c < g_TitleModelJpnPd->filedata->nummatrices; sp14c++, j += sizeof(Mtxf)) {
|
||||
for (sp14c = 0, j = 0; sp14c < g_TitleModelJpnPd->definition->nummatrices; sp14c++, j += sizeof(Mtxf)) {
|
||||
mtx4Copy((Mtxf *)((u32)g_TitleModelJpnPd->matrices + j), &spf4);
|
||||
mtxF2L(&spf4, g_TitleModelJpnPd->matrices + sp14c);
|
||||
}
|
||||
@@ -7661,7 +7661,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
mtx4Copy(&spb0, &sp2b0);
|
||||
|
||||
renderdata.unk00 = &sp2b0;
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnLogo1->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModelJpnLogo1->definition->nummatrices * sizeof(Mtxf));
|
||||
|
||||
mtx4Copy(&sp2b0, renderdata.unk10);
|
||||
|
||||
@@ -7682,7 +7682,7 @@ Gfx *titleRenderPdLogo(Gfx *gdl)
|
||||
{
|
||||
s32 j;
|
||||
|
||||
for (sp9c = 0, j = 0; sp9c < g_TitleModelJpnLogo1->filedata->nummatrices; sp9c++, j += sizeof(Mtxf)) {
|
||||
for (sp9c = 0, j = 0; sp9c < g_TitleModelJpnLogo1->definition->nummatrices; sp9c++, j += sizeof(Mtxf)) {
|
||||
mtx4Copy((Mtxf *)((u32)g_TitleModelJpnLogo1->matrices + j), &sp5c);
|
||||
mtxF2L(&sp5c, g_TitleModelJpnLogo1->matrices + sp9c);
|
||||
}
|
||||
@@ -7867,10 +7867,10 @@ void titleInitNintendoLogo(void)
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
|
||||
g_ModelStates[MODEL_NINTENDOLOGO].filedata = modeldefLoad(g_ModelStates[MODEL_NINTENDOLOGO].fileid, nextaddr, 0x47800, 0);
|
||||
g_ModelStates[MODEL_NINTENDOLOGO].modeldef = modeldefLoad(g_ModelStates[MODEL_NINTENDOLOGO].fileid, nextaddr, 0x47800, 0);
|
||||
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NINTENDOLOGO].filedata);
|
||||
g_TitleModel = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_NINTENDOLOGO].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_NINTENDOLOGO].modeldef);
|
||||
g_TitleModel = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_NINTENDOLOGO].modeldef);
|
||||
modelSetScale(g_TitleModel, 1);
|
||||
modelSetRootPosition(g_TitleModel, &coord);
|
||||
var800624f4 = 1;
|
||||
@@ -7994,7 +7994,7 @@ Gfx *titleRenderNintendoLogo(Gfx *gdl)
|
||||
mtx4Copy(&spa8, &sp108);
|
||||
renderdata.unk00 = &sp108;
|
||||
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModel->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModel->definition->nummatrices * sizeof(Mtxf));
|
||||
mtx4Copy(&sp108, renderdata.unk10);
|
||||
g_TitleModel->matrices = renderdata.unk10;
|
||||
|
||||
@@ -8008,7 +8008,7 @@ Gfx *titleRenderNintendoLogo(Gfx *gdl)
|
||||
|
||||
gdl = renderdata.gdl;
|
||||
|
||||
for (i = 0, j = 0; i < g_TitleModel->filedata->nummatrices; i++, j += sizeof(Mtxf)) {
|
||||
for (i = 0, j = 0; i < g_TitleModel->definition->nummatrices; i++, j += sizeof(Mtxf)) {
|
||||
mtx4Copy((Mtxf *)((u32)g_TitleModel->matrices + j), &sp54);
|
||||
mtxF2L(&sp54, g_TitleModel->matrices + i);
|
||||
}
|
||||
@@ -8026,10 +8026,10 @@ void titleInitRareLogo(void)
|
||||
{
|
||||
struct coord coord = {0, 0, 0};
|
||||
|
||||
g_ModelStates[MODEL_RARELOGO].filedata = modeldefLoad(g_ModelStates[MODEL_RARELOGO].fileid, nextaddr, 0x47800, 0);
|
||||
g_ModelStates[MODEL_RARELOGO].modeldef = modeldefLoad(g_ModelStates[MODEL_RARELOGO].fileid, nextaddr, 0x47800, 0);
|
||||
|
||||
modelAllocateRwData(g_ModelStates[MODEL_RARELOGO].filedata);
|
||||
g_TitleModel = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_RARELOGO].filedata);
|
||||
modelAllocateRwData(g_ModelStates[MODEL_RARELOGO].modeldef);
|
||||
g_TitleModel = modelmgrInstantiateModelWithoutAnim(g_ModelStates[MODEL_RARELOGO].modeldef);
|
||||
modelSetScale(g_TitleModel, 1);
|
||||
modelSetRootPosition(g_TitleModel, &coord);
|
||||
|
||||
@@ -8191,26 +8191,26 @@ Gfx *titleRenderRareLogo(Gfx *gdl)
|
||||
mtx4Copy(&spc0, &sp118);
|
||||
|
||||
renderdata.unk00 = &sp118;
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModel->filedata->nummatrices * sizeof(Mtxf));
|
||||
renderdata.unk10 = gfxAllocate(g_TitleModel->definition->nummatrices * sizeof(Mtxf));
|
||||
mtx4Copy(&sp118, renderdata.unk10);
|
||||
|
||||
g_TitleModel->matrices = renderdata.unk10;
|
||||
|
||||
modelUpdateRelations(g_TitleModel);
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000B));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000B));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = false;
|
||||
}
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000D));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000D));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = true;
|
||||
}
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000C));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000C));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = false;
|
||||
@@ -8226,19 +8226,19 @@ Gfx *titleRenderRareLogo(Gfx *gdl)
|
||||
|
||||
gdl = renderdata.gdl;
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000B));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000B));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = true;
|
||||
}
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000D));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000D));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = false;
|
||||
}
|
||||
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->filedata, MODELPART_RARELOGO_000C));
|
||||
rwdata = modelGetNodeRwData(g_TitleModel, modelGetPart(g_TitleModel->definition, MODELPART_RARELOGO_000C));
|
||||
|
||||
if (rwdata) {
|
||||
rwdata->visible = true;
|
||||
@@ -8254,7 +8254,7 @@ Gfx *titleRenderRareLogo(Gfx *gdl)
|
||||
|
||||
gdl = renderdata.gdl;
|
||||
|
||||
for (i = 0, j = 0; i < g_TitleModel->filedata->nummatrices; i++, j += sizeof(Mtxf)) {
|
||||
for (i = 0, j = 0; i < g_TitleModel->definition->nummatrices; i++, j += sizeof(Mtxf)) {
|
||||
Mtxf sp58;
|
||||
mtx4Copy((Mtxf *)((u32)g_TitleModel->matrices + j), &sp58);
|
||||
mtxF2L(&sp58, g_TitleModel->matrices + i);
|
||||
|
||||
+2
-2
@@ -55,8 +55,8 @@ void vtxstoreFixRefs(union modelrwdata *find, union modelrwdata *replacement)
|
||||
if (prop->type == PROPTYPE_OBJ) {
|
||||
struct defaultobj *obj = prop->obj;
|
||||
struct model *model = obj->model;
|
||||
struct modelfiledata *filedata = model->filedata;
|
||||
struct modelnode *node = filedata->rootnode;
|
||||
struct modeldef *modeldef = model->definition;
|
||||
struct modelnode *node = modeldef->rootnode;
|
||||
struct modelrodata_dl *rodata;
|
||||
|
||||
while (node) {
|
||||
|
||||
+1
-1
@@ -349,7 +349,7 @@ extern s8 g_PropExplosionTypes[];
|
||||
extern struct skeleton g_SkelBasic;
|
||||
extern struct skeleton g_SkelChrGun;
|
||||
extern struct skeleton g_Skel0B;
|
||||
extern struct modelfiledata g_PlayerModelFileData;
|
||||
extern struct modeldef g_PlayerModeldef;
|
||||
extern struct skeleton g_Skel0A;
|
||||
extern struct skeleton g_Skel20;
|
||||
extern struct skeleton g_SkelClassicGun;
|
||||
|
||||
@@ -10,13 +10,13 @@ void bodiesReset(s32 stagenum);
|
||||
|
||||
u32 bodyGetRace(s32 bodynum);
|
||||
bool bodyLoad(s32 bodynum);
|
||||
struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyfiledata, struct modelfiledata *headfiledata, bool sunglasses, struct model *model, bool isplayer, u8 varyheight);
|
||||
struct model *body0f02d338(s32 bodynum, s32 headnum, struct modelfiledata *bodyfiledata, struct modelfiledata *headfiledata, bool sunglasses, u8 varyheight);
|
||||
struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modeldef *bodymodeldef, struct modeldef *headmodeldef, bool sunglasses, struct model *model, bool isplayer, u8 varyheight);
|
||||
struct model *body0f02d338(s32 bodynum, s32 headnum, struct modeldef *bodymodeldef, struct modeldef *headmodeldef, bool sunglasses, u8 varyheight);
|
||||
struct model *bodyAllocateModel(s32 bodynum, s32 headnum, u32 spawnflags);
|
||||
s32 body0f02d3f8(void);
|
||||
s32 bodyChooseHead(s32 bodynum);
|
||||
void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex);
|
||||
struct prop *bodyAllocateEyespy(struct pad *pad, s16 room);
|
||||
void bodyCalculateHeadOffset(struct modelfiledata *headfiledata, s32 headnum, s32 bodynum);
|
||||
void bodyCalculateHeadOffset(struct modeldef *headmodeldef, s32 headnum, s32 bodynum);
|
||||
|
||||
#endif
|
||||
|
||||
+15
-15
@@ -12,11 +12,11 @@ void bgunRumble(s32 handnum, s32 weaponnum);
|
||||
s32 bgunGetUnequippedReloadIndex(s32 weaponnum);
|
||||
void bgunTickUnequippedReload(void);
|
||||
bool bgunTestGunVisCommand(struct gunviscmd *cmd, struct hand *hand);
|
||||
void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct modelfiledata *filedata);
|
||||
void bgunExecuteGunVisCommands(struct hand *hand, struct modelfiledata *arg1, struct gunviscmd *command);
|
||||
void bgun0f098030(struct hand *hand, struct modelfiledata *arg1);
|
||||
void bgunSetPartVisible(s16 partnum, bool visible, struct hand *hand, struct modeldef *modeldef);
|
||||
void bgunExecuteGunVisCommands(struct hand *hand, struct modeldef *arg1, struct gunviscmd *command);
|
||||
void bgun0f098030(struct hand *hand, struct modeldef *arg1);
|
||||
f32 bgun0f09815c(struct hand *hand);
|
||||
void bgun0f0981e8(struct hand *hand, struct modelfiledata *modeldef);
|
||||
void bgun0f0981e8(struct hand *hand, struct modeldef *modeldef);
|
||||
bool bgun0f098884(struct guncmd *cmd, struct gset *gset);
|
||||
void bgunStartAnimation(struct guncmd *cmd, s32 handnum, struct hand *hand);
|
||||
bool bgun0f098a44(struct hand *hand, s32 time);
|
||||
@@ -72,7 +72,7 @@ void bgunTickGunLoad(void);
|
||||
void bgunTickMasterLoad(void);
|
||||
void bgunTickLoad(void);
|
||||
bool bgun0f09eae4(void);
|
||||
struct modelfiledata *bgunGetCartModeldef(void);
|
||||
struct modeldef *bgunGetCartModeldef(void);
|
||||
void bgun0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, struct coord *velocity, Mtxf *matrix2, struct prop *prop, struct coord *pos);
|
||||
void bgun0f09ed2c(struct defaultobj *obj, struct coord *coord, Mtxf *arg2, struct coord *velocity, Mtxf *arg4);
|
||||
struct defaultobj *bgunCreateThrownProjectile2(struct chrdata *chr, struct gset *gset, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *velocity);
|
||||
@@ -123,18 +123,18 @@ s32 bgunCreateModelCmdList(struct model *model, struct modelnode *node, s32 *ptr
|
||||
void bgunStartDetonateAnimation(s32 playernum);
|
||||
void bgunUpdateGangsta(struct hand *hand, s32 handnum, struct coord *arg2, struct weaponfunc *funcdef, Mtxf *arg4, Mtxf *arg5);
|
||||
void bgunUpdateSmoke(struct hand *hand, s32 handnum, s32 weaponnum, struct weaponfunc *funcdef);
|
||||
void bgunUpdateLasersight(struct hand *hand, struct modelfiledata *modeldef, s32 handnum, u8 *allocation);
|
||||
void bgunUpdateReaper(struct hand *hand, struct modelfiledata *modeldef);
|
||||
void bgunUpdateSniperRifle(struct modelfiledata *modeldef, u8 *allocation);
|
||||
void bgunUpdateDevastator(struct hand *hand, u8 *allocation, struct modelfiledata *modeldef);
|
||||
void bgunUpdateShotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modelfiledata *modeldef);
|
||||
void bgunUpdateLasersight(struct hand *hand, struct modeldef *modeldef, s32 handnum, u8 *allocation);
|
||||
void bgunUpdateReaper(struct hand *hand, struct modeldef *modeldef);
|
||||
void bgunUpdateSniperRifle(struct modeldef *modeldef, u8 *allocation);
|
||||
void bgunUpdateDevastator(struct hand *hand, u8 *allocation, struct modeldef *modeldef);
|
||||
void bgunUpdateShotgun(struct hand *hand, u8 *allocation, bool *arg2, struct modeldef *modeldef);
|
||||
void bgunUpdateLaser(struct hand *hand);
|
||||
void bgunUpdateMagnum(struct hand *hand, s32 handnum, struct modelfiledata *modeldef, Mtxf *mtx);
|
||||
void bgunUpdateMagnum(struct hand *hand, s32 handnum, struct modeldef *modeldef, Mtxf *mtx);
|
||||
void bgunUpdateRocketLauncher(struct hand *hand, s32 handnum, struct weaponfunc_shootprojectile *func);
|
||||
void bgun0f0a45d0(struct hand *hand, struct modelfiledata *modeldef, bool isdetonator);
|
||||
void bgunTickEject(struct hand *hand, struct modelfiledata *modeldef, bool isdetonator);
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modelfiledata *modeldef, struct weaponfunc *funcdef, s32 maxburst, u8 *allocation, s32 weaponnum, bool **arg7, s32 mtxindex, Mtxf *arg9, Mtxf *arg10);
|
||||
void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s32 weaponnum, struct modelfiledata *modeldef, u8 *allocation);
|
||||
void bgun0f0a45d0(struct hand *hand, struct modeldef *modeldef, bool isdetonator);
|
||||
void bgunTickEject(struct hand *hand, struct modeldef *modeldef, bool isdetonator);
|
||||
void bgun0f0a4e44(struct hand *hand, struct weapon *weapondef, struct modeldef *modeldef, struct weaponfunc *funcdef, s32 maxburst, u8 *allocation, s32 weaponnum, bool **arg7, s32 mtxindex, Mtxf *arg9, Mtxf *arg10);
|
||||
void bgunCreateFx(struct hand *hand, s32 handnum, struct weaponfunc *funcdef, s32 weaponnum, struct modeldef *modeldef, u8 *allocation);
|
||||
void bgun0f0a5550(s32 handnum);
|
||||
void bgunTickMaulerCharge(void);
|
||||
void bgunTickGameplay2(void);
|
||||
|
||||
@@ -13,7 +13,7 @@ Gfx *beamRenderGeneric(Gfx *gdl, struct textureconfig *arg1, f32 arg2, struct co
|
||||
Gfx *beamRender(Gfx *gdl, struct beam *beam, bool arg2, u8 arg3);
|
||||
void beamTick(struct beam *beam);
|
||||
|
||||
struct casing *casingCreate(struct modelfiledata *modeldef, Mtxf *mtx);
|
||||
struct casing *casingCreate(struct modeldef *modeldef, Mtxf *mtx);
|
||||
void casingCreateForHand(s32 handnum, f32 ground, Mtxf *mtx);
|
||||
void casingRender(struct casing *casing, Gfx **gdlptr);
|
||||
void casingsRender(Gfx **gdlptr);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
void modeldef0f1a7560(struct modelfiledata *modeldef, u16 filenum, u32 arg2, struct modelfiledata *modeldef2, struct texpool *texpool, bool arg5);
|
||||
void modelPromoteTypeToPointer(struct modelfiledata *filedata);
|
||||
struct modelfiledata *modeldefLoad(u16 fileid, u8 *arg1, s32 arg2, struct texpool *arg3);
|
||||
struct modelfiledata *modeldefLoadToNew(u16 fileid);
|
||||
void modeldef0f1a7560(struct modeldef *modeldef, u16 filenum, u32 arg2, struct modeldef *modeldef2, struct texpool *texpool, bool arg5);
|
||||
void modelPromoteTypeToPointer(struct modeldef *modeldef);
|
||||
struct modeldef *modeldefLoad(u16 fileid, u8 *arg1, s32 arg2, struct texpool *arg3);
|
||||
struct modeldef *modeldefLoadToNew(u16 fileid);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
bool modelmgrCanSlotFitRwdata(struct model *modelslot, struct modelfiledata *filedata);
|
||||
bool modelmgrCanSlotFitRwdata(struct model *modelslot, struct modeldef *modeldef);
|
||||
void modelmgrPrintCounts(void);
|
||||
struct model *modelmgrInstantiateModel(struct modelfiledata *modelfiledata, bool arg1);
|
||||
struct model *modelmgrInstantiateModelWithoutAnim(struct modelfiledata *modelfiledata);
|
||||
struct model *modelmgrInstantiateModel(struct modeldef *modeldef, bool arg1);
|
||||
struct model *modelmgrInstantiateModelWithoutAnim(struct modeldef *modeldef);
|
||||
void modelmgrFreeModel(struct model *model);
|
||||
struct model *modelmgrInstantiateModelWithAnim(struct modelfiledata *modelfiledata);
|
||||
void modelmgrAttachHead(struct model *model, struct modelnode *node, struct modelfiledata *headfiledata);
|
||||
struct model *modelmgrInstantiateModelWithAnim(struct modeldef *modeldef);
|
||||
void modelmgrAttachHead(struct model *model, struct modelnode *node, struct modeldef *headmodeldef);
|
||||
struct anim *modelmgrInstantiateAnim(void);
|
||||
void modelmgrFreeAnim(struct anim *anim);
|
||||
|
||||
|
||||
@@ -118,6 +118,6 @@ void mpsetupfileGetOverview(char *arg0, char *filename, u16 *numsims, u16 *stage
|
||||
s32 mpsetupfileSave(s32 device, s32 filenum, u16 deviceserial);
|
||||
s32 mpsetupfileLoad(s32 device, s32 filenum, u16 deviceserial);
|
||||
void func0f18e558(void);
|
||||
struct modelfiledata *func0f18e57c(s32 index, s32 *headnum);
|
||||
struct modeldef *func0f18e57c(s32 index, s32 *headnum);
|
||||
|
||||
#endif
|
||||
|
||||
+12
-12
@@ -76,8 +76,8 @@ struct embedment *embedmentAllocate(void);
|
||||
s32 objGetShotsTaken(struct defaultobj *obj);
|
||||
s32 objGetDestroyedLevel(struct defaultobj *obj);
|
||||
struct modelnode *func0f0687e4(struct model *model);
|
||||
struct modelnode *modelFileDataFindBboxNode(struct modelfiledata *filedata);
|
||||
struct modelrodata_bbox *modelFileDataFindBboxRodata(struct modelfiledata *filedata);
|
||||
struct modelnode *modeldefFindBboxNode(struct modeldef *modeldef);
|
||||
struct modelrodata_bbox *modeldefFindBboxRodata(struct modeldef *modeldef);
|
||||
struct modelnode *modelFindBboxNode(struct model *model);
|
||||
struct modelrodata_bbox *modelFindBboxRodata(struct model *model);
|
||||
struct modelnode *objFindBboxNode(struct defaultobj *obj);
|
||||
@@ -96,8 +96,8 @@ void func0f069c70(struct defaultobj *obj, bool arg1, bool arg2);
|
||||
void objInitToggleNodes(struct defaultobj *obj);
|
||||
void objCreateOneDebris(struct defaultobj *obj, s32 partindex, struct prop *prop);
|
||||
void objCreateDebris(struct defaultobj *obj, struct prop *prop);
|
||||
struct prop *objInit(struct defaultobj *obj, struct modelfiledata *filedata, struct prop *prop, struct model *model);
|
||||
struct prop *objInitWithModelDef(struct defaultobj *obj, struct modelfiledata *modelfiledata);
|
||||
struct prop *objInit(struct defaultobj *obj, struct modeldef *modeldef, struct prop *prop, struct model *model);
|
||||
struct prop *objInitWithModelDef(struct defaultobj *obj, struct modeldef *modeldef);
|
||||
struct prop *objInitWithAutoModel(struct defaultobj *obj);
|
||||
void func0f06a580(struct defaultobj *obj, struct coord *pos, Mtxf *matrix, s16 *rooms);
|
||||
f32 func0f06a620(struct defaultobj *obj);
|
||||
@@ -210,7 +210,7 @@ void objRenderProp(struct prop *prop, struct modelrenderdata *renderdata, bool x
|
||||
Gfx *gfxRenderRadialShadow(Gfx *gdl, f32 x, f32 y, f32 z, f32 angle, f32 radius, u32 colour);
|
||||
Gfx *objRenderShadow(struct defaultobj *obj, Gfx *gdl);
|
||||
Gfx *objRender(struct prop *prop, Gfx *gdl, bool xlupass);
|
||||
bool modelIsNodeNotTvscreen(struct modelfiledata *filedata, struct modelnode *node);
|
||||
bool modelIsNodeNotTvscreen(struct modeldef *modeldef, struct modelnode *node);
|
||||
void objDeform(struct defaultobj *obj, s32 level);
|
||||
void objBounce(struct defaultobj *obj, struct coord *arg1);
|
||||
void objSetDropped(struct prop *prop, u32 droptype);
|
||||
@@ -261,12 +261,12 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg);
|
||||
s32 objTestForPickup(struct prop *prop);
|
||||
bool func0f0899dc(struct prop *prop, struct coord *arg1, f32 *arg2, f32 *arg3);
|
||||
void modelFreeVertices(s32 vtxstoretype, struct model *model);
|
||||
struct prop *hatApplyToChr(struct hatobj *hat, struct chrdata *chr, struct modelfiledata *filedata, struct prop *prop, struct model *model);
|
||||
struct prop *hatApplyToChr(struct hatobj *hat, struct chrdata *chr, struct modeldef *modeldef, struct prop *prop, struct model *model);
|
||||
void hatLoadAndApplyToChr(struct hatobj *hat, struct chrdata *chr);
|
||||
void hatAssignToChr(struct hatobj *hat, struct chrdata *chr);
|
||||
struct prop *hatCreateForChr(struct chrdata *chr, s32 modelnum, u32 flags);
|
||||
struct weaponobj *weaponCreate(bool musthaveprop, bool musthavemodel, struct modelfiledata *filedata);
|
||||
struct hatobj *hatCreate(bool musthaveprop, bool musthavemodel, struct modelfiledata *filedata);
|
||||
struct weaponobj *weaponCreate(bool musthaveprop, bool musthavemodel, struct modeldef *modeldef);
|
||||
struct hatobj *hatCreate(bool musthaveprop, bool musthavemodel, struct modeldef *modeldef);
|
||||
struct ammocrateobj *ammocrateAllocate(void);
|
||||
struct defaultobj *debrisAllocate(void);
|
||||
void playerActivateRemoteMineDetonator(s32 playernum);
|
||||
@@ -277,17 +277,17 @@ void weaponUnregisterProxy(struct weaponobj *weapon);
|
||||
void coordTriggerProxies(struct coord *pos, bool arg1);
|
||||
void chrsTriggerProxies(void);
|
||||
void propweaponSetDual(struct weaponobj *weapon1, struct weaponobj *weapon2);
|
||||
struct prop *func0f08adc8(struct weaponobj *weapon, struct modelfiledata *filedata, struct prop *prop, struct model *model);
|
||||
struct prop *func0f08ae0c(struct weaponobj *weapon, struct modelfiledata *filedata);
|
||||
struct prop *func0f08adc8(struct weaponobj *weapon, struct modeldef *modeldef, struct prop *prop, struct model *model);
|
||||
struct prop *func0f08ae0c(struct weaponobj *weapon, struct modeldef *modeldef);
|
||||
bool chrEquipWeapon(struct weaponobj *weapon, struct chrdata *chr);
|
||||
struct prop *func0f08b108(struct weaponobj *weapon, struct chrdata *chr, struct modelfiledata *modelfiledata, struct prop *prop, struct model *model);
|
||||
struct prop *func0f08b108(struct weaponobj *weapon, struct chrdata *chr, struct modeldef *modeldef, struct prop *prop, struct model *model);
|
||||
void func0f08b208(struct weaponobj *weapon, struct chrdata *chr);
|
||||
void func0f08b25c(struct weaponobj *weapon, struct chrdata *chr);
|
||||
struct autogunobj *laptopDeploy(s32 modelnum, struct gset *gset, struct chrdata *chr);
|
||||
struct weaponobj *weaponCreateProjectileFromGset(s32 modelnum, struct gset *gset, struct chrdata *chr);
|
||||
struct weaponobj *weaponCreateProjectileFromWeaponNum(s32 modelnum, s32 weaponnum, struct chrdata *chr);
|
||||
void weaponDeleteFromChr(struct chrdata *chr, s32 hand);
|
||||
struct prop *weaponCreateForChr(struct chrdata *chr, s32 modelnum, s32 weaponnum, u32 flags, struct weaponobj *obj, struct modelfiledata *filedata);
|
||||
struct prop *weaponCreateForChr(struct chrdata *chr, s32 modelnum, s32 weaponnum, u32 flags, struct weaponobj *obj, struct modeldef *modeldef);
|
||||
struct prop *chrGiveWeapon(struct chrdata *chr, s32 model, s32 weaponnum, u32 flags);
|
||||
s32 weaponTestForPickup(struct prop *prop);
|
||||
void weaponSetGunfireVisible(struct prop *prop, bool visible, s16 room);
|
||||
|
||||
@@ -14,6 +14,6 @@ bool setup0f092304(struct defaultobj *obj, struct coord *arg1, struct coord *arg
|
||||
void setup0f09233c(struct defaultobj *obj, struct coord *pos, f32 realrot[3][3], s16 *rooms);
|
||||
void setup0f0923d4(struct defaultobj *obj);
|
||||
struct defaultobj *setupGetObjByCmdIndex(u32 cmdindex);
|
||||
struct defaultobj *setupFindObjForReuse(s32 type, struct defaultobj **arg1, struct defaultobj **arg2, bool musthaveprop, bool musthavemodel, struct modelfiledata *filedata);
|
||||
struct defaultobj *setupFindObjForReuse(s32 type, struct defaultobj **arg1, struct defaultobj **arg2, bool musthaveprop, bool musthavemodel, struct modeldef *modeldef);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,8 +19,8 @@ struct modelnode *modelNodeFindMtxNode(struct modelnode *node);
|
||||
struct modelnode *modelNodeFindParentMtxNode(struct modelnode *node);
|
||||
struct modelnode *modelNodeFindChildMtxNode(struct modelnode *node);
|
||||
struct modelnode *modelNodeFindChildOrParentMtxNode(struct modelnode *node);
|
||||
struct modelnode *modelGetPart(struct modelfiledata *arg0, s32 partnum);
|
||||
void *modelGetPartRodata(struct modelfiledata *modelfiledata, s32 partnum);
|
||||
struct modelnode *modelGetPart(struct modeldef *arg0, s32 partnum);
|
||||
void *modelGetPartRodata(struct modeldef *modeldef, s32 partnum);
|
||||
f32 modelGetScreenDistance(struct model *model);
|
||||
void *modelGetNodeRwData(struct model *model, struct modelnode *node);
|
||||
void modelNodeGetPosition(struct model *model, struct modelnode *node, struct coord *pos);
|
||||
@@ -97,14 +97,14 @@ void modelRender(struct modelrenderdata *renderdata, struct model *model);
|
||||
bool modelTestBboxNodeForHit(struct modelrodata_bbox *bbox, Mtxf *mtx, struct coord *arg2, struct coord *arg3);
|
||||
s32 modelTestForHit(struct model *model, struct coord *arg1, struct coord *arg2, struct modelnode **startnode);
|
||||
void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, u32 fileramaddr);
|
||||
void modelPromoteOffsetsToPointers(struct modelfiledata *filedata, u32 arg1, u32 arg2);
|
||||
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 arg1, u32 arg2);
|
||||
s32 modelCalculateRwDataIndexes(struct modelnode *node);
|
||||
void modelAllocateRwData(struct modelfiledata *filedata);
|
||||
void modelAllocateRwData(struct modeldef *modeldef);
|
||||
void modelInitRwData(struct model *model, struct modelnode *node);
|
||||
void modelInit(struct model *model, struct modelfiledata *filedata, union modelrwdata **rwdatas, bool resetanim);
|
||||
void modelInit(struct model *model, struct modeldef *modeldef, union modelrwdata **rwdatas, bool resetanim);
|
||||
void animInit(struct anim *anim);
|
||||
void modelAttachHead(struct model *model, struct modelfiledata *arg1, struct modelnode *node, struct modelfiledata *arg3);
|
||||
void modelIterateDisplayLists(struct modelfiledata *filedata, struct modelnode **nodeptr, Gfx **gdlptr);
|
||||
void modelNodeReplaceGdl(struct modelfiledata *modeldef, struct modelnode *node, Gfx *find, Gfx *replacement);
|
||||
void modelAttachHead(struct model *model, struct modeldef *arg1, struct modelnode *node, struct modeldef *arg3);
|
||||
void modelIterateDisplayLists(struct modeldef *modeldef, struct modelnode **nodeptr, Gfx **gdlptr);
|
||||
void modelNodeReplaceGdl(struct modeldef *modeldef, struct modelnode *node, Gfx *find, Gfx *replacement);
|
||||
|
||||
#endif
|
||||
|
||||
+12
-12
@@ -574,7 +574,7 @@ struct modelnode {
|
||||
/*0x14*/ struct modelnode *child;
|
||||
};
|
||||
|
||||
struct modelfiledata {
|
||||
struct modeldef {
|
||||
struct modelnode *rootnode;
|
||||
struct skeleton *skel;
|
||||
|
||||
@@ -599,7 +599,7 @@ struct model {
|
||||
struct chrdata *chr;
|
||||
struct defaultobj *obj;
|
||||
};
|
||||
/*0x08*/ struct modelfiledata *filedata;
|
||||
/*0x08*/ struct modeldef *definition;
|
||||
/*0x0c*/ Mtxf *matrices;
|
||||
/*0x10*/ union modelrwdata **rwdatas;
|
||||
/*0x14*/ f32 scale;
|
||||
@@ -654,7 +654,7 @@ struct modelrwdata_toggle { // type 0x12
|
||||
};
|
||||
|
||||
struct modelrwdata_headspot { // type 0x17
|
||||
struct modelfiledata *headmodeldef;
|
||||
struct modeldef *headmodeldef;
|
||||
void *rwdatas;
|
||||
};
|
||||
|
||||
@@ -2331,9 +2331,9 @@ struct gunctrl {
|
||||
/*0x1584*/ s32 gunmemnew; // a weapon number, -1 when not changing guns
|
||||
/*0x1588*/ s32 gunmemtype; // also a weapon number
|
||||
/*0x158c*/ u8 *gunmem;
|
||||
/*0x1590*/ struct modelfiledata *gunmodeldef;
|
||||
/*0x1594*/ struct modelfiledata *handmodeldef;
|
||||
/*0x1598*/ struct modelfiledata *cartmodeldef;
|
||||
/*0x1590*/ struct modeldef *gunmodeldef;
|
||||
/*0x1594*/ struct modeldef *handmodeldef;
|
||||
/*0x1598*/ struct modeldef *cartmodeldef;
|
||||
/*0x159c*/ u16 handfilenum;
|
||||
/*0x15a0*/ u8 *unk15a0;
|
||||
/*0x15a4*/ s32 unk15a4;
|
||||
@@ -2342,7 +2342,7 @@ struct gunctrl {
|
||||
/*0x15b0*/ u8 masterloadstate;
|
||||
/*0x15b1*/ u8 gunloadstate;
|
||||
/*0x15b2*/ u16 loadfilenum;
|
||||
/*0x15b4*/ struct modelfiledata **loadtomodeldef;
|
||||
/*0x15b4*/ struct modeldef **loadtomodeldef;
|
||||
/*0x15b8*/ u32 *loadmemptr;
|
||||
/*0x15bc*/ u32 *loadmemremaining;
|
||||
/*0x15c0*/ struct texpool unk15c0;
|
||||
@@ -3067,7 +3067,7 @@ struct headorbody {
|
||||
/*0x02*/ u16 filenum;
|
||||
/*0x04*/ f32 scale;
|
||||
/*0x08*/ f32 animscale;
|
||||
/*0x0c*/ void *filedata;
|
||||
/*0x0c*/ struct modeldef *modeldef;
|
||||
/*0x10*/ u16 handfilenum;
|
||||
};
|
||||
|
||||
@@ -3826,8 +3826,8 @@ struct menu840 {
|
||||
/*0x00c*/ u32 unk00c;
|
||||
/*0x010*/ s32 unk010;
|
||||
/*0x014*/ Mtxf unk014;
|
||||
/*0x054*/ struct modelfiledata *bodymodeldef;
|
||||
/*0x058*/ struct modelfiledata *headmodeldef;
|
||||
/*0x054*/ struct modeldef *bodymodeldef;
|
||||
/*0x058*/ struct modeldef *headmodeldef;
|
||||
/*0x05c*/ s16 unk05c;
|
||||
/*0x05e*/ s16 unk05e;
|
||||
/*0x060*/ struct model bodymodel;
|
||||
@@ -4775,7 +4775,7 @@ struct chrnumaction {
|
||||
};
|
||||
|
||||
struct modelstate {
|
||||
struct modelfiledata *filedata;
|
||||
struct modeldef *modeldef;
|
||||
u16 fileid;
|
||||
u16 scale;
|
||||
};
|
||||
@@ -5398,7 +5398,7 @@ struct casing {
|
||||
/*0x10*/ struct coord speed;
|
||||
/*0x1c*/ s16 rot[3][3];
|
||||
/*0x28*/ s16 rotspeed[3][3];
|
||||
/*0x40*/ struct modelfiledata *modeldef;
|
||||
/*0x40*/ struct modeldef *modeldef;
|
||||
};
|
||||
|
||||
struct mplockinfo {
|
||||
|
||||
+60
-60
@@ -98,12 +98,12 @@ Mtxf *modelFindNodeMtx(struct model *model, struct modelnode *node, s32 arg2)
|
||||
|
||||
Mtxf *modelGetRootMtx(struct model *model)
|
||||
{
|
||||
return modelFindNodeMtx(model, model->filedata->rootnode, 0);
|
||||
return modelFindNodeMtx(model, model->definition->rootnode, 0);
|
||||
}
|
||||
|
||||
struct modelnode *modelFindNodeByMtxIndex(struct model *model, s32 mtxindex)
|
||||
{
|
||||
struct modelnode *node = model->filedata->rootnode;
|
||||
struct modelnode *node = model->definition->rootnode;
|
||||
union modelrodata *rodata1;
|
||||
union modelrodata *rodata2;
|
||||
union modelrodata *rodata3;
|
||||
@@ -263,26 +263,26 @@ struct modelnode *modelNodeFindChildOrParentMtxNode(struct modelnode *basenode)
|
||||
return node;
|
||||
}
|
||||
|
||||
struct modelnode *modelGetPart(struct modelfiledata *modelfiledata, s32 partnum)
|
||||
struct modelnode *modelGetPart(struct modeldef *modeldef, s32 partnum)
|
||||
{
|
||||
s32 upper;
|
||||
s32 lower;
|
||||
u32 i;
|
||||
s16 *partnums;
|
||||
|
||||
if (modelfiledata->numparts == 0) {
|
||||
if (modeldef->numparts == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
partnums = (s16 *)&modelfiledata->parts[modelfiledata->numparts];
|
||||
partnums = (s16 *)&modeldef->parts[modeldef->numparts];
|
||||
lower = 0;
|
||||
upper = modelfiledata->numparts;
|
||||
upper = modeldef->numparts;
|
||||
|
||||
while (upper >= lower) {
|
||||
i = (lower + upper) / 2;
|
||||
|
||||
if (partnum == partnums[i]) {
|
||||
return modelfiledata->parts[i];
|
||||
return modeldef->parts[i];
|
||||
}
|
||||
|
||||
if (partnum < partnums[i]) {
|
||||
@@ -295,9 +295,9 @@ struct modelnode *modelGetPart(struct modelfiledata *modelfiledata, s32 partnum)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *modelGetPartRodata(struct modelfiledata *modelfiledata, s32 partnum)
|
||||
void *modelGetPartRodata(struct modeldef *modeldef, s32 partnum)
|
||||
{
|
||||
struct modelnode *node = modelGetPart(modelfiledata, partnum);
|
||||
struct modelnode *node = modelGetPart(modeldef, partnum);
|
||||
|
||||
if (node) {
|
||||
return node->rodata;
|
||||
@@ -442,12 +442,12 @@ void modelNodeSetPosition(struct model *model, struct modelnode *node, struct co
|
||||
|
||||
void modelGetRootPosition(struct model *model, struct coord *pos)
|
||||
{
|
||||
modelNodeGetPosition(model, model->filedata->rootnode, pos);
|
||||
modelNodeGetPosition(model, model->definition->rootnode, pos);
|
||||
}
|
||||
|
||||
void modelSetRootPosition(struct model *model, struct coord *pos)
|
||||
{
|
||||
modelNodeSetPosition(model, model->filedata->rootnode, pos);
|
||||
modelNodeSetPosition(model, model->definition->rootnode, pos);
|
||||
}
|
||||
|
||||
void modelNodeGetModelRelativePosition(struct model *model, struct modelnode *node, struct coord *pos)
|
||||
@@ -475,8 +475,8 @@ void modelNodeGetModelRelativePosition(struct model *model, struct modelnode *no
|
||||
|
||||
f32 modelGetChrRotY(struct model *model)
|
||||
{
|
||||
if ((model->filedata->rootnode->type & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, model->filedata->rootnode);
|
||||
if ((model->definition->rootnode->type & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
union modelrwdata *rwdata = modelGetNodeRwData(model, model->definition->rootnode);
|
||||
return rwdata->chrinfo.yrot;
|
||||
}
|
||||
|
||||
@@ -485,8 +485,8 @@ f32 modelGetChrRotY(struct model *model)
|
||||
|
||||
void modelSetChrRotY(struct model *model, f32 angle)
|
||||
{
|
||||
if ((model->filedata->rootnode->type & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
struct modelrwdata_chrinfo *rwdata = modelGetNodeRwData(model, model->filedata->rootnode);
|
||||
if ((model->definition->rootnode->type & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
struct modelrwdata_chrinfo *rwdata = modelGetNodeRwData(model, model->definition->rootnode);
|
||||
f32 diff = angle - rwdata->yrot;
|
||||
|
||||
if (diff < 0) {
|
||||
@@ -523,7 +523,7 @@ void modelSetAnimScale(struct model *model, f32 scale)
|
||||
|
||||
f32 modelGetEffectiveScale(struct model *model)
|
||||
{
|
||||
return model->filedata->scale * model->scale;
|
||||
return model->definition->scale * model->scale;
|
||||
}
|
||||
|
||||
void modelTweenPos(struct coord *curpos, struct coord *goalpos, f32 frac)
|
||||
@@ -655,7 +655,7 @@ void modelUpdateChrInfo(struct model *model, struct modelnode *node)
|
||||
|
||||
void modelUpdateInfo(struct model *model)
|
||||
{
|
||||
struct modelnode *node = model->filedata->rootnode;
|
||||
struct modelnode *node = model->definition->rootnode;
|
||||
|
||||
if (node && (node->type & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
modelUpdateChrInfo(model, node);
|
||||
@@ -674,7 +674,7 @@ void modelUpdateChrNodeMtx(struct modelrenderdata *arg0, struct model *model, st
|
||||
u32 stack1;
|
||||
Mtxf *mtx = &model->matrices[rodata->chrinfo.mtxindex];
|
||||
s32 sp240 = rodata->chrinfo.unk00;
|
||||
struct skeleton *skel = model->filedata->skel;
|
||||
struct skeleton *skel = model->definition->skel;
|
||||
struct coord sp230;
|
||||
struct coord sp224;
|
||||
struct coord sp218;
|
||||
@@ -1018,10 +1018,10 @@ void modelUpdatePositionNodeMtx(struct modelrenderdata *renderdata, struct model
|
||||
|
||||
if (anim != NULL) {
|
||||
partnum = rodata->part;
|
||||
skel = model->filedata->skel;
|
||||
skel = model->definition->skel;
|
||||
|
||||
if (anim->animnum != 0) {
|
||||
sp128 = (g_Anims[anim->animnum].flags & ANIMFLAG_02) && node == model->filedata->rootnode;
|
||||
sp128 = (g_Anims[anim->animnum].flags & ANIMFLAG_02) && node == model->definition->rootnode;
|
||||
|
||||
anim00024050(partnum, anim->flip, skel, anim->animnum, anim->unk04, &sp144, &sp138, &sp12c);
|
||||
|
||||
@@ -1074,14 +1074,14 @@ void modelUpdatePositionNodeMtx(struct modelrenderdata *renderdata, struct model
|
||||
sp138.y *= anim->animscale;
|
||||
sp138.z *= anim->animscale;
|
||||
|
||||
if (node != model->filedata->rootnode) {
|
||||
if (node != model->definition->rootnode) {
|
||||
sp138.x += rodata->pos.x;
|
||||
sp138.y += rodata->pos.y;
|
||||
sp138.z += rodata->pos.z;
|
||||
}
|
||||
|
||||
modelPositionJointUsingQuatRot(renderdata, model, node, sp68, &sp138, &sp12c);
|
||||
} else if (node != model->filedata->rootnode) {
|
||||
} else if (node != model->definition->rootnode) {
|
||||
modelPositionJointUsingQuatRot(renderdata, model, node, sp68, &rodata->pos, &sp12c);
|
||||
} else {
|
||||
modelPositionJointUsingQuatRot(renderdata, model, node, sp68, &sp138, &sp12c);
|
||||
@@ -1099,14 +1099,14 @@ void modelUpdatePositionNodeMtx(struct modelrenderdata *renderdata, struct model
|
||||
sp138.y *= anim->animscale;
|
||||
sp138.z *= anim->animscale;
|
||||
|
||||
if (node != model->filedata->rootnode) {
|
||||
if (node != model->definition->rootnode) {
|
||||
sp138.x += rodata->pos.x;
|
||||
sp138.y += rodata->pos.y;
|
||||
sp138.z += rodata->pos.z;
|
||||
}
|
||||
|
||||
modelPositionJointUsingVecRot(renderdata, model, node, &sp144, &sp138, false, &sp12c);
|
||||
} else if (node != model->filedata->rootnode) {
|
||||
} else if (node != model->definition->rootnode) {
|
||||
modelPositionJointUsingVecRot(renderdata, model, node, &sp144, &rodata->pos, false, &sp12c);
|
||||
} else {
|
||||
modelPositionJointUsingVecRot(renderdata, model, node, &sp144, &sp138, false, &sp12c);
|
||||
@@ -1399,7 +1399,7 @@ void modelUpdateRelationsQuick(struct model *model, struct modelnode *parent)
|
||||
*/
|
||||
void modelUpdateRelations(struct model *model)
|
||||
{
|
||||
struct modelnode *node = model->filedata->rootnode;
|
||||
struct modelnode *node = model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
u32 type = node->type & 0xff;
|
||||
@@ -1440,7 +1440,7 @@ void modelUpdateRelations(struct model *model)
|
||||
|
||||
void modelUpdateMatrices(struct modelrenderdata *arg0, struct model *model)
|
||||
{
|
||||
struct modelnode *node = model->filedata->rootnode;
|
||||
struct modelnode *node = model->definition->rootnode;
|
||||
|
||||
while (node) {
|
||||
u32 type = node->type & 0xff;
|
||||
@@ -1491,7 +1491,7 @@ void modelSetMatrices(struct modelrenderdata *renderdata, struct model *model)
|
||||
{
|
||||
model->matrices = renderdata->unk10;
|
||||
|
||||
renderdata->unk10 += model->filedata->nummatrices;
|
||||
renderdata->unk10 += model->definition->nummatrices;
|
||||
|
||||
#if VERSION >= VERSION_PAL_BETA
|
||||
if (var8005efb0_2 || !model00018680(renderdata, model)) {
|
||||
@@ -1681,7 +1681,7 @@ void modelCopyAnimForMerge(struct model *model, f32 merge)
|
||||
return;
|
||||
}
|
||||
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
nodetype = node->type & 0xff;
|
||||
|
||||
anim->frame2 = anim->frame;
|
||||
@@ -1740,14 +1740,14 @@ void modelSetAnimation2(struct model *model, s16 animnum, s32 flip, f32 fstartfr
|
||||
|
||||
anim->looping = false;
|
||||
|
||||
type = model->filedata->rootnode->type & 0xff;
|
||||
type = model->definition->rootnode->type & 0xff;
|
||||
|
||||
if (type == MODELNODETYPE_CHRINFO) {
|
||||
u32 stack;
|
||||
struct modelrodata_chrinfo *rodata = &model->filedata->rootnode->rodata->chrinfo;
|
||||
struct modelrwdata_chrinfo *rwdata = (struct modelrwdata_chrinfo *) modelGetNodeRwData(model, model->filedata->rootnode);
|
||||
struct modelrodata_chrinfo *rodata = &model->definition->rootnode->rodata->chrinfo;
|
||||
struct modelrwdata_chrinfo *rwdata = (struct modelrwdata_chrinfo *) modelGetNodeRwData(model, model->definition->rootnode);
|
||||
s32 spa4 = rodata->unk00;
|
||||
struct skeleton *skel = model->filedata->skel;
|
||||
struct skeleton *skel = model->definition->skel;
|
||||
f32 scale;
|
||||
f32 sp98;
|
||||
f32 sp94;
|
||||
@@ -2099,7 +2099,7 @@ void modelSetAnimFrame2WithChrStuff(struct model *model, f32 curframe, f32 endfr
|
||||
struct anim *anim = model->anim;
|
||||
|
||||
if (anim != NULL) {
|
||||
struct modelnode *rootnode = model->filedata->rootnode;
|
||||
struct modelnode *rootnode = model->definition->rootnode;
|
||||
u16 nodetype = rootnode->type;
|
||||
|
||||
if ((nodetype & 0xff) == MODELNODETYPE_CHRINFO) {
|
||||
@@ -2108,7 +2108,7 @@ void modelSetAnimFrame2WithChrStuff(struct model *model, f32 curframe, f32 endfr
|
||||
|
||||
if (rwdata->unk00 == 0) {
|
||||
s32 sp118 = rodata->unk00;
|
||||
struct skeleton *skel = model->filedata->skel;
|
||||
struct skeleton *skel = model->definition->skel;
|
||||
f32 scale = model->scale * anim->animscale;
|
||||
f32 sine;
|
||||
f32 cosine;
|
||||
@@ -3441,7 +3441,7 @@ void modelRender(struct modelrenderdata *renderdata, struct model *model)
|
||||
union modelrodata *rodata;
|
||||
union modelrwdata *rwdata;
|
||||
u32 type;
|
||||
struct modelnode *node = model->filedata->rootnode;
|
||||
struct modelnode *node = model->definition->rootnode;
|
||||
|
||||
gSPSegment(renderdata->gdl++, SPSEGMENT_MODEL_MTX, osVirtualToPhysical(model->matrices));
|
||||
|
||||
@@ -3718,7 +3718,7 @@ s32 modelTestForHit(struct model *model, struct coord *arg1, struct coord *arg2,
|
||||
node = *startnode;
|
||||
*startnode = NULL;
|
||||
} else {
|
||||
node = model->filedata->rootnode;
|
||||
node = model->definition->rootnode;
|
||||
}
|
||||
|
||||
while (node) {
|
||||
@@ -3886,26 +3886,26 @@ void modelPromoteNodeOffsetsToPointers(struct modelnode *node, u32 vma, u32 file
|
||||
* Offsets in model files are based from virtual memory address 0x0f000000.
|
||||
* This vma address is specified as an argument to the function.
|
||||
*/
|
||||
void modelPromoteOffsetsToPointers(struct modelfiledata *filedata, u32 vma, u32 fileramaddr)
|
||||
void modelPromoteOffsetsToPointers(struct modeldef *modeldef, u32 vma, u32 fileramaddr)
|
||||
{
|
||||
s32 diff = fileramaddr - vma;
|
||||
s32 i;
|
||||
s16 *partnums;
|
||||
|
||||
PROMOTE(filedata->rootnode);
|
||||
PROMOTE(filedata->parts);
|
||||
PROMOTE(filedata->texconfigs);
|
||||
PROMOTE(modeldef->rootnode);
|
||||
PROMOTE(modeldef->parts);
|
||||
PROMOTE(modeldef->texconfigs);
|
||||
|
||||
for (i = 0; i < filedata->numparts; i++) {
|
||||
PROMOTE(filedata->parts[i]);
|
||||
for (i = 0; i < modeldef->numparts; i++) {
|
||||
PROMOTE(modeldef->parts[i]);
|
||||
}
|
||||
|
||||
modelPromoteNodeOffsetsToPointers(filedata->rootnode, vma, fileramaddr);
|
||||
modelPromoteNodeOffsetsToPointers(modeldef->rootnode, vma, fileramaddr);
|
||||
|
||||
// Sort parts by part number so they can be bisected during lookup
|
||||
partnums = (s16 *)&filedata->parts[filedata->numparts];
|
||||
partnums = (s16 *)&modeldef->parts[modeldef->numparts];
|
||||
|
||||
if (filedata->numparts) {
|
||||
if (modeldef->numparts) {
|
||||
struct modelnode *tmpnode;
|
||||
s16 tmpnum;
|
||||
bool changed;
|
||||
@@ -3913,15 +3913,15 @@ void modelPromoteOffsetsToPointers(struct modelfiledata *filedata, u32 vma, u32
|
||||
do {
|
||||
changed = false;
|
||||
|
||||
for (i = 0; i < filedata->numparts - 1; i++) {
|
||||
for (i = 0; i < modeldef->numparts - 1; i++) {
|
||||
if (partnums[i] > partnums[i + 1]) {
|
||||
tmpnum = partnums[i];
|
||||
partnums[i] = partnums[i + 1];
|
||||
partnums[i + 1] = tmpnum;
|
||||
|
||||
tmpnode = filedata->parts[i];
|
||||
filedata->parts[i] = filedata->parts[i + 1];
|
||||
filedata->parts[i + 1] = tmpnode;
|
||||
tmpnode = modeldef->parts[i];
|
||||
modeldef->parts[i] = modeldef->parts[i + 1];
|
||||
modeldef->parts[i + 1] = tmpnode;
|
||||
|
||||
changed = true;
|
||||
}
|
||||
@@ -4010,9 +4010,9 @@ s32 modelCalculateRwDataIndexes(struct modelnode *basenode)
|
||||
return len;
|
||||
}
|
||||
|
||||
void modelAllocateRwData(struct modelfiledata *filedata)
|
||||
void modelAllocateRwData(struct modeldef *modeldef)
|
||||
{
|
||||
filedata->rwdatalen = modelCalculateRwDataIndexes(filedata->rootnode);
|
||||
modeldef->rwdatalen = modelCalculateRwDataIndexes(modeldef->rootnode);
|
||||
}
|
||||
|
||||
void modelInitRwData(struct model *model, struct modelnode *startnode)
|
||||
@@ -4120,19 +4120,19 @@ void modelInitRwData(struct model *model, struct modelnode *startnode)
|
||||
}
|
||||
}
|
||||
|
||||
void modelInit(struct model *model, struct modelfiledata *filedata, union modelrwdata **rwdatas, bool resetanim)
|
||||
void modelInit(struct model *model, struct modeldef *modeldef, union modelrwdata **rwdatas, bool resetanim)
|
||||
{
|
||||
struct modelnode *node;
|
||||
|
||||
model->unk00 = 0;
|
||||
model->filedata = filedata;
|
||||
model->definition = modeldef;
|
||||
model->rwdatas = rwdatas;
|
||||
model->rwdatalen = -1;
|
||||
model->scale = 1;
|
||||
model->attachedtomodel = NULL;
|
||||
model->attachedtonode = NULL;
|
||||
|
||||
node = filedata->rootnode;
|
||||
node = modeldef->rootnode;
|
||||
|
||||
while (node) {
|
||||
u32 type = node->type & 0xff;
|
||||
@@ -4145,7 +4145,7 @@ void modelInit(struct model *model, struct modelfiledata *filedata, union modelr
|
||||
node = node->child;
|
||||
} else {
|
||||
while (node) {
|
||||
if (node == filedata->rootnode->parent) {
|
||||
if (node == modeldef->rootnode->parent) {
|
||||
node = NULL;
|
||||
break;
|
||||
}
|
||||
@@ -4161,7 +4161,7 @@ void modelInit(struct model *model, struct modelfiledata *filedata, union modelr
|
||||
}
|
||||
|
||||
if (rwdatas != NULL) {
|
||||
modelInitRwData(model, filedata->rootnode);
|
||||
modelInitRwData(model, modeldef->rootnode);
|
||||
}
|
||||
|
||||
if (resetanim) {
|
||||
@@ -4193,7 +4193,7 @@ void animInit(struct anim *anim)
|
||||
anim->animscale = 1;
|
||||
}
|
||||
|
||||
void modelAttachHead(struct model *bodymode, struct modelfiledata *bodymodeldef, struct modelnode *headspotnode, struct modelfiledata *headmodeldef)
|
||||
void modelAttachHead(struct model *bodymode, struct modeldef *bodymodeldef, struct modelnode *headspotnode, struct modeldef *headmodeldef)
|
||||
{
|
||||
struct modelrwdata_headspot *rwdata = modelGetNodeRwData(bodymode, headspotnode);
|
||||
struct modelnode *node;
|
||||
@@ -4225,14 +4225,14 @@ void modelAttachHead(struct model *bodymode, struct modelfiledata *bodymodeldef,
|
||||
* Note that some node types support multiple display lists, so the function
|
||||
* may return the same node while it iterates the display lists for that node.
|
||||
*/
|
||||
void modelIterateDisplayLists(struct modelfiledata *filedata, struct modelnode **nodeptr, Gfx **gdlptr)
|
||||
void modelIterateDisplayLists(struct modeldef *modeldef, struct modelnode **nodeptr, Gfx **gdlptr)
|
||||
{
|
||||
struct modelnode *node = *nodeptr;
|
||||
union modelrodata *rodata;
|
||||
Gfx *gdl = NULL;
|
||||
|
||||
if (node == NULL) {
|
||||
node = filedata->rootnode;
|
||||
node = modeldef->rootnode;
|
||||
}
|
||||
|
||||
while (node) {
|
||||
@@ -4299,7 +4299,7 @@ void modelIterateDisplayLists(struct modelfiledata *filedata, struct modelnode *
|
||||
*nodeptr = node;
|
||||
}
|
||||
|
||||
void modelNodeReplaceGdl(struct modelfiledata *modeldef, struct modelnode *node, Gfx *find, Gfx *replacement)
|
||||
void modelNodeReplaceGdl(struct modeldef *modeldef, struct modelnode *node, Gfx *find, Gfx *replacement)
|
||||
{
|
||||
union modelrodata *rodata;
|
||||
u32 type = node->type & 0xff;
|
||||
|
||||
Reference in New Issue
Block a user