16 gDPSetRenderMode(
gMainGfxPos++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
17 gDPSetCombineMode(
gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
21 gDPFillRectangle(
gMainGfxPos++, left, top, right, bottom);
23 gDPSetRenderMode(
gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
24 gDPSetCombineMode(
gMainGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
28 u16 endX = posX + width;
29 u16 endY = posY + height;
39 virtualEntity->
pos.
x += magnitude * sinTheta;
40 virtualEntity->
pos.
z += -magnitude * cosTheta;
47 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
69 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
70 if (virtualEntity != NULL) {
102 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
103 if (virtualEntity != NULL) {
114 guMtxF2L(transform, &transformMtxL);
131 Bytecode* args = script->ptrReadPos;
134 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
137 virtualEntity->
pos.
x = 0.0f;
138 virtualEntity->
pos.
y = 0.0f;
139 virtualEntity->
pos.
z = 0.0f;
140 virtualEntity->
rot.
x = 0.0f;
141 virtualEntity->
rot.
y = 0.0f;
142 virtualEntity->
rot.
z = 0.0f;
143 virtualEntity->
scale.
x = 1.0f;
144 virtualEntity->
scale.
y = 1.0f;
145 virtualEntity->
scale.
z = 1.0f;
152 Bytecode* args = script->ptrReadPos;
153 s32 outVar = *args++;
159 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
170 virtualEntity->
pos.
x = 0.0f;
171 virtualEntity->
pos.
y = 0.0f;
172 virtualEntity->
pos.
z = 0.0f;
173 virtualEntity->
rot.
x = 0.0f;
174 virtualEntity->
rot.
y = 0.0f;
175 virtualEntity->
rot.
z = 0.0f;
176 virtualEntity->
scale.
x = 1.0f;
177 virtualEntity->
scale.
y = 1.0f;
178 virtualEntity->
scale.
z = 1.0f;
187 Bytecode* args = script->ptrReadPos;
188 s32 outVar = *args++;
194 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
205 virtualEntity->
pos.
x = 0.0f;
206 virtualEntity->
pos.
y = 0.0f;
207 virtualEntity->
pos.
z = 0.0f;
208 virtualEntity->
rot.
x = 0.0f;
209 virtualEntity->
rot.
y = 0.0f;
210 virtualEntity->
rot.
z = 0.0f;
211 virtualEntity->
scale.
x = 1.0f;
212 virtualEntity->
scale.
y = 1.0f;
213 virtualEntity->
scale.
z = 1.0f;
230 Bytecode* args = script->ptrReadPos;
239 Bytecode* args = script->ptrReadPos;
244 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
246 virtualEntity->
pos.
x = x;
247 virtualEntity->
pos.
y = y;
248 virtualEntity->
pos.
z = z;
253 Bytecode* args = script->ptrReadPos;
255 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
256 s32 outVar1 = *args++;
257 s32 outVar2 = *args++;
258 s32 outVar3 = *args++;
267 Bytecode* args = script->ptrReadPos;
272 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
274 virtualEntity->
rot.
x = x;
275 virtualEntity->
rot.
y = y;
276 virtualEntity->
rot.
z = z;
281 Bytecode* args = script->ptrReadPos;
286 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
288 virtualEntity->
scale.
x = x;
289 virtualEntity->
scale.
y = y;
290 virtualEntity->
scale.
z = z;
295 Bytecode* args = script->ptrReadPos;
303 Bytecode* args = script->ptrReadPos;
311 Bytecode* args = script->ptrReadPos;
315 script->functionTemp[0] = 0;
318 if (script->functionTemp[0] == 0) {
327 virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
328 script->functionTemp[1] = index;
334 xTemp = virtualEntity->
pos.
x;
335 zTemp = virtualEntity->
pos.
z;
337 goalPosX = virtualEntity->
goalPos.
x;
338 goalPosZ = virtualEntity->
goalPos.
z;
341 virtualEntity->
moveAngle =
atan2(xTemp, zTemp, goalPosX, goalPosZ);
342 virtualEntity->
moveDist =
dist2D(xTemp, zTemp, goalPosX, goalPosZ);
344 if (virtualEntity->
moveTime == 0.0f) {
350 script->functionTemp[0] = 1;
353 virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
357 if (virtualEntity->
moveTime <= 0.0f) {
367 Bytecode* args = script->ptrReadPos;
379 script->functionTemp[0] = 0;
382 if (script->functionTemp[0] == 0) {
389 virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
390 script->functionTemp[1] = index;
396 xTemp = virtualEntity->
pos.
x;
397 yTemp = virtualEntity->
pos.
y;
398 zTemp = virtualEntity->
pos.
z;
400 goalPosX = virtualEntity->
goalPos.
x;
401 yTemp = virtualEntity->
goalPos.
y - yTemp;
402 goalPosZ = virtualEntity->
goalPos.
z;
406 virtualEntity->
moveAngle =
atan2(xTemp, zTemp, goalPosX, goalPosZ);
407 virtualEntity->
moveDist =
dist2D(xTemp, zTemp, goalPosX, goalPosZ);
409 if (virtualEntity->
moveTime == 0.0f) {
417 script->functionTemp[0] = 1;
420 virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
427 if (virtualEntity->
moveTime <= 0.0f) {
438 Bytecode* args = script->ptrReadPos;
442 script->functionTemp[0] = 0;
445 if (script->functionTemp[0] == 0) {
447 script->functionTemp[0] = 1;
450 virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]];
456 if (virtualEntity->
pos.
y < 0.0f) {
457 virtualEntity->
pos.
y = 0.0f;
465 Bytecode* args = script->ptrReadPos;
468 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
475 Bytecode* args = script->ptrReadPos;
479 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
491 Bytecode* args = script->ptrReadPos;
494 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
533 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
536 virtualEntity->
pos.
x = 0.0f;
537 virtualEntity->
pos.
y = 0.0f;
538 virtualEntity->
pos.
z = 0.0f;
539 virtualEntity->
rot.
x = 0.0f;
540 virtualEntity->
rot.
y = 0.0f;
541 virtualEntity->
rot.
z = 0.0f;
542 virtualEntity->
scale.
x = 1.0f;
543 virtualEntity->
scale.
y = 1.0f;
544 virtualEntity->
scale.
z = 1.0f;
555 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
566 virtualEntity->
pos.
x = 0.0f;
567 virtualEntity->
pos.
y = 0.0f;
568 virtualEntity->
pos.
z = 0.0f;
569 virtualEntity->
rot.
x = 0.0f;
570 virtualEntity->
rot.
y = 0.0f;
571 virtualEntity->
rot.
z = 0.0f;
572 virtualEntity->
scale.
x = 1.0f;
573 virtualEntity->
scale.
y = 1.0f;
574 virtualEntity->
scale.
z = 1.0f;
586 virtualEntity = (*gCurrentVirtualEntityListPtr)[i];
597 virtualEntity->
pos.
x = 0.0f;
598 virtualEntity->
pos.
y = 0.0f;
599 virtualEntity->
pos.
z = 0.0f;
600 virtualEntity->
rot.
x = 0.0f;
601 virtualEntity->
rot.
y = 0.0f;
602 virtualEntity->
rot.
z = 0.0f;
603 virtualEntity->
scale.
x = 1.0f;
604 virtualEntity->
scale.
y = 1.0f;
605 virtualEntity->
scale.
z = 1.0f;
613 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
615 virtualEntity->
pos.
x = posX;
616 virtualEntity->
pos.
y = posY;
617 virtualEntity->
pos.
z = posZ;
621 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
623 virtualEntity->
scale.
x = scaleX;
624 virtualEntity->
scale.
y = scaleY;
625 virtualEntity->
scale.
z = scaleZ;
629 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
631 virtualEntity->
rot.
x = angleX;
632 virtualEntity->
rot.
y = angleY;
633 virtualEntity->
rot.
z = angleZ;
637 VirtualEntity* virtualEntity = (*gCurrentVirtualEntityListPtr)[index];
666 (*gCurrentVirtualEntityListPtr)[i]->entityModelIndex = -1;
VirtualEntity * VirtualEntityList[0x40]
#define ASSERT(condition)
s32 load_entity_model(EntityModelScript *cmdList)
s32 ALT_load_entity_model(EntityModelScript *cmdList)
void set_entity_model_render_command_list(s32 idx, EntityModelScript *cmdList)
EntityModel * get_entity_model(s32 idx)
@ RENDER_MODE_SURFACE_XLU_LAYER2
@ RENDER_MODE_SURFACE_OPA
s32 create_worker_world(WorldArgs, WorldArgs)
s32 evt_get_variable(Evt *script, Bytecode var)
void draw_entity_model_A(s32, Mtx *)
void clear_entity_model_flags(s32 idx, s32 newFlags)
void set_entity_model_flags(s32 idx, s32 newFlags)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
void exec_entity_model_commandlist(s32 idx)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void draw_entity_model_E(s32, Mtx *)
void free_entity_model_by_index(s32 idx)
void * heap_malloc(s32 size)
ApiStatus CreateVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityFlags(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityMoveSpeed(Evt *script, b32 isInitialCall)
ApiStatus InitVirtualEntityList(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityFlagBits(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityPosition(Evt *script, b32 isInitialCall)
ApiStatus CreateVirtualEntity_ALT(Evt *script, b32 isInitialCall)
ApiStatus GetVirtualEntityPosition(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityLandJump(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityJumpGravity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityScale(Evt *script, b32 isInitialCall)
ApiStatus DeleteVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityRenderMode(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityJumpTo(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityRotation(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityMoveTo(Evt *script, b32 isInitialCall)
ApiStatus CreateVirtualEntityAt(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityRenderCommands(Evt *script, b32 isInitialCall)
#define PM_CC_PRIM_FULL_ALPHA
GameStatus * gGameStatusPtr
VirtualEntityList wWorldVirtualEntityList
void virtual_entity_set_rotation(s32 index, f32 angleX, f32 angleY, f32 angleZ)
void virtual_entity_list_render_world(void)
void virtual_entity_list_update(void)
void virtual_entity_appendGfx_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 right, u16 bottom)
s32 create_worker_backUI(void(*updateFunc)(void), void(*drawFunc)(void))
void init_virtual_entity_list(void)
void virtual_entity_move_polar(VirtualEntity *virtualEntity, f32 magnitude, f32 angle)
void virtual_entity_delete_by_ref(VirtualEntity *obj)
void virtual_entity_set_scale(s32 index, f32 scaleX, f32 scaleY, f32 scaleZ)
VirtualEntity * virtual_entity_get_by_index(s32 index)
void virtual_entity_delete_by_index(s32 index)
void clear_virtual_entity_list(void)
VirtualEntityList * gCurrentVirtualEntityListPtr
void virtual_entity_set_pos(s32 index, s32 posX, s32 posY, s32 posZ)
s32 virtual_entity_create(EntityModelScript *cmdList)
VirtualEntity * virtual_entity_create_at_index(s32 index, EntityModelScript *entityModelData)
void virtual_entity_render_quad(s32 r, s32 g, s32 b, s32 a, s32 posX, s32 posY, s32 width, s32 height)
VirtualEntityList bBattleVirtualEntityList
VirtualEntity * ALT_virtual_entity_create(EntityModelScript *cmdList)
void virtual_entity_list_render_UI(void)