mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-02 16:23:57 +03:00
Merge branch 'main' of https://github.com/HarbourMasters/Starship
Some checks are pending
Some checks are pending
This commit is contained in:
commit
20a93a5dcb
@ -310,6 +310,7 @@ typedef enum SetupDL {
|
|||||||
/* 0x55 */ SETUPDL_85,
|
/* 0x55 */ SETUPDL_85,
|
||||||
/* 0x56 */ SETUPDL_86,
|
/* 0x56 */ SETUPDL_86,
|
||||||
/* 0x57 */ SETUPDL_87,
|
/* 0x57 */ SETUPDL_87,
|
||||||
|
SETUPDL_29_POINT,
|
||||||
SETUPDL_36_POINT,
|
SETUPDL_36_POINT,
|
||||||
SETUPDL_62_POINT,
|
SETUPDL_62_POINT,
|
||||||
SETUPDL_63_POINT,
|
SETUPDL_63_POINT,
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "assets/ast_ve1_boss.h"
|
#include "assets/ast_ve1_boss.h"
|
||||||
#include "assets/ast_zoness.h"
|
#include "assets/ast_zoness.h"
|
||||||
#include "port/interpolation/FrameInterpolation.h"
|
#include "port/interpolation/FrameInterpolation.h"
|
||||||
|
#include "port/hooks/Events.h"
|
||||||
|
|
||||||
Vec3f D_edisplay_801615D0;
|
Vec3f D_edisplay_801615D0;
|
||||||
Vec3f sViewPos;
|
Vec3f sViewPos;
|
||||||
@ -1044,6 +1045,7 @@ void ObjSpecial_SetMatrix(Object* obj, f32 xRot, f32 yRot, f32 zRot, s32 drawTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Scenery_Draw(Scenery* this, s32 cullDirection) {
|
void Scenery_Draw(Scenery* this, s32 cullDirection) {
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_SCENERY, this);
|
||||||
this->obj.pos.y += gCameraShakeY;
|
this->obj.pos.y += gCameraShakeY;
|
||||||
Object_SetMatrix(&this->obj, this->info.drawType);
|
Object_SetMatrix(&this->obj, this->info.drawType);
|
||||||
this->obj.pos.y -= gCameraShakeY;
|
this->obj.pos.y -= gCameraShakeY;
|
||||||
@ -1058,7 +1060,10 @@ void Scenery_Draw(Scenery* this, s32 cullDirection) {
|
|||||||
Object_ApplyWaterDistortion();
|
Object_ApplyWaterDistortion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SCENERY, this){
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
|
}
|
||||||
|
|
||||||
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
||||||
} else {
|
} else {
|
||||||
if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) {
|
if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) {
|
||||||
@ -1074,7 +1079,9 @@ void Scenery_Draw(Scenery* this, s32 cullDirection) {
|
|||||||
Object_ApplyWaterDistortion();
|
Object_ApplyWaterDistortion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SCENERY, this){
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
|
}
|
||||||
|
|
||||||
if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) {
|
if (this->obj.id == OBJ_SCENERY_CO_HIGHWAY_3) {
|
||||||
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar);
|
||||||
@ -1082,16 +1089,20 @@ void Scenery_Draw(Scenery* this, s32 cullDirection) {
|
|||||||
}
|
}
|
||||||
} else if (this->info.draw != NULL) {
|
} else if (this->info.draw != NULL) {
|
||||||
Object_SetCullDirection(cullDirection);
|
Object_SetCullDirection(cullDirection);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SCENERY, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Sprite_Draw(Sprite* this, s32 arg1) {
|
void Sprite_Draw(Sprite* this, s32 arg1) {
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_SPRITE, this);
|
||||||
if (arg1 >= 0) {
|
if (arg1 >= 0) {
|
||||||
this->obj.pos.y += gCameraShakeY;
|
this->obj.pos.y += gCameraShakeY;
|
||||||
Object_SetMatrix(&this->obj, 0);
|
Object_SetMatrix(&this->obj, 0);
|
||||||
this->obj.pos.y -= gCameraShakeY;
|
this->obj.pos.y -= gCameraShakeY;
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SPRITE, this){
|
||||||
if (this->info.drawType == 0) {
|
if (this->info.drawType == 0) {
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
} else if (this->info.draw != NULL) {
|
} else if (this->info.draw != NULL) {
|
||||||
@ -1099,10 +1110,13 @@ void Sprite_Draw(Sprite* this, s32 arg1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Actor_DrawOnRails(Actor* this) {
|
void Actor_DrawOnRails(Actor* this) {
|
||||||
Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
|
Vec3f sp34 = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_ACTOR, this);
|
||||||
|
|
||||||
if (this->info.draw != NULL) {
|
if (this->info.draw != NULL) {
|
||||||
switch (this->obj.id) {
|
switch (this->obj.id) {
|
||||||
case OBJ_ACTOR_ME_MORA:
|
case OBJ_ACTOR_ME_MORA:
|
||||||
@ -1128,10 +1142,14 @@ void Actor_DrawOnRails(Actor* this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->info.drawType == 0) {
|
if (this->info.drawType == 0) {
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR, this){
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
|
}
|
||||||
Object_UpdateSfxSource(this->sfxSource);
|
Object_UpdateSfxSource(this->sfxSource);
|
||||||
} else {
|
} else {
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
|
}
|
||||||
Object_UpdateSfxSource(this->sfxSource);
|
Object_UpdateSfxSource(this->sfxSource);
|
||||||
if (((this->obj.id == OBJ_ACTOR_TEAM_BOSS) ||
|
if (((this->obj.id == OBJ_ACTOR_TEAM_BOSS) ||
|
||||||
((this->obj.id == OBJ_ACTOR_SX_SLIPPY) && (this->animFrame > 0))) &&
|
((this->obj.id == OBJ_ACTOR_SX_SLIPPY) && (this->animFrame > 0))) &&
|
||||||
@ -1158,6 +1176,8 @@ void Actor_DrawAllRange(Actor* this) {
|
|||||||
f32 var_fv0;
|
f32 var_fv0;
|
||||||
f32 var_fv1;
|
f32 var_fv1;
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_ACTOR, this);
|
||||||
|
|
||||||
sDrewActor = false;
|
sDrewActor = false;
|
||||||
|
|
||||||
if (this->info.drawType == 2) {
|
if (this->info.drawType == 2) {
|
||||||
@ -1185,7 +1205,9 @@ void Actor_DrawAllRange(Actor* this) {
|
|||||||
Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
|
Matrix_RotateY(gCalcMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
Matrix_RotateX(gCalcMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
|
}
|
||||||
sDrewActor = true;
|
sDrewActor = true;
|
||||||
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
|
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && (this->obj.id == OBJ_ACTOR_ALLRANGE) &&
|
||||||
(this->aiType == AI360_MISSILE)) {
|
(this->aiType == AI360_MISSILE)) {
|
||||||
@ -1223,7 +1245,9 @@ void Actor_DrawAllRange(Actor* this) {
|
|||||||
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
|
}
|
||||||
sDrewActor = true;
|
sDrewActor = true;
|
||||||
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) &&
|
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) &&
|
||||||
(((this->obj.id == OBJ_ACTOR_ALLRANGE) &&
|
(((this->obj.id == OBJ_ACTOR_ALLRANGE) &&
|
||||||
@ -1267,6 +1291,8 @@ void Boss_Draw(Boss* this, s32 arg1) {
|
|||||||
f32 sp3C;
|
f32 sp3C;
|
||||||
Vec3f origin = { 0.0f, 0.0f, 0.0f };
|
Vec3f origin = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_BOSS, this);
|
||||||
|
|
||||||
if (this->info.unk_19 != 0) {
|
if (this->info.unk_19 != 0) {
|
||||||
this->obj.pos.y += this->yOffset + gCameraShakeY;
|
this->obj.pos.y += this->yOffset + gCameraShakeY;
|
||||||
Boss_SetMatrix(&this->obj, this->info.drawType);
|
Boss_SetMatrix(&this->obj, this->info.drawType);
|
||||||
@ -1318,22 +1344,28 @@ void Boss_Draw(Boss* this, s32 arg1) {
|
|||||||
if (arg1 < 0) {
|
if (arg1 < 0) {
|
||||||
Object_ApplyWaterDistortion();
|
Object_ApplyWaterDistortion();
|
||||||
}
|
}
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_BOSS, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
D_edisplay_801615D0.y = sp3C;
|
D_edisplay_801615D0.y = sp3C;
|
||||||
|
|
||||||
if (this->obj.id == OBJ_BOSS_BO_BASE) {
|
if (this->obj.id == OBJ_BOSS_BO_BASE) {
|
||||||
this->vwork[30] = D_edisplay_801615D0;
|
this->vwork[30] = D_edisplay_801615D0;
|
||||||
Display_SetSecondLight(&this->obj.pos);
|
Display_SetSecondLight(&this->obj.pos);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_BOSS, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Effect_DrawOnRails(Effect* this, s32 arg1) {
|
void Effect_DrawOnRails(Effect* this, s32 arg1) {
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_EFFECT, this);
|
||||||
|
|
||||||
if ((arg1 < 0) && (this->obj.pos.y < 7.0f)) {
|
if ((arg1 < 0) && (this->obj.pos.y < 7.0f)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1348,16 +1380,19 @@ void Effect_DrawOnRails(Effect* this, s32 arg1) {
|
|||||||
Object_SetMatrix(&this->obj, 0);
|
Object_SetMatrix(&this->obj, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_EFFECT, this){
|
||||||
if (this->info.draw != NULL) {
|
if (this->info.draw != NULL) {
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Effect_DrawAllRange(Effect* this) {
|
void Effect_DrawAllRange(Effect* this) {
|
||||||
Vec3f src = { 0.0f, 0.0f, 0.0f };
|
Vec3f src = { 0.0f, 0.0f, 0.0f };
|
||||||
Vec3f dest;
|
Vec3f dest;
|
||||||
f32 minZ;
|
f32 minZ;
|
||||||
u8 drawn = false;
|
u8 drawn = false;
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_EFFECT, this);
|
||||||
|
|
||||||
if (this->info.unk_14 == -1) {
|
if (this->info.unk_14 == -1) {
|
||||||
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + gPathProgress,
|
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y + gCameraShakeY, this->obj.pos.z + gPathProgress,
|
||||||
@ -1383,8 +1418,10 @@ void Effect_DrawAllRange(Effect* this) {
|
|||||||
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_EFFECT, this){
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
drawn = true;
|
drawn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1402,6 +1439,8 @@ void Item_Draw(Item* this, s32 arg1) {
|
|||||||
Vec3f dest;
|
Vec3f dest;
|
||||||
u8 drawn;
|
u8 drawn;
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_ITEM, this);
|
||||||
|
|
||||||
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY);
|
Matrix_Translate(gGfxMatrix, this->obj.pos.x, this->obj.pos.y, this->obj.pos.z + gPathProgress, MTXF_APPLY);
|
||||||
Matrix_MultVec3f(gGfxMatrix, &src, &dest);
|
Matrix_MultVec3f(gGfxMatrix, &src, &dest);
|
||||||
|
|
||||||
@ -1416,12 +1455,14 @@ void Item_Draw(Item* this, s32 arg1) {
|
|||||||
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
Matrix_RotateX(gGfxMatrix, this->obj.rot.x * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
Matrix_RotateZ(gGfxMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ITEM, this){
|
||||||
if (this->info.drawType == 0) {
|
if (this->info.drawType == 0) {
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
} else {
|
} else {
|
||||||
this->info.draw(&this->obj);
|
this->info.draw(&this->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
drawn = true;
|
drawn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1584,6 +1625,8 @@ void Scenery360_Draw(Scenery360* this) {
|
|||||||
Vec3f src = { 0.0f, 0.0f, 0.0f };
|
Vec3f src = { 0.0f, 0.0f, 0.0f };
|
||||||
Vec3f dest;
|
Vec3f dest;
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_SCENERY360, this);
|
||||||
|
|
||||||
f32 behindZdist = 1000.0f;
|
f32 behindZdist = 1000.0f;
|
||||||
f32 frontZdist = -12000.0f;
|
f32 frontZdist = -12000.0f;
|
||||||
f32 xyOffsetBounds = 2000.0f + 1000.0f;
|
f32 xyOffsetBounds = 2000.0f + 1000.0f;
|
||||||
@ -1636,12 +1679,16 @@ check:
|
|||||||
Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY);
|
Matrix_RotateY(gGfxMatrix, M_PI / 2, MTXF_APPLY);
|
||||||
Matrix_Translate(gGfxMatrix, -551.0f, 0.0f, 0.0f, MTXF_APPLY);
|
Matrix_Translate(gGfxMatrix, -551.0f, 0.0f, 0.0f, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SCENERY360, this){
|
||||||
gSPDisplayList(gMasterDisp++, D_VE2_6007650);
|
gSPDisplayList(gMasterDisp++, D_VE2_6007650);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
|
Matrix_RotateY(gGfxMatrix, this->obj.rot.y * M_DTOR, MTXF_APPLY);
|
||||||
Matrix_SetGfxMtx(&gMasterDisp);
|
Matrix_SetGfxMtx(&gMasterDisp);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_SCENERY360, this){
|
||||||
gSPDisplayList(gMasterDisp++, this->info.dList);
|
gSPDisplayList(gMasterDisp++, this->info.dList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "assets/ast_solar.h"
|
#include "assets/ast_solar.h"
|
||||||
#include "assets/ast_ve1_boss.h"
|
#include "assets/ast_ve1_boss.h"
|
||||||
#include "assets/ast_zoness.h"
|
#include "assets/ast_zoness.h"
|
||||||
|
#include "port/hooks/Events.h"
|
||||||
|
|
||||||
s32 gTeamEventActorIndex[4] = { 0, 0, 0, 0 };
|
s32 gTeamEventActorIndex[4] = { 0, 0, 0, 0 };
|
||||||
s32 gCallVoiceParam = 0;
|
s32 gCallVoiceParam = 0;
|
||||||
@ -3880,6 +3881,8 @@ void ActorEvent_Draw(ActorEvent* this) {
|
|||||||
s16 savedState;
|
s16 savedState;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
|
|
||||||
|
CALL_CANCELLABLE_RETURN_EVENT(ObjectDrawPreSetupEvent, OBJECT_TYPE_ACTOR_EVENT, this);
|
||||||
|
|
||||||
if (this->timer_0C6 && (this->eventType != EVID_MA_RAILROAD_CART) && (this->eventType != EVID_SY_LASER_TURRET) &&
|
if (this->timer_0C6 && (this->eventType != EVID_MA_RAILROAD_CART) && (this->eventType != EVID_SY_LASER_TURRET) &&
|
||||||
(this->eventType != EVID_SY_SHIP_WINDOWS)) {
|
(this->eventType != EVID_SY_SHIP_WINDOWS)) {
|
||||||
if ((this->eventType != EVID_ME_METEOR_1) && (this->eventType != EVID_ME_METEOR_2) &&
|
if ((this->eventType != EVID_ME_METEOR_1) && (this->eventType != EVID_ME_METEOR_2) &&
|
||||||
@ -3925,19 +3928,24 @@ void ActorEvent_Draw(ActorEvent* this) {
|
|||||||
case EVID_WZ_PILLAR_2:
|
case EVID_WZ_PILLAR_2:
|
||||||
case EVID_WZ_METEOR_1:
|
case EVID_WZ_METEOR_1:
|
||||||
case EVID_WZ_METEOR_2:
|
case EVID_WZ_METEOR_2:
|
||||||
case EVID_WZ_GATE:
|
case EVID_WZ_GATE: {
|
||||||
RCP_SetupDL(&gMasterDisp, SETUPDL_34);
|
RCP_SetupDL(&gMasterDisp, SETUPDL_34);
|
||||||
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
|
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
|
||||||
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16],
|
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, (s32) this->fwork[15], (s32) this->fwork[16],
|
||||||
(s32) this->fwork[17], 255);
|
(s32) this->fwork[17], 255);
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR_EVENT, this){
|
||||||
gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList);
|
gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList);
|
||||||
|
}
|
||||||
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
|
gDPSetTextureFilter(gMasterDisp++, G_TF_BILERP);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default: {
|
||||||
|
CALL_CANCELLABLE_EVENT(ObjectDrawPostSetupEvent, OBJECT_TYPE_ACTOR_EVENT, this){
|
||||||
if ((this->eventType < EVID_200) && (sEventActorInfo[this->eventType].dList != NULL)) {
|
if ((this->eventType < EVID_200) && (sEventActorInfo[this->eventType].dList != NULL)) {
|
||||||
gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList);
|
gSPDisplayList(gMasterDisp++, sEventActorInfo[this->eventType].dList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (this->eventType) {
|
switch (this->eventType) {
|
||||||
case EVID_TI_GREAT_FOX:
|
case EVID_TI_GREAT_FOX:
|
||||||
@ -4217,6 +4225,7 @@ void ActorEvent_Draw(ActorEvent* this) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void func_enmy2_800763A4(Actor* this) {
|
void func_enmy2_800763A4(Actor* this) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
@ -3654,10 +3654,7 @@ void HUD_Draw(void) {
|
|||||||
s32 i;
|
s32 i;
|
||||||
s32 goldRings;
|
s32 goldRings;
|
||||||
bool medalStatus;
|
bool medalStatus;
|
||||||
CALL_EVENT(DrawGlobalHUDPreEvent);
|
CALL_CANCELLABLE_RETURN_EVENT(DrawGlobalHUDPreEvent);
|
||||||
if (DrawGlobalHUDPreEvent_.event.cancelled){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
|
gDPSetTextureFilter(gMasterDisp++, G_TF_POINT);
|
||||||
|
|
||||||
|
@ -3155,8 +3155,7 @@ void Player_TankCannon(Player* player) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!PlayerActionPreShootEvent_.event.cancelled){
|
|
||||||
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3170,10 +3169,7 @@ void Player_ArwingLaser(Player* player) {
|
|||||||
laser = LASERS_SINGLE;
|
laser = LASERS_SINGLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CALL_EVENT(PlayerActionPreShootEvent, player, laser);
|
CALL_CANCELLABLE_RETURN_EVENT(PlayerActionPreShootEvent, player, laser);
|
||||||
if (PlayerActionPreShootEvent_.event.cancelled){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (laser) {
|
switch (laser) {
|
||||||
case LASERS_SINGLE:
|
case LASERS_SINGLE:
|
||||||
@ -3213,11 +3209,7 @@ void Player_SmartBomb(Player* player) {
|
|||||||
|
|
||||||
if ((gBombCount[player->num] != 0) && (gBombButton[player->num] & gInputPress->button) &&
|
if ((gBombCount[player->num] != 0) && (gBombButton[player->num] & gInputPress->button) &&
|
||||||
(gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].obj.status == SHOT_FREE)) {
|
(gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].obj.status == SHOT_FREE)) {
|
||||||
CALL_EVENT(PlayerActionPreBombEvent, player);
|
CALL_CANCELLABLE_RETURN_EVENT(PlayerActionPreBombEvent, player);
|
||||||
if (PlayerActionPreBombEvent_.event.cancelled)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gVersusMode) {
|
if (gVersusMode) {
|
||||||
gBombCount[player->num] = 0;
|
gBombCount[player->num] = 0;
|
||||||
|
@ -1265,6 +1265,20 @@ Gfx gRcpSetupDLs[][9] = {
|
|||||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE),
|
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE),
|
||||||
gsSPEndDisplayList(),
|
gsSPEndDisplayList(),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
/* SETUPDL_29_POINT */
|
||||||
|
gsDPPipeSync(),
|
||||||
|
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
||||||
|
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
||||||
|
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||||
|
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_PASS2),
|
||||||
|
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||||
|
gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 3, G_AC_NONE | G_ZS_PIXEL),
|
||||||
|
gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
|
||||||
|
gsSPSetOtherModeHi(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||||
|
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE),
|
||||||
|
gsSPEndDisplayList(),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
/* SETUPDL_36_POINT */
|
/* SETUPDL_36_POINT */
|
||||||
gsDPPipeSync(),
|
gsDPPipeSync(),
|
||||||
|
@ -1213,10 +1213,7 @@ void Aquas_BlueMarineTorpedo(Player* player) {
|
|||||||
|
|
||||||
for (i = 15, shot = &gPlayerShots[15]; i < ARRAY_COUNT(gPlayerShots); i++, shot++) {
|
for (i = 15, shot = &gPlayerShots[15]; i < ARRAY_COUNT(gPlayerShots); i++, shot++) {
|
||||||
if (shot->obj.status == SHOT_FREE) {
|
if (shot->obj.status == SHOT_FREE) {
|
||||||
CALL_EVENT(PlayerActionPreBombEvent, player)
|
CALL_CANCELLABLE_RETURN_EVENT(PlayerActionPreBombEvent, player);
|
||||||
if (PlayerActionPreBombEvent_.event.cancelled){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Player_SetupArwingShot(player, shot, 0.0f, 0.0f, PLAYERSHOT_LOCK_ON, 50.0f);
|
Player_SetupArwingShot(player, shot, 0.0f, 0.0f, PLAYERSHOT_LOCK_ON, 50.0f);
|
||||||
AUDIO_PLAY_SFX(NA_SE_MAR_BOMB_SHOT, shot->sfxSource, 0);
|
AUDIO_PLAY_SFX(NA_SE_MAR_BOMB_SHOT, shot->sfxSource, 0);
|
||||||
D_i3_801C4190[5] = i + 1;
|
D_i3_801C4190[5] = i + 1;
|
||||||
@ -1245,8 +1242,7 @@ void Aquas_BlueMarineLaser(Player* player) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!PlayerActionPreShootEvent_.event.cancelled){
|
|
||||||
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
CALL_EVENT(PlayerActionPostShootEvent, player, &gPlayerShots[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,16 @@ typedef struct {
|
|||||||
EventSystem_CallEvent(eventType##ID, &eventType##_); \
|
EventSystem_CallEvent(eventType##ID, &eventType##_); \
|
||||||
if (!eventType##_.event.cancelled)
|
if (!eventType##_.event.cancelled)
|
||||||
|
|
||||||
|
#define CHECK_IF_NOT_CANCELLED(eventType) \
|
||||||
|
if (!eventType##_.event.cancelled)
|
||||||
|
|
||||||
|
#define CALL_CANCELLABLE_RETURN_EVENT(eventType, ...) \
|
||||||
|
eventType eventType##_ = { {false}, __VA_ARGS__ }; \
|
||||||
|
EventSystem_CallEvent(eventType##ID, &eventType##_); \
|
||||||
|
if (eventType##_.event.cancelled) { \
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
|
||||||
#define REGISTER_EVENT(eventType) \
|
#define REGISTER_EVENT(eventType) \
|
||||||
eventType##ID = EventSystem_RegisterEvent();
|
eventType##ID = EventSystem_RegisterEvent();
|
||||||
|
|
||||||
|
@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OBJECT_TYPE_ACTOR,
|
OBJECT_TYPE_ACTOR,
|
||||||
|
OBJECT_TYPE_ACTOR_EVENT,
|
||||||
OBJECT_TYPE_BOSS,
|
OBJECT_TYPE_BOSS,
|
||||||
OBJECT_TYPE_SCENERY,
|
OBJECT_TYPE_SCENERY,
|
||||||
|
OBJECT_TYPE_SCENERY360,
|
||||||
OBJECT_TYPE_SPRITE,
|
OBJECT_TYPE_SPRITE,
|
||||||
OBJECT_TYPE_ITEM,
|
OBJECT_TYPE_ITEM,
|
||||||
OBJECT_TYPE_EFFECT,
|
OBJECT_TYPE_EFFECT,
|
||||||
@ -23,7 +25,12 @@ DEFINE_EVENT(ObjectUpdateEvent,
|
|||||||
void* object;
|
void* object;
|
||||||
);
|
);
|
||||||
|
|
||||||
DEFINE_EVENT(ObjectDrawEvent,
|
DEFINE_EVENT(ObjectDrawPreSetupEvent,
|
||||||
|
ObjectEventType type;
|
||||||
|
void* object;
|
||||||
|
);
|
||||||
|
|
||||||
|
DEFINE_EVENT(ObjectDrawPostSetupEvent,
|
||||||
ObjectEventType type;
|
ObjectEventType type;
|
||||||
void* object;
|
void* object;
|
||||||
);
|
);
|
||||||
|
@ -193,6 +193,65 @@ void OnPlayerShootPost(PlayerActionPostShootEvent* event) {
|
|||||||
event->shot->timer *= CVarGetInteger("gLaserRangeMult", 100) / 100.0f;
|
event->shot->timer *= CVarGetInteger("gLaserRangeMult", 100) / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnItemGoldRingDraw(ObjectDrawPostSetupEvent* event) {
|
||||||
|
if (event->type != OBJECT_TYPE_ITEM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item* item = (Item*) event->object;
|
||||||
|
if (item->obj.id != OBJ_ITEM_GOLD_RING || CVarGetInteger("gRestoreBetaCoin", 0) != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event->event.cancelled = true;
|
||||||
|
RCP_SetupDL(&gMasterDisp, SETUPDL_29_POINT);
|
||||||
|
Graphics_SetScaleMtx(item->width * 2.0f);
|
||||||
|
gSPDisplayList(gMasterDisp++, D_101D870);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnItemGoldRingUpdate(ObjectUpdateEvent* event){
|
||||||
|
if (event->type != OBJECT_TYPE_ITEM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item* item = (Item*) event->object;
|
||||||
|
if (item->obj.id != OBJ_ITEM_GOLD_RING || CVarGetInteger("gRestoreBetaCoin", 0) != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item_CheckBounds(item);
|
||||||
|
switch (item->state) {
|
||||||
|
case 0:
|
||||||
|
if (item->collected) {
|
||||||
|
item->state = 1;
|
||||||
|
gGoldRingCount[0]++;
|
||||||
|
if (gGoldRingCount[0] == 3) {
|
||||||
|
Object_PlayerSfx(gPlayer[item->playerNum].sfxSource, NA_SE_SHIELD_UPGRADE, item->playerNum);
|
||||||
|
} else if (gGoldRingCount[0] == 6) {
|
||||||
|
Object_PlayerSfx(gPlayer[item->playerNum].sfxSource, NA_SE_ONE_UP, item->playerNum);
|
||||||
|
if (gCurrentLevel != LEVEL_TRAINING) {
|
||||||
|
gLifeCount[item->playerNum]++;
|
||||||
|
}
|
||||||
|
gPlayer[item->playerNum].heal += 32;
|
||||||
|
BonusText_Display(gPlayer[item->playerNum].pos.x, gPlayer[item->playerNum].pos.y,
|
||||||
|
gPlayer[item->playerNum].trueZpos, BONUS_TEXT_1UP);
|
||||||
|
} else {
|
||||||
|
gPlayer[item->playerNum].heal += 32;
|
||||||
|
Object_PlayerSfx(gPlayer[item->playerNum].sfxSource, NA_SE_GOLD_RING, item->playerNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item->timer_48 == 1) {
|
||||||
|
Object_Kill(&item->obj, item->sfxSource);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
ItemSupplyRing_Update(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PortEnhancements_Init() {
|
void PortEnhancements_Init() {
|
||||||
PortEnhancements_Register();
|
PortEnhancements_Register();
|
||||||
|
|
||||||
@ -201,6 +260,9 @@ void PortEnhancements_Init() {
|
|||||||
REGISTER_LISTENER(GamePostUpdateEvent, OnGameUpdatePost, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(GamePostUpdateEvent, OnGameUpdatePost, EVENT_PRIORITY_NORMAL);
|
||||||
REGISTER_LISTENER(PlayerPostUpdateEvent, OnPlayerUpdatePost, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(PlayerPostUpdateEvent, OnPlayerUpdatePost, EVENT_PRIORITY_NORMAL);
|
||||||
|
|
||||||
|
REGISTER_LISTENER(ObjectUpdateEvent, OnItemGoldRingUpdate, EVENT_PRIORITY_NORMAL);
|
||||||
|
REGISTER_LISTENER(ObjectDrawPostSetupEvent, OnItemGoldRingDraw, EVENT_PRIORITY_NORMAL);
|
||||||
|
|
||||||
// Register Action listeners
|
// Register Action listeners
|
||||||
REGISTER_LISTENER(PlayerActionBoostEvent, OnPlayerBoost, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(PlayerActionBoostEvent, OnPlayerBoost, EVENT_PRIORITY_NORMAL);
|
||||||
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
|
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
|
||||||
@ -236,7 +298,8 @@ void PortEnhancements_Register() {
|
|||||||
// Register actor events
|
// Register actor events
|
||||||
REGISTER_EVENT(ObjectInitEvent);
|
REGISTER_EVENT(ObjectInitEvent);
|
||||||
REGISTER_EVENT(ObjectUpdateEvent);
|
REGISTER_EVENT(ObjectUpdateEvent);
|
||||||
REGISTER_EVENT(ObjectDrawEvent);
|
REGISTER_EVENT(ObjectDrawPreSetupEvent);
|
||||||
|
REGISTER_EVENT(ObjectDrawPostSetupEvent);
|
||||||
REGISTER_EVENT(ObjectDestroyEvent);
|
REGISTER_EVENT(ObjectDestroyEvent);
|
||||||
|
|
||||||
// Register player action events
|
// Register player action events
|
||||||
|
@ -469,6 +469,10 @@ void DrawEnhancementsMenu() {
|
|||||||
.tooltip = "Restores the missile cutscene bug present in JP 1.0"
|
.tooltip = "Restores the missile cutscene bug present in JP 1.0"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
UIWidgets::CVarCheckbox("Beta: Restore beta coin", "gRestoreBetaCoin", {
|
||||||
|
.tooltip = "Restores the beta coin that got replaced with the gold ring"
|
||||||
|
});
|
||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user