mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-13 01:57:18 -07:00
Merge remote-tracking branch 'origin/develop' into develop->develop-rando
This commit is contained in:
commit
35b4da74cb
100 changed files with 1224 additions and 612 deletions
|
@ -239,16 +239,15 @@ void GameState_ReqPadData(GameState* gameState) {
|
|||
PadMgr_RequestPadData(&gPadMgr, &gameState->input[0], 1);
|
||||
}
|
||||
|
||||
// OTRTODO
|
||||
int fbTest = -1;
|
||||
// Framebuffer for the Link preview on the pause menu equipment sub-screen
|
||||
int gPauseLinkFrameBuffer = -1;
|
||||
|
||||
void GameState_Update(GameState* gameState) {
|
||||
GraphicsContext* gfxCtx = gameState->gfxCtx;
|
||||
|
||||
if (fbTest == -1)
|
||||
{
|
||||
fbTest = gfx_create_framebuffer(64, 112, SCREEN_WIDTH, SCREEN_HEIGHT, true);
|
||||
//fbTest = gfx_create_framebuffer(256, 512);
|
||||
if (gPauseLinkFrameBuffer == -1) {
|
||||
gPauseLinkFrameBuffer = gfx_create_framebuffer(PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT,
|
||||
PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, true);
|
||||
}
|
||||
|
||||
GameState_SetFrameBuffer(gfxCtx);
|
||||
|
@ -467,7 +466,7 @@ void GameState_Destroy(GameState* gameState) {
|
|||
// Performing clear skeletons before unload resources fixes an actor heap corruption crash due to the skeleton patching system.
|
||||
ResourceMgr_ClearSkeletons();
|
||||
|
||||
if (CVarGetInteger(CVAR_ALT_ASSETS, 0)) {
|
||||
if (ResourceMgr_IsAltAssetsEnabled()) {
|
||||
ResourceUnloadDirectory("alt/*");
|
||||
gfx_texture_cache_clear();
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ static const ALIGN_ASSET(2) char rGfxPrintFontDataAlt[] = drGfxPrintFontDataAlt;
|
|||
// https://github.com/HarbourMasters/Shipwright/issues/2762
|
||||
typedef enum {hardcoded, otrDefault, otrAlt} font_texture_t;
|
||||
font_texture_t GfxPrint_TextureToUse() {
|
||||
if (CVarGetInteger(CVAR_ALT_ASSETS, 0) && ResourceMgr_FileExists(rGfxPrintFontDataAlt)) {
|
||||
if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileExists(rGfxPrintFontDataAlt)) {
|
||||
// If we have alt assets enabled, and we have alt prefixed font texture, use that
|
||||
return otrAlt;
|
||||
} else if (ResourceMgr_FileExists(rGfxPrintFontData)) {
|
||||
|
|
|
@ -1228,14 +1228,6 @@ void Actor_Init(Actor* actor, PlayState* play) {
|
|||
actor->uncullZoneForward = 1000.0f;
|
||||
actor->uncullZoneScale = 350.0f;
|
||||
actor->uncullZoneDownward = 700.0f;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
||||
&& (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
||||
actor->uncullZoneForward = 32767.0f;
|
||||
actor->uncullZoneScale = 32767.0f;
|
||||
actor->uncullZoneDownward = 32767.0f;
|
||||
}
|
||||
CollisionCheck_InitInfo(&actor->colChkInfo);
|
||||
actor->floorBgId = BGCHECK_SCENE;
|
||||
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
|
||||
|
@ -2897,34 +2889,93 @@ s32 func_800314B0(PlayState* play, Actor* actor) {
|
|||
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) {
|
||||
f32 var;
|
||||
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
||||
&& (play->sceneNum != SCENE_DODONGOS_CAVERN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
|
||||
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
|
||||
|
||||
// #region SoH [Widescreen support]
|
||||
// Doors will cull quite noticeably on wider screens. For these actors the zone is increased
|
||||
f32 limit = 1.0f;
|
||||
if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger(CVAR_GENERAL("IncreaseDoorUncullZones"), 1)) {
|
||||
limit = 2.0f;
|
||||
}
|
||||
|
||||
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < limit) &&
|
||||
(((arg2->y + actor->uncullZoneDownward) * var) > -limit) &&
|
||||
(((arg2->y - actor->uncullZoneScale) * var) < limit)) {
|
||||
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) &&
|
||||
(((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) &&
|
||||
(((arg2->y - actor->uncullZoneScale) * var) < 1.0f)) {
|
||||
return true;
|
||||
}
|
||||
// #endregion
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// #region SOH [Enhancements] Allows us to increase the draw and update distance independently,
|
||||
// mostly a modified version of the function above and additional tweaks for some specfic actors
|
||||
s32 Ship_CalcShouldDrawAndUpdate(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW, bool* shouldDraw,
|
||||
bool* shouldUpdate) {
|
||||
f32 clampedProjectedW;
|
||||
|
||||
// Check if the actor passes its original/vanilla culling requirements
|
||||
if (func_800314D4(play, actor, projectedPos, projectedW)) {
|
||||
*shouldUpdate = true;
|
||||
*shouldDraw = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Skip cutscne actors that depend on culling to hide from camera pans
|
||||
if (actor->id == ACTOR_EN_VIEWER) {
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 multiplier = CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1);
|
||||
multiplier = MAX(multiplier, 1);
|
||||
|
||||
// Some actors have a really short forward value, so we need to add to it before the multiplier to increase the
|
||||
// final strength of the forward culling
|
||||
f32 adder = (actor->uncullZoneForward < 500) ? 1000.0f : 0.0f;
|
||||
|
||||
if ((projectedPos->z > -actor->uncullZoneScale) &&
|
||||
(projectedPos->z < (((actor->uncullZoneForward + adder) * multiplier) + actor->uncullZoneScale))) {
|
||||
clampedProjectedW = (projectedW < 1.0f) ? 1.0f : 1.0f / projectedW;
|
||||
|
||||
f32 ratioAdjusted = 1.0f;
|
||||
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0)) {
|
||||
f32 originalAspectRatio = 4.0f / 3.0f;
|
||||
f32 currentAspectRatio = OTRGetAspectRatio();
|
||||
ratioAdjusted = MAX(currentAspectRatio / originalAspectRatio, 1.0f);
|
||||
}
|
||||
|
||||
if ((((fabsf(projectedPos->x) - actor->uncullZoneScale) * (clampedProjectedW / ratioAdjusted)) < 1.0f) &&
|
||||
(((projectedPos->y + actor->uncullZoneDownward) * clampedProjectedW) > -1.0f) &&
|
||||
(((projectedPos->y - actor->uncullZoneScale) * clampedProjectedW) < 1.0f)) {
|
||||
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("ExtendedCullingExcludeGlitchActors"), 0)) {
|
||||
// These actors are safe to draw without impacting glitches
|
||||
if ((actor->id == ACTOR_OBJ_BOMBIWA || actor->id == ACTOR_OBJ_HAMISHI ||
|
||||
actor->id == ACTOR_EN_ISHI) || // Boulders (hookshot through collision)
|
||||
actor->id == ACTOR_EN_GS || // Gossip stones (text delay)
|
||||
actor->id == ACTOR_EN_GE1 || // White gerudos (gate clip/archery room transition)
|
||||
actor->id == ACTOR_EN_KZ || // King Zora (unfreeze glitch)
|
||||
actor->id == ACTOR_EN_DU || // Darunia (Fire temple BK skip)
|
||||
actor->id == ACTOR_DOOR_WARP1 // Blue warps (wrong warps)
|
||||
) {
|
||||
*shouldDraw = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Skip these actors entirely as their draw funcs impacts glitches
|
||||
if ((actor->id == ACTOR_EN_SW &&
|
||||
(((actor->params & 0xE000) >> 0xD) == 1 ||
|
||||
((actor->params & 0xE000) >> 0xD) == 2)) // Gold Skulltulas (hitbox at 0,0)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
*shouldDraw = true;
|
||||
*shouldUpdate = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// #endregion
|
||||
|
||||
void func_800315AC(PlayState* play, ActorContext* actorCtx) {
|
||||
s32 invisibleActorCounter;
|
||||
Actor* invisibleActors[INVISIBLE_ACTOR_MAX];
|
||||
|
@ -2960,18 +3011,35 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
// #region SOH [Enhancement] Extended culling updates
|
||||
bool shipShouldDraw = false;
|
||||
bool shipShouldUpdate = false;
|
||||
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
|
||||
if (func_800314B0(play, actor)) {
|
||||
actor->flags |= ACTOR_FLAG_ACTIVE;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableDrawDistance"), 1) > 1 ||
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("WidescreenActorCulling"), 0)) {
|
||||
Ship_CalcShouldDrawAndUpdate(play, actor, &actor->projectedPos, actor->projectedW, &shipShouldDraw,
|
||||
&shipShouldUpdate);
|
||||
|
||||
if (shipShouldUpdate) {
|
||||
actor->flags |= ACTOR_FLAG_ACTIVE;
|
||||
} else {
|
||||
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
||||
}
|
||||
} else {
|
||||
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
||||
if (func_800314B0(play, actor)) {
|
||||
actor->flags |= ACTOR_FLAG_ACTIVE;
|
||||
} else {
|
||||
actor->flags &= ~ACTOR_FLAG_ACTIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
actor->isDrawn = false;
|
||||
|
||||
if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
|
||||
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & (ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_ACTIVE))) {
|
||||
if ((actor->init == NULL) && (actor->draw != NULL) &&
|
||||
((actor->flags & (ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_ACTIVE)) || shipShouldDraw)) {
|
||||
// #endregion
|
||||
if ((actor->flags & ACTOR_FLAG_LENS) &&
|
||||
((play->roomCtx.curRoom.lensMode == LENS_MODE_HIDE_ACTORS) ||
|
||||
play->actorCtx.lensActive || (actor->room != play->roomCtx.curRoom.num))) {
|
||||
|
|
|
@ -131,10 +131,6 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelAnimeCurve* skelCurv
|
|||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
||||
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableLOD"), 0)) {
|
||||
lod = 0;
|
||||
}
|
||||
|
||||
if (lod == 0) {
|
||||
s32 pad1;
|
||||
|
||||
|
|
|
@ -1116,7 +1116,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
|
|||
}
|
||||
}
|
||||
if (msgCtx->textDelayTimer == 0) {
|
||||
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 2);
|
||||
msgCtx->textDrawPos = i + CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
|
||||
msgCtx->textDelayTimer = msgCtx->textDelay;
|
||||
} else {
|
||||
msgCtx->textDelayTimer--;
|
||||
|
|
|
@ -2079,10 +2079,12 @@ void Pause_DrawTriforceSpot(PlayState* play, s32 showLightColumn) {
|
|||
rotation += 0x03E8;
|
||||
}
|
||||
|
||||
void Player_DrawPauseImpl(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot,
|
||||
f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width, s32 height, Vec3f* eye, Vec3f* at,
|
||||
f32 fovy, void* img1, void* img2) {
|
||||
static Vp viewport = { 128, 224, 511, 0, 128, 224, 511, 0 };
|
||||
void Player_DrawPauseImpl(PlayState* play, void* gameplayKeep, void* linkObject, SkelAnime* skelAnime, Vec3f* pos,
|
||||
Vec3s* rot, f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width, s32 height,
|
||||
Vec3f* eye, Vec3f* at, f32 fovy, void* colorFrameBuffer, void* depthFrameBuffer) {
|
||||
// Note: the viewport x and y values are overwritten below, before usage
|
||||
static Vp viewport = { (PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0,
|
||||
(PAUSE_EQUIP_PLAYER_WIDTH / 2) << 2, (PAUSE_EQUIP_PLAYER_HEIGHT / 2) << 2, G_MAXZ / 2, 0 };
|
||||
static Lights1 lights1 = gdSPDefLights1(80, 80, 80, 255, 255, 255, 84, 84, 172);
|
||||
static Vec3f lightDir = { 89.8f, 0.0f, 89.8f };
|
||||
u8 playerSwordAndShield[2];
|
||||
|
@ -2110,6 +2112,24 @@ void Player_DrawPauseImpl(PlayState* play, void* seg04, void* seg06, SkelAnime*
|
|||
gDPSetScissor(POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, width, height);
|
||||
gSPClipRatio(POLY_OPA_DISP++, FRUSTRATIO_1);
|
||||
|
||||
gDPSetColorImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, depthFrameBuffer);
|
||||
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_ZDZ(G_MAXFBZ, 0) << 16) | GPACK_ZDZ(G_MAXFBZ, 0));
|
||||
gDPFillRectangle(POLY_OPA_DISP++, 0, 0, width - 1, height - 1);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
gDPSetColorImage(POLY_OPA_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, colorFrameBuffer);
|
||||
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1));
|
||||
gDPFillRectangle(POLY_OPA_DISP++, 0, 0, width - 1, height - 1);
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
gDPSetDepthImage(POLY_OPA_DISP++, depthFrameBuffer);
|
||||
|
||||
viewport.vp.vscale[0] = viewport.vp.vtrans[0] = width * 2;
|
||||
viewport.vp.vscale[1] = viewport.vp.vtrans[1] = height * 2;
|
||||
gSPViewport(POLY_OPA_DISP++, &viewport);
|
||||
|
@ -2130,8 +2150,8 @@ void Player_DrawPauseImpl(PlayState* play, void* seg04, void* seg06, SkelAnime*
|
|||
pos->y - (CVarGetInteger(CVAR_GENERAL("PauseTriforce"), 0) ? 16 : 0), pos->z, rot);
|
||||
Matrix_Scale(scale * (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? -1 : 1), scale, scale, MTXMODE_APPLY);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x04, seg04);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, seg06);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x04, gameplayKeep);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, linkObject);
|
||||
|
||||
gSPSetLights1(POLY_OPA_DISP++, lights1);
|
||||
|
||||
|
@ -2399,14 +2419,16 @@ void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f*
|
|||
}
|
||||
|
||||
srcTable = ResourceMgr_LoadArrayByNameAsVec3s(srcTable);
|
||||
Vec3s* ogSrcTable = srcTable;
|
||||
destTable = skelAnime->jointTable;
|
||||
for (i = 0; i < skelAnime->limbCount; i++) {
|
||||
*destTable++ = *srcTable++;
|
||||
}
|
||||
free(ogSrcTable);
|
||||
}
|
||||
|
||||
|
||||
Player_DrawPauseImpl(play, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
|
||||
boots, 64, 112, &eye, &at, 60.0f, play->state.gfxCtx->curFrameBuffer,
|
||||
play->state.gfxCtx->curFrameBuffer + 0x1C00);
|
||||
boots, PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, &eye, &at, 60.0f,
|
||||
play->state.gfxCtx->curFrameBuffer,
|
||||
play->state.gfxCtx->curFrameBuffer + (PAUSE_EQUIP_PLAYER_WIDTH * PAUSE_EQUIP_PLAYER_HEIGHT));
|
||||
}
|
||||
|
|
|
@ -1539,7 +1539,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
|||
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_ZDZ(G_MAXFBZ, 0) << 16) | GPACK_ZDZ(G_MAXFBZ, 0));
|
||||
gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1);
|
||||
gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1);
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
// Fill the whole screen with the base color
|
||||
|
@ -1548,7 +1548,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
|||
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1));
|
||||
gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1);
|
||||
gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1);
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
// Draw the letterbox if applicable (uses the same color as the screen base)
|
||||
|
@ -1557,8 +1557,8 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
|||
gDPSetCycleType(OVERLAY_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(OVERLAY_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(OVERLAY_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1));
|
||||
gDPFillRectangle(OVERLAY_DISP++, 0, 0, gScreenWidth - 1, letterboxSize - 1);
|
||||
gDPFillRectangle(OVERLAY_DISP++, 0, gScreenHeight - letterboxSize, gScreenWidth - 1, gScreenHeight - 1);
|
||||
gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), letterboxSize - 1);
|
||||
gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), gScreenHeight - letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - 1);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,6 +148,8 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
|
|||
|
||||
newDList = limbDList = limb->dLists[lod];
|
||||
|
||||
play->flexLimbOverrideMTX = mtx;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
|
@ -220,6 +222,8 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||
|
||||
newDList = limbDList = rootLimb->dLists[lod];
|
||||
|
||||
play->flexLimbOverrideMTX = &mtx;
|
||||
|
||||
if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
|
@ -306,6 +310,20 @@ void SkelAnime_DrawSkeletonOpa(PlayState* play, SkelAnime* skelAnime, OverrideLi
|
|||
}
|
||||
}
|
||||
|
||||
Gfx* SkelAnime_DrawSkeleton2(PlayState* play, SkelAnime* skelAnime, OverrideLimbDrawOpa overrideLimbDraw,
|
||||
PostLimbDrawOpa postLimbDraw, void* arg, Gfx* gfx)
|
||||
{
|
||||
if (skelAnime->skeletonHeader->skeletonType == SKELANIME_TYPE_NORMAL) {
|
||||
return SkelAnime_Draw(play, skelAnime->skeleton, skelAnime->jointTable, overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
} else if (skelAnime->skeletonHeader->skeletonType == SKELANIME_TYPE_FLEX) {
|
||||
FlexSkeletonHeader* flexHeader = (FlexSkeletonHeader*)skelAnime->skeletonHeader;
|
||||
return SkelAnime_DrawFlex(play, skelAnime->skeleton, skelAnime->jointTable, flexHeader->dListCount,
|
||||
overrideLimbDraw, postLimbDraw, arg, gfx);
|
||||
}
|
||||
|
||||
return gfx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
||||
*/
|
||||
|
@ -383,6 +401,8 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton,
|
|||
|
||||
newDList = limbDList = limb->dList;
|
||||
|
||||
play->flexLimbOverrideMTX = limbMatricies;
|
||||
|
||||
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, limbIndex, &newDList, &pos, &rot, arg)) {
|
||||
Matrix_TranslateRotateZYX(&pos, &rot);
|
||||
if (newDList != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue