Rename and split some files
* Rename game_0b28d0.c to modelmgr.c * Split playerreset.c to modelmgrreset.c * Split chr.c to proptick.c
This commit is contained in:
parent
b20aa02961
commit
28e82578e4
|
|
@ -33,6 +33,7 @@
|
|||
build/ROMID/game/objectivesreset.o (section); \
|
||||
build/ROMID/game/casingreset.o (section); \
|
||||
build/ROMID/game/bondgunreset.o (section); \
|
||||
build/ROMID/game/modelmgrreset.o (section); \
|
||||
build/ROMID/game/playerreset.o (section); \
|
||||
build/ROMID/game/invreset.o (section); \
|
||||
build/ROMID/game/bondheadreset.o (section); \
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
build/ROMID/game/casingtick.o (section); \
|
||||
build/ROMID/game/shardstick.o (section); \
|
||||
build/ROMID/game/sparkstick.o (section); \
|
||||
build/ROMID/game/proptick.o (section); \
|
||||
build/ROMID/game/chr.o (section); \
|
||||
build/ROMID/game/body.o (section); \
|
||||
build/ROMID/game/chraction.o (section); \
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
build/ROMID/game/mpstats.o (section); \
|
||||
build/ROMID/game/game_0b0fd0.o (section); \
|
||||
build/ROMID/game/game_0b2150.o (section); \
|
||||
build/ROMID/game/game_0b28d0.o (section); \
|
||||
build/ROMID/game/modelmgr.o (section); \
|
||||
build/ROMID/game/texselect.o (section); \
|
||||
build/ROMID/game/camera.o (section); \
|
||||
build/ROMID/game/portal.o (section); \
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
build/ROMID/game/objectivesreset.o (section); \
|
||||
build/ROMID/game/casingreset.o (section); \
|
||||
build/ROMID/game/bondgunreset.o (section); \
|
||||
build/ROMID/game/modelmgrreset.o (section); \
|
||||
build/ROMID/game/playerreset.o (section); \
|
||||
build/ROMID/game/invreset.o (section); \
|
||||
build/ROMID/game/bondheadreset.o (section); \
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
build/ROMID/game/casingtick.o (section); \
|
||||
build/ROMID/game/shardstick.o (section); \
|
||||
build/ROMID/game/sparkstick.o (section); \
|
||||
build/ROMID/game/proptick.o (section); \
|
||||
build/ROMID/game/chr.o (section); \
|
||||
build/ROMID/game/body.o (section); \
|
||||
build/ROMID/game/chraction.o (section); \
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
build/ROMID/game/mpstats.o (section); \
|
||||
build/ROMID/game/game_0b0fd0.o (section); \
|
||||
build/ROMID/game/game_0b2150.o (section); \
|
||||
build/ROMID/game/game_0b28d0.o (section); \
|
||||
build/ROMID/game/modelmgr.o (section); \
|
||||
build/ROMID/game/texselect.o (section); \
|
||||
build/ROMID/game/camera.o (section); \
|
||||
build/ROMID/game/portal.o (section); \
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
build/ROMID/game/objectivesreset.o (section); \
|
||||
build/ROMID/game/casingreset.o (section); \
|
||||
build/ROMID/game/bondgunreset.o (section); \
|
||||
build/ROMID/game/modelmgrreset.o (section); \
|
||||
build/ROMID/game/playerreset.o (section); \
|
||||
build/ROMID/game/invreset.o (section); \
|
||||
build/ROMID/game/bondheadreset.o (section); \
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
build/ROMID/game/casingtick.o (section); \
|
||||
build/ROMID/game/shardstick.o (section); \
|
||||
build/ROMID/game/sparkstick.o (section); \
|
||||
build/ROMID/game/proptick.o (section); \
|
||||
build/ROMID/game/chr.o (section); \
|
||||
build/ROMID/game/body.o (section); \
|
||||
build/ROMID/game/chraction.o (section); \
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
build/ROMID/game/mpstats.o (section); \
|
||||
build/ROMID/game/game_0b0fd0.o (section); \
|
||||
build/ROMID/game/game_0b2150.o (section); \
|
||||
build/ROMID/game/game_0b28d0.o (section); \
|
||||
build/ROMID/game/modelmgr.o (section); \
|
||||
build/ROMID/game/texselect.o (section); \
|
||||
build/ROMID/game/camera.o (section); \
|
||||
build/ROMID/game/portal.o (section); \
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
build/ROMID/game/objectivesreset.o (section); \
|
||||
build/ROMID/game/casingreset.o (section); \
|
||||
build/ROMID/game/bondgunreset.o (section); \
|
||||
build/ROMID/game/modelmgrreset.o (section); \
|
||||
build/ROMID/game/playerreset.o (section); \
|
||||
build/ROMID/game/invreset.o (section); \
|
||||
build/ROMID/game/bondheadreset.o (section); \
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
build/ROMID/game/casingtick.o (section); \
|
||||
build/ROMID/game/shardstick.o (section); \
|
||||
build/ROMID/game/sparkstick.o (section); \
|
||||
build/ROMID/game/proptick.o (section); \
|
||||
build/ROMID/game/chr.o (section); \
|
||||
build/ROMID/game/body.o (section); \
|
||||
build/ROMID/game/chraction.o (section); \
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
build/ROMID/game/mpstats.o (section); \
|
||||
build/ROMID/game/game_0b0fd0.o (section); \
|
||||
build/ROMID/game/game_0b2150.o (section); \
|
||||
build/ROMID/game/game_0b28d0.o (section); \
|
||||
build/ROMID/game/modelmgr.o (section); \
|
||||
build/ROMID/game/texselect.o (section); \
|
||||
build/ROMID/game/camera.o (section); \
|
||||
build/ROMID/game/portal.o (section); \
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
build/ROMID/game/objectivesreset.o (section); \
|
||||
build/ROMID/game/casingreset.o (section); \
|
||||
build/ROMID/game/bondgunreset.o (section); \
|
||||
build/ROMID/game/modelmgrreset.o (section); \
|
||||
build/ROMID/game/playerreset.o (section); \
|
||||
build/ROMID/game/invreset.o (section); \
|
||||
build/ROMID/game/bondheadreset.o (section); \
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
build/ROMID/game/casingtick.o (section); \
|
||||
build/ROMID/game/shardstick.o (section); \
|
||||
build/ROMID/game/sparkstick.o (section); \
|
||||
build/ROMID/game/proptick.o (section); \
|
||||
build/ROMID/game/chr.o (section); \
|
||||
build/ROMID/game/body.o (section); \
|
||||
build/ROMID/game/chraction.o (section); \
|
||||
|
|
@ -110,7 +112,7 @@
|
|||
build/ROMID/game/mpstats.o (section); \
|
||||
build/ROMID/game/game_0b0fd0.o (section); \
|
||||
build/ROMID/game/game_0b2150.o (section); \
|
||||
build/ROMID/game/game_0b28d0.o (section); \
|
||||
build/ROMID/game/modelmgr.o (section); \
|
||||
build/ROMID/game/texselect.o (section); \
|
||||
build/ROMID/game/camera.o (section); \
|
||||
build/ROMID/game/portal.o (section); \
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "game/body.h"
|
||||
#include "game/prop.h"
|
||||
#include "game/atan2f.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/lv.h"
|
||||
#include "game/modeldef.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "game/bondgun.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/player.h"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "game/bondgun.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/player.h"
|
||||
|
|
@ -67,66 +67,6 @@ struct chrdata *g_ChrSlots = NULL;
|
|||
|
||||
s32 g_NumChrSlots = 0;
|
||||
|
||||
void propsTick(void)
|
||||
{
|
||||
s32 i;
|
||||
struct prop *prop;
|
||||
struct prop *next;
|
||||
struct prop *next2;
|
||||
s32 done;
|
||||
s32 tickop;
|
||||
|
||||
for (i = 0; i < PLAYERCOUNT(); i++) {
|
||||
g_Vars.players[i]->bondextrapos.x = 0;
|
||||
g_Vars.players[i]->bondextrapos.y = 0;
|
||||
g_Vars.players[i]->bondextrapos.z = 0;
|
||||
}
|
||||
|
||||
shieldhitsTick();
|
||||
chraTickBg();
|
||||
|
||||
prop = g_Vars.activeprops;
|
||||
|
||||
do {
|
||||
next = prop->next;
|
||||
done = next == g_Vars.pausedprops;
|
||||
tickop = TICKOP_NONE;
|
||||
|
||||
if (prop->type == PROPTYPE_CHR) {
|
||||
tickop = chrTickBeams(prop);
|
||||
} else if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_WEAPON || prop->type == PROPTYPE_DOOR) {
|
||||
tickop = objTick(prop);
|
||||
} else if (prop->type == PROPTYPE_EXPLOSION) {
|
||||
tickop = explosionTick(prop);
|
||||
} else if (prop->type == PROPTYPE_SMOKE) {
|
||||
tickop = smokeTick(prop);
|
||||
} else if (prop->type == PROPTYPE_PLAYER) {
|
||||
tickop = playerTickBeams(prop);
|
||||
}
|
||||
|
||||
if (tickop == TICKOP_5) {
|
||||
next2 = next;
|
||||
} else {
|
||||
next2 = prop->next;
|
||||
done = next2 == g_Vars.pausedprops;
|
||||
|
||||
if (tickop == TICKOP_RETICK) {
|
||||
propDelist(prop);
|
||||
propActivateThisFrame(prop);
|
||||
|
||||
if (done) {
|
||||
next2 = prop;
|
||||
done = false;
|
||||
}
|
||||
} else {
|
||||
propExecuteTickOperation(prop, tickop);
|
||||
}
|
||||
}
|
||||
|
||||
prop = next2;
|
||||
} while (!done);
|
||||
}
|
||||
|
||||
s32 chrsGetNumSlots(void)
|
||||
{
|
||||
return g_NumChrSlots;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "game/bondgun.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/player.h"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "game/atan2f.h"
|
||||
#include "game/bondgun.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/player.h"
|
||||
#include "game/hudmsg.h"
|
||||
#include "game/inv.h"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "game/game_00b820.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/portal.h"
|
||||
#include "game/fmb.h"
|
||||
#include "game/sky.h"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <ultra64.h>
|
||||
#include "constants.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "bss.h"
|
||||
#include "lib/memp.h"
|
||||
#include "lib/model.h"
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
#include <ultra64.h>
|
||||
#include "constants.h"
|
||||
#include "constants.h"
|
||||
#include "game/bondmove.h"
|
||||
#include "game/cheats.h"
|
||||
#include "game/inv.h"
|
||||
#include "game/playerreset.h"
|
||||
#include "game/chr.h"
|
||||
#include "game/body.h"
|
||||
#include "game/prop.h"
|
||||
#include "game/setuputils.h"
|
||||
#include "game/bondgun.h"
|
||||
#include "game/player.h"
|
||||
#include "game/inv.h"
|
||||
#include "game/stagetable.h"
|
||||
#include "game/mplayer/scenarios.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
#include "game/pad.h"
|
||||
#include "bss.h"
|
||||
#include "lib/collision.h"
|
||||
#include "lib/memp.h"
|
||||
#include "lib/mtx.h"
|
||||
#include "lib/anim.h"
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
#define NUMTYPE1() (IS4MB() ? 0 : 35)
|
||||
#define NUMTYPE2() (IS4MB() ? 24 : 25)
|
||||
#define NUMTYPE3() (IS4MB() ? 0 : 20)
|
||||
#define NUMSPARE() (IS4MB() ? 40 : 60)
|
||||
|
||||
void modelmgrReset(void)
|
||||
{
|
||||
g_MaxAnims = 0;
|
||||
g_MaxModels = 0;
|
||||
}
|
||||
|
||||
void modelmgrSetLvResetting(bool value)
|
||||
{
|
||||
g_ModelIsLvResetting = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate slots for model instances and animations.
|
||||
*
|
||||
* Each model instance can require rwdata: a block of bytes where it can save
|
||||
* information specific to its own instance.
|
||||
*
|
||||
* The rwdata slots are split into 3 types. Types 1 and 2 use different slot
|
||||
* sizes, while type 3 has no allocated slots at all. When models are
|
||||
* instantiated they require a certain amount of rwdata, and are bound to type 1
|
||||
* if possible, otherwise type 2 if possible. If neither of those are possible
|
||||
* then it allocates rwdata on the fly and puts it in type 3.
|
||||
*
|
||||
* The function allocates more than what is specified in the arguments.
|
||||
* If the expansion pak is being used, 60 spare model slots are allocated
|
||||
* (eg. for thrown weapons), and a further 20 model and 20 anim slots are
|
||||
* allocated for animated objects.
|
||||
*/
|
||||
void modelmgrAllocateSlots(s32 numobjs, s32 numchrs)
|
||||
{
|
||||
s32 rwdata2sizetotal;
|
||||
s32 rwdata1sizetotal;
|
||||
s32 rwdata3sizetotal;
|
||||
s32 bindingssize;
|
||||
u8 *ptr;
|
||||
s32 i;
|
||||
s32 totalsize;
|
||||
s32 modelssize;
|
||||
s32 animssize;
|
||||
s32 rwdata1sizeeach = 0x10;
|
||||
s32 rwdata2sizeeach = 0xd0;
|
||||
s32 rwdata3sizeeach = 0;
|
||||
s32 maxanimatedobjs = 20;
|
||||
s32 numspare;
|
||||
|
||||
g_ModelNumObjs = numobjs;
|
||||
g_ModelNumChrs = numchrs;
|
||||
|
||||
numspare = NUMSPARE();
|
||||
g_MaxModels = numobjs + numspare + numchrs + maxanimatedobjs;
|
||||
g_MaxAnims = numchrs + maxanimatedobjs;
|
||||
|
||||
i = NUMTYPE2();
|
||||
bindingssize = (NUMTYPE1() + i + NUMTYPE3()) * sizeof(struct modelrwdatabinding);
|
||||
|
||||
rwdata1sizetotal = NUMTYPE1() * rwdata1sizeeach;
|
||||
rwdata2sizetotal = NUMTYPE2() * rwdata2sizeeach;
|
||||
rwdata3sizetotal = NUMTYPE3() * rwdata3sizeeach;
|
||||
|
||||
modelssize = ALIGN16(g_MaxModels * sizeof(struct model));
|
||||
animssize = ALIGN16(g_MaxAnims * sizeof(struct anim));
|
||||
|
||||
totalsize = ALIGN16(bindingssize + rwdata1sizetotal + rwdata2sizetotal + rwdata3sizetotal + modelssize + animssize);
|
||||
|
||||
g_ModelRwdataBindings[0] = NULL;
|
||||
g_ModelRwdataBindings[1] = NULL;
|
||||
g_ModelRwdataBindings[2] = NULL;
|
||||
|
||||
ptr = mempAlloc(totalsize, MEMPOOL_STAGE);
|
||||
|
||||
if (NUMTYPE1()) {
|
||||
g_ModelRwdataBindings[0] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE1() * 8;
|
||||
}
|
||||
|
||||
if (NUMTYPE2()) {
|
||||
g_ModelRwdataBindings[1] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE2() * 8;
|
||||
}
|
||||
|
||||
if (NUMTYPE3()) {
|
||||
g_ModelRwdataBindings[2] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE3() * 8;
|
||||
}
|
||||
|
||||
g_ModelSlots = (struct model *) ptr;
|
||||
ptr += modelssize;
|
||||
g_AnimSlots = (struct anim *) ptr;
|
||||
ptr += animssize;
|
||||
|
||||
for (i = 0; i < NUMTYPE1(); i++) {
|
||||
g_ModelRwdataBindings[0][i].rwdata = ptr;
|
||||
g_ModelRwdataBindings[0][i].model = NULL;
|
||||
|
||||
ptr += rwdata1sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUMTYPE2(); i++) {
|
||||
g_ModelRwdataBindings[1][i].rwdata = ptr;
|
||||
g_ModelRwdataBindings[1][i].model = NULL;
|
||||
|
||||
ptr += rwdata2sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUMTYPE3(); i++) {
|
||||
g_ModelRwdataBindings[2][i].rwdata = NULL;
|
||||
g_ModelRwdataBindings[2][i].model = NULL;
|
||||
|
||||
ptr += rwdata3sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
g_ModelSlots[i].filedata = NULL;
|
||||
g_ModelSlots[i].rwdatas = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxAnims; i++) {
|
||||
g_AnimSlots[i].animnum = -1;
|
||||
}
|
||||
|
||||
g_ModelMostType1 = 0;
|
||||
g_ModelMostType2 = 0;
|
||||
g_ModelMostType3 = 0;
|
||||
g_ModelMostModels = 0;
|
||||
g_ModelMostAnims = 0;
|
||||
}
|
||||
|
||||
bool modelmgrLoadProjectileModeldefs(s32 weaponnum)
|
||||
{
|
||||
bool result = false;
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i != 2; i++) {
|
||||
if (weapon->functions[i]) {
|
||||
struct weaponfunc *genericfunc = weapon->functions[i];
|
||||
|
||||
if (genericfunc->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
|
||||
struct weaponfunc_shootprojectile *func = (struct weaponfunc_shootprojectile *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setupLoadModeldef(func->projectilemodelnum);
|
||||
}
|
||||
} else if (genericfunc->type == INVENTORYFUNCTYPE_THROW) {
|
||||
struct weaponfunc_throw *func = (struct weaponfunc_throw *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setupLoadModeldef(func->projectilemodelnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -24,167 +24,6 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
#define NUMTYPE1() (IS4MB() ? 0 : 35)
|
||||
#define NUMTYPE2() (IS4MB() ? 24 : 25)
|
||||
#define NUMTYPE3() (IS4MB() ? 0 : 20)
|
||||
#define NUMSPARE() (IS4MB() ? 40 : 60)
|
||||
|
||||
void modelmgrReset(void)
|
||||
{
|
||||
g_MaxAnims = 0;
|
||||
g_MaxModels = 0;
|
||||
}
|
||||
|
||||
void modelmgrSetLvResetting(bool value)
|
||||
{
|
||||
g_ModelIsLvResetting = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate slots for model instances and animations.
|
||||
*
|
||||
* Each model instance can require rwdata: a block of bytes where it can save
|
||||
* information specific to its own instance.
|
||||
*
|
||||
* The rwdata slots are split into 3 types. Types 1 and 2 use different slot
|
||||
* sizes, while type 3 has no allocated slots at all. When models are
|
||||
* instantiated they require a certain amount of rwdata, and are bound to type 1
|
||||
* if possible, otherwise type 2 if possible. If neither of those are possible
|
||||
* then it allocates rwdata on the fly and puts it in type 3.
|
||||
*
|
||||
* The function allocates more than what is specified in the arguments.
|
||||
* If the expansion pak is being used, 60 spare model slots are allocated
|
||||
* (eg. for thrown weapons), and a further 20 model and 20 anim slots are
|
||||
* allocated for animated objects.
|
||||
*/
|
||||
void modelmgrAllocateSlots(s32 numobjs, s32 numchrs)
|
||||
{
|
||||
s32 rwdata2sizetotal;
|
||||
s32 rwdata1sizetotal;
|
||||
s32 rwdata3sizetotal;
|
||||
s32 bindingssize;
|
||||
u8 *ptr;
|
||||
s32 i;
|
||||
s32 totalsize;
|
||||
s32 modelssize;
|
||||
s32 animssize;
|
||||
s32 rwdata1sizeeach = 0x10;
|
||||
s32 rwdata2sizeeach = 0xd0;
|
||||
s32 rwdata3sizeeach = 0;
|
||||
s32 maxanimatedobjs = 20;
|
||||
s32 numspare;
|
||||
|
||||
g_ModelNumObjs = numobjs;
|
||||
g_ModelNumChrs = numchrs;
|
||||
|
||||
numspare = NUMSPARE();
|
||||
g_MaxModels = numobjs + numspare + numchrs + maxanimatedobjs;
|
||||
g_MaxAnims = numchrs + maxanimatedobjs;
|
||||
|
||||
i = NUMTYPE2();
|
||||
bindingssize = (NUMTYPE1() + i + NUMTYPE3()) * sizeof(struct modelrwdatabinding);
|
||||
|
||||
rwdata1sizetotal = NUMTYPE1() * rwdata1sizeeach;
|
||||
rwdata2sizetotal = NUMTYPE2() * rwdata2sizeeach;
|
||||
rwdata3sizetotal = NUMTYPE3() * rwdata3sizeeach;
|
||||
|
||||
modelssize = ALIGN16(g_MaxModels * sizeof(struct model));
|
||||
animssize = ALIGN16(g_MaxAnims * sizeof(struct anim));
|
||||
|
||||
totalsize = ALIGN16(bindingssize + rwdata1sizetotal + rwdata2sizetotal + rwdata3sizetotal + modelssize + animssize);
|
||||
|
||||
g_ModelRwdataBindings[0] = NULL;
|
||||
g_ModelRwdataBindings[1] = NULL;
|
||||
g_ModelRwdataBindings[2] = NULL;
|
||||
|
||||
ptr = mempAlloc(totalsize, MEMPOOL_STAGE);
|
||||
|
||||
if (NUMTYPE1()) {
|
||||
g_ModelRwdataBindings[0] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE1() * 8;
|
||||
}
|
||||
|
||||
if (NUMTYPE2()) {
|
||||
g_ModelRwdataBindings[1] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE2() * 8;
|
||||
}
|
||||
|
||||
if (NUMTYPE3()) {
|
||||
g_ModelRwdataBindings[2] = (struct modelrwdatabinding *) ptr;
|
||||
ptr += NUMTYPE3() * 8;
|
||||
}
|
||||
|
||||
g_ModelSlots = (struct model *) ptr;
|
||||
ptr += modelssize;
|
||||
g_AnimSlots = (struct anim *) ptr;
|
||||
ptr += animssize;
|
||||
|
||||
for (i = 0; i < NUMTYPE1(); i++) {
|
||||
g_ModelRwdataBindings[0][i].rwdata = ptr;
|
||||
g_ModelRwdataBindings[0][i].model = NULL;
|
||||
|
||||
ptr += rwdata1sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUMTYPE2(); i++) {
|
||||
g_ModelRwdataBindings[1][i].rwdata = ptr;
|
||||
g_ModelRwdataBindings[1][i].model = NULL;
|
||||
|
||||
ptr += rwdata2sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUMTYPE3(); i++) {
|
||||
g_ModelRwdataBindings[2][i].rwdata = NULL;
|
||||
g_ModelRwdataBindings[2][i].model = NULL;
|
||||
|
||||
ptr += rwdata3sizeeach;
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxModels; i++) {
|
||||
g_ModelSlots[i].filedata = NULL;
|
||||
g_ModelSlots[i].rwdatas = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < g_MaxAnims; i++) {
|
||||
g_AnimSlots[i].animnum = -1;
|
||||
}
|
||||
|
||||
g_ModelMostType1 = 0;
|
||||
g_ModelMostType2 = 0;
|
||||
g_ModelMostType3 = 0;
|
||||
g_ModelMostModels = 0;
|
||||
g_ModelMostAnims = 0;
|
||||
}
|
||||
|
||||
bool modelmgrLoadProjectileModeldefs(s32 weaponnum)
|
||||
{
|
||||
bool result = false;
|
||||
struct weapon *weapon = g_Weapons[weaponnum];
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i != 2; i++) {
|
||||
if (weapon->functions[i]) {
|
||||
struct weaponfunc *genericfunc = weapon->functions[i];
|
||||
|
||||
if (genericfunc->type == INVENTORYFUNCTYPE_SHOOT_PROJECTILE) {
|
||||
struct weaponfunc_shootprojectile *func = (struct weaponfunc_shootprojectile *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setupLoadModeldef(func->projectilemodelnum);
|
||||
}
|
||||
} else if (genericfunc->type == INVENTORYFUNCTYPE_THROW) {
|
||||
struct weaponfunc_throw *func = (struct weaponfunc_throw *)genericfunc;
|
||||
|
||||
if (func->projectilemodelnum >= 0) {
|
||||
result |= setupLoadModeldef(func->projectilemodelnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void playerInitEyespy(void)
|
||||
{
|
||||
struct prop *prop;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "game/bondgun.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/portal.h"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
#include <ultra64.h>
|
||||
#include "lib/sched.h"
|
||||
#include "constants.h"
|
||||
#include "game/bondmove.h"
|
||||
#include "game/cheats.h"
|
||||
#include "game/chraction.h"
|
||||
#include "game/debug.h"
|
||||
#include "game/chr.h"
|
||||
#include "game/prop.h"
|
||||
#include "game/propsnd.h"
|
||||
#include "game/objectives.h"
|
||||
#include "game/game_096360.h"
|
||||
#include "game/bondgun.h"
|
||||
#include "game/gunfx.h"
|
||||
#include "game/game_0b0fd0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/player.h"
|
||||
#include "game/game_0c33f0.h"
|
||||
#include "game/playermgr.h"
|
||||
#include "game/game_1291b0.h"
|
||||
#include "game/vtxstore.h"
|
||||
#include "game/gfxmemory.h"
|
||||
#include "game/explosions.h"
|
||||
#include "game/smoke.h"
|
||||
#include "game/sparks.h"
|
||||
#include "game/bg.h"
|
||||
#include "game/file.h"
|
||||
#include "game/mplayer/setup.h"
|
||||
#include "game/bot.h"
|
||||
#include "game/botact.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
#include "game/pad.h"
|
||||
#include "game/propobj.h"
|
||||
#include "game/splat.h"
|
||||
#include "game/wallhit.h"
|
||||
#include "bss.h"
|
||||
#include "lib/vi.h"
|
||||
#include "lib/main.h"
|
||||
#include "lib/model.h"
|
||||
#include "lib/rng.h"
|
||||
#include "lib/mtx.h"
|
||||
#include "lib/anim.h"
|
||||
#include "lib/collision.h"
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
void propsTick(void)
|
||||
{
|
||||
s32 i;
|
||||
struct prop *prop;
|
||||
struct prop *next;
|
||||
struct prop *next2;
|
||||
s32 done;
|
||||
s32 tickop;
|
||||
|
||||
for (i = 0; i < PLAYERCOUNT(); i++) {
|
||||
g_Vars.players[i]->bondextrapos.x = 0;
|
||||
g_Vars.players[i]->bondextrapos.y = 0;
|
||||
g_Vars.players[i]->bondextrapos.z = 0;
|
||||
}
|
||||
|
||||
shieldhitsTick();
|
||||
chraTickBg();
|
||||
|
||||
prop = g_Vars.activeprops;
|
||||
|
||||
do {
|
||||
next = prop->next;
|
||||
done = next == g_Vars.pausedprops;
|
||||
tickop = TICKOP_NONE;
|
||||
|
||||
if (prop->type == PROPTYPE_CHR) {
|
||||
tickop = chrTickBeams(prop);
|
||||
} else if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_WEAPON || prop->type == PROPTYPE_DOOR) {
|
||||
tickop = objTick(prop);
|
||||
} else if (prop->type == PROPTYPE_EXPLOSION) {
|
||||
tickop = explosionTick(prop);
|
||||
} else if (prop->type == PROPTYPE_SMOKE) {
|
||||
tickop = smokeTick(prop);
|
||||
} else if (prop->type == PROPTYPE_PLAYER) {
|
||||
tickop = playerTickBeams(prop);
|
||||
}
|
||||
|
||||
if (tickop == TICKOP_5) {
|
||||
next2 = next;
|
||||
} else {
|
||||
next2 = prop->next;
|
||||
done = next2 == g_Vars.pausedprops;
|
||||
|
||||
if (tickop == TICKOP_RETICK) {
|
||||
propDelist(prop);
|
||||
propActivateThisFrame(prop);
|
||||
|
||||
if (done) {
|
||||
next2 = prop;
|
||||
done = false;
|
||||
}
|
||||
} else {
|
||||
propExecuteTickOperation(prop, tickop);
|
||||
}
|
||||
}
|
||||
|
||||
prop = next2;
|
||||
} while (!done);
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
#include "constants.h"
|
||||
#include "game/prop.h"
|
||||
#include "game/setuputils.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/bg.h"
|
||||
#include "game/modeldef.h"
|
||||
#include "game/propobj.h"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "constants.h"
|
||||
#include "game/title.h"
|
||||
#include "game/bondgun.h"
|
||||
#include "game/game_0b28d0.h"
|
||||
#include "game/modelmgr.h"
|
||||
#include "game/tex.h"
|
||||
#include "game/inv.h"
|
||||
#include "game/playermgr.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
void propsTick(void);
|
||||
void chrSetChrnum(struct chrdata *chr, s16 chrnum);
|
||||
void chrDeregister(s32 chrnum);
|
||||
void chrCalculatePushPos(struct chrdata *chr, struct coord *pos, s16 *rooms, bool arg3);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef IN_GAME_GAME_0B28D0_H
|
||||
#define IN_GAME_GAME_0B28D0_H
|
||||
#ifndef IN_GAME_MODELMGR_H
|
||||
#define IN_GAME_MODELMGR_H
|
||||
#include <ultra64.h>
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
extern f32 g_AutoAimScale;
|
||||
|
||||
void propsTick(void);
|
||||
|
||||
void propsSort(void);
|
||||
void propEnable(struct prop *prop);
|
||||
void propDisable(struct prop *prop);
|
||||
|
|
|
|||
Loading…
Reference in New Issue