mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Misc Cleanup 2 (#1260)
* more misc cleanup * PR suggestions * more abs alt, csId * more cleanup, can't help it * fix incorrect sq * more fixes
This commit is contained in:
@@ -66,11 +66,10 @@ s8 PadUtils_GetRelY(Input* input) {
|
||||
}
|
||||
|
||||
void PadUtils_UpdateRelXY(Input* input) {
|
||||
s32 curX, curY;
|
||||
s32 relX, relY;
|
||||
|
||||
curX = PadUtils_GetCurX(input);
|
||||
curY = PadUtils_GetCurY(input);
|
||||
s32 curX = PadUtils_GetCurX(input);
|
||||
s32 curY = PadUtils_GetCurY(input);
|
||||
s32 relX;
|
||||
s32 relY;
|
||||
|
||||
if (curX > 7) {
|
||||
relX = (curX < 0x43) ? curX - 7 : 0x43 - 7;
|
||||
|
||||
@@ -447,7 +447,7 @@ void osSyncPrintfThreadContext(OSThread* t) {
|
||||
OSThread* Fault_FindFaultedThread() {
|
||||
OSThread* iter = __osGetActiveQueue();
|
||||
while (iter->priority != -1) {
|
||||
if (iter->priority > 0 && iter->priority < 0x7F && (iter->flags & 3)) {
|
||||
if ((iter->priority > 0) && (iter->priority < 0x7F) && (iter->flags & 3)) {
|
||||
return iter;
|
||||
}
|
||||
iter = iter->tlnext;
|
||||
|
||||
@@ -57,7 +57,7 @@ void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 col
|
||||
s32 xSize = xEnd - xStart + 1;
|
||||
s32 ySize = yEnd - yStart + 1;
|
||||
|
||||
if (xDiff > 0 && yDiff > 0) {
|
||||
if ((xDiff > 0) && (yDiff > 0)) {
|
||||
if (xDiff < xSize) {
|
||||
xSize = xDiff;
|
||||
}
|
||||
@@ -127,11 +127,11 @@ void FaultDrawer_UpdatePrintColor() {
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
osSyncPrintf(VT_RST);
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->foreColor);
|
||||
if (idx >= 0 && idx < 8) {
|
||||
if ((idx >= 0) && (idx < 8)) {
|
||||
osSyncPrintf(VT_SGR("3%d"), idx);
|
||||
}
|
||||
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->backColor);
|
||||
if (idx >= 0 && idx < 8) {
|
||||
if ((idx >= 0) && (idx < 8)) {
|
||||
osSyncPrintf(VT_SGR("4%d"), idx);
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
|
||||
for (; count != 0; count--, str++) {
|
||||
if (sFaultDrawContext->escCode) {
|
||||
sFaultDrawContext->escCode = false;
|
||||
if (*str >= '1' && *str <= '9') {
|
||||
if ((*str >= '1') && (*str <= '9')) {
|
||||
FaultDrawer_SetForeColor(sFaultDrawContext->printColors[*str - '0']);
|
||||
}
|
||||
} else {
|
||||
@@ -192,9 +192,11 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
|
||||
|
||||
sFaultDrawContext->cursorX = sFaultDrawContext->w;
|
||||
break;
|
||||
|
||||
case '\x1A':
|
||||
sFaultDrawContext->escCode = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (sFaultDrawContext->osSyncPrintfEnabled) {
|
||||
osSyncPrintf("%c", *str);
|
||||
|
||||
+1
-1
@@ -396,7 +396,7 @@ void Sched_HandleRetrace(SchedContext* sched) {
|
||||
if (sched->curBuf->updateRate2 > 0) {
|
||||
sched->curBuf->updateRate2--;
|
||||
}
|
||||
if (sched->curBuf->updateRate2 <= 0 && sched->pendingSwapBuf1 != NULL) {
|
||||
if ((sched->curBuf->updateRate2 <= 0) && (sched->pendingSwapBuf1 != NULL)) {
|
||||
Sched_RetraceUpdateFramebuffer(sched, sched->pendingSwapBuf1);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -695,7 +695,7 @@ void func_800B5814(TargetContext* targetCtx, Player* player, Actor* actor, GameS
|
||||
* Tests if current scene switch flag is set.
|
||||
*/
|
||||
s32 Flags_GetSwitch(PlayState* play, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
if ((flag >= 0) && (flag < 0x80)) {
|
||||
return play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
|
||||
}
|
||||
return 0;
|
||||
@@ -705,7 +705,7 @@ s32 Flags_GetSwitch(PlayState* play, s32 flag) {
|
||||
* Sets current scene switch flag.
|
||||
*/
|
||||
void Flags_SetSwitch(PlayState* play, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
if ((flag >= 0) && (flag < 0x80)) {
|
||||
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
|
||||
}
|
||||
}
|
||||
@@ -714,7 +714,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) {
|
||||
* Unsets current scene switch flag.
|
||||
*/
|
||||
void Flags_UnsetSwitch(PlayState* play, s32 flag) {
|
||||
if (flag >= 0 && flag < 0x80) {
|
||||
if ((flag >= 0) && (flag < 0x80)) {
|
||||
play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] &= ~(1 << (flag & 0x1F));
|
||||
}
|
||||
}
|
||||
@@ -793,7 +793,7 @@ void Flags_UnsetClearTemp(PlayState* play, s32 roomNumber) {
|
||||
* Tests if current scene collectible flag is set.
|
||||
*/
|
||||
s32 Flags_GetCollectible(PlayState* play, s32 flag) {
|
||||
if (flag > 0 && flag < 0x80) {
|
||||
if ((flag > 0) && (flag < 0x80)) {
|
||||
return play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F));
|
||||
}
|
||||
return 0;
|
||||
@@ -803,7 +803,7 @@ s32 Flags_GetCollectible(PlayState* play, s32 flag) {
|
||||
* Sets current scene collectible flag.
|
||||
*/
|
||||
void Flags_SetCollectible(PlayState* play, s32 flag) {
|
||||
if (flag > 0 && flag < 0x80) {
|
||||
if ((flag > 0) && (flag < 0x80)) {
|
||||
play->actorCtx.sceneFlags.collectible[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F);
|
||||
}
|
||||
}
|
||||
@@ -3268,12 +3268,12 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
||||
|
||||
for (i = 0; i < numTransitionActors; transitionActorList++, i++) {
|
||||
if (transitionActorList->id >= 0) {
|
||||
if ((transitionActorList->sides[0].room >= 0 &&
|
||||
(play->roomCtx.curRoom.num == transitionActorList->sides[0].room ||
|
||||
play->roomCtx.prevRoom.num == transitionActorList->sides[0].room)) ||
|
||||
(transitionActorList->sides[1].room >= 0 &&
|
||||
(play->roomCtx.curRoom.num == transitionActorList->sides[1].room ||
|
||||
play->roomCtx.prevRoom.num == transitionActorList->sides[1].room))) {
|
||||
if (((transitionActorList->sides[0].room >= 0) &&
|
||||
((play->roomCtx.curRoom.num == transitionActorList->sides[0].room) ||
|
||||
(play->roomCtx.prevRoom.num == transitionActorList->sides[0].room))) ||
|
||||
((transitionActorList->sides[1].room >= 0) &&
|
||||
((play->roomCtx.curRoom.num == transitionActorList->sides[1].room) ||
|
||||
(play->roomCtx.prevRoom.num == transitionActorList->sides[1].room)))) {
|
||||
s16 rotY = DEG_TO_BINANG((transitionActorList->rotY >> 7) & 0x1FF);
|
||||
|
||||
if (Actor_SpawnAsChildAndCutscene(actorCtx, play, transitionActorList->id & 0x1FFF,
|
||||
|
||||
@@ -1920,12 +1920,14 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
|
||||
s32 bgId;
|
||||
f32 temp_f0_2;
|
||||
f32 f32temp;
|
||||
f32 nx2, nz2;
|
||||
f32 nx2;
|
||||
f32 nz2;
|
||||
Vec3f checkLineNext;
|
||||
Vec3f checkLinePrev;
|
||||
f32 n2XZDist;
|
||||
f32 n3XZDist;
|
||||
f32 nx3, nz3;
|
||||
f32 nx3;
|
||||
f32 nz3;
|
||||
s32 bccFlags;
|
||||
Vec3f posIntersect2;
|
||||
s32 bgId2;
|
||||
|
||||
+3
-2
@@ -6777,8 +6777,9 @@ s32 Camera_Special5(Camera* camera) {
|
||||
spA4 = BINANG_SUB(focalActorPosRot->rot.y, sp6C.yaw);
|
||||
sp74.r = roData->eyeDist;
|
||||
rand = Rand_ZeroOne();
|
||||
sp74.yaw = BINANG_ROT180(focalActorPosRot->rot.y) +
|
||||
(s16)(spA4 < 0 ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
|
||||
sp74.yaw =
|
||||
BINANG_ROT180(focalActorPosRot->rot.y) +
|
||||
(s16)((spA4 < 0) ? -(s16)(0x1553 + (s16)(rand * 2730.0f)) : (s16)(0x1553 + (s16)(rand * 2730.0f)));
|
||||
sp74.pitch = roData->pitch;
|
||||
OLib_AddVecGeoToVec3f(eyeNext, &spA8.pos, &sp74);
|
||||
*eye = *eyeNext;
|
||||
|
||||
@@ -790,7 +790,7 @@ DamageTable sDamageTablePresets[] = {
|
||||
* is out of range.
|
||||
*/
|
||||
DamageTable* DamageTable_Get(s32 index) {
|
||||
if (index < 0 || index > ARRAY_COUNT(sDamageTablePresets) - 1) {
|
||||
if ((index < 0) || (index >= ARRAY_COUNT(sDamageTablePresets))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+33
-35
@@ -753,7 +753,7 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
|
||||
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < this->numElements - 1; i++) {
|
||||
for (i = 0; i < this->numElements - 1; i++, j += 4) {
|
||||
if (this->drawMode == 1) {
|
||||
alphaRatio = (f32)this->elements[i].timer / (f32)this->elemDuration;
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x80, this->altPrimColor.r, this->altPrimColor.g,
|
||||
@@ -761,45 +761,43 @@ void EffectBlure_DrawSimpleVertices(GraphicsContext* gfxCtx, EffectBlure* this,
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
}
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
|
||||
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
||||
|
||||
if (this->flags & 4) {
|
||||
sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) * 0.5f;
|
||||
sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) * 0.5f;
|
||||
sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) * 0.5f;
|
||||
sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) * 0.5f;
|
||||
sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) * 0.5f;
|
||||
sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) * 0.5f;
|
||||
|
||||
Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
|
||||
scale = sqrtf(SQXYZ(sp198));
|
||||
|
||||
if (fabsf(scale) > 0.0005f) {
|
||||
scale = 1.0f / scale;
|
||||
Math_Vec3f_Scale(&sp198, scale);
|
||||
|
||||
SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
|
||||
SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
|
||||
SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
|
||||
SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
|
||||
SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
|
||||
if (mtx == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
|
||||
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
}
|
||||
if (!(this->flags & 4)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
j += 4;
|
||||
sp1B0.x = ((f32)vtx[4 * i + 0].v.ob[0] + (f32)vtx[4 * i + 1].v.ob[0]) / 2.0f;
|
||||
sp1B0.y = ((f32)vtx[4 * i + 0].v.ob[1] + (f32)vtx[4 * i + 1].v.ob[1]) / 2.0f;
|
||||
sp1B0.z = ((f32)vtx[4 * i + 0].v.ob[2] + (f32)vtx[4 * i + 1].v.ob[2]) / 2.0f;
|
||||
sp1A4.x = ((f32)vtx[4 * i + 2].v.ob[0] + (f32)vtx[4 * i + 3].v.ob[0]) / 2.0f;
|
||||
sp1A4.y = ((f32)vtx[4 * i + 2].v.ob[1] + (f32)vtx[4 * i + 3].v.ob[1]) / 2.0f;
|
||||
sp1A4.z = ((f32)vtx[4 * i + 2].v.ob[2] + (f32)vtx[4 * i + 3].v.ob[2]) / 2.0f;
|
||||
|
||||
Math_Vec3f_Diff(&sp1A4, &sp1B0, &sp198);
|
||||
scale = sqrtf(SQXYZ(sp198));
|
||||
|
||||
if (fabsf(scale) > 0.0005f) {
|
||||
scale = 1.0f / scale;
|
||||
Math_Vec3f_Scale(&sp198, scale);
|
||||
|
||||
SkinMatrix_SetTranslate(&sp154, sp1B0.x, sp1B0.y, sp1B0.z);
|
||||
SkinMatrix_SetRotateAroundVec(&sp114, 0x3FFF, sp198.x, sp198.y, sp198.z);
|
||||
SkinMatrix_MtxFMtxFMult(&sp154, &sp114, &spD4);
|
||||
SkinMatrix_SetTranslate(&sp154, -sp1B0.x, -sp1B0.y, -sp1B0.z);
|
||||
SkinMatrix_MtxFMtxFMult(&spD4, &sp154, &sp94);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &sp94);
|
||||
if (mtx == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(POLY_XLU_DISP++, &vtx[j], 4, 0);
|
||||
gSP2Triangles(POLY_XLU_DISP++, 0, 1, 3, 0, 0, 3, 2, 0);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+32
-34
@@ -187,33 +187,31 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.sparks[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
|
||||
if (!sEffectContext.sparks[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
|
||||
}
|
||||
|
||||
for (i = 0; i < BLURE_COUNT; i++) {
|
||||
if (1) {
|
||||
if (gfxCtx) {}
|
||||
} // necessary to match
|
||||
if (sEffectContext.blures[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
|
||||
if (!sEffectContext.blures[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
|
||||
}
|
||||
|
||||
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.shieldParticles[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
|
||||
if (!sEffectContext.shieldParticles[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
|
||||
}
|
||||
|
||||
if (1) {} // necessary to match
|
||||
for (i = 0; i < TIRE_MARK_COUNT; i++) {
|
||||
if (sEffectContext.tireMarks[i].status.active) {
|
||||
sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
|
||||
if (!sEffectContext.tireMarks[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
sEffectInfoTable[EFFECT_TIRE_MARK].draw(&sEffectContext.tireMarks[i].effect, gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,38 +219,38 @@ void Effect_UpdateAll(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < SPARK_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.sparks[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
|
||||
Effect_Destroy(play, i);
|
||||
}
|
||||
if (!sEffectContext.sparks[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
if (sEffectInfoTable[EFFECT_SPARK].update(&sEffectContext.sparks[i].effect) == 1) {
|
||||
Effect_Destroy(play, i);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < BLURE_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.blures[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT);
|
||||
}
|
||||
if (!sEffectContext.blures[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
if (sEffectInfoTable[EFFECT_BLURE1].update(&sEffectContext.blures[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.shieldParticles[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
|
||||
}
|
||||
if (!sEffectContext.shieldParticles[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
if (sEffectInfoTable[EFFECT_SHIELD_PARTICLE].update(&sEffectContext.shieldParticles[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < TIRE_MARK_COUNT; i++) {
|
||||
if (1) {} // necessary to match
|
||||
if (sEffectContext.tireMarks[i].status.active) {
|
||||
if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
|
||||
}
|
||||
if (!sEffectContext.tireMarks[i].status.active) {
|
||||
continue;
|
||||
}
|
||||
if (sEffectInfoTable[EFFECT_TIRE_MARK].update(&sEffectContext.tireMarks[i].effect) == 1) {
|
||||
Effect_Destroy(play, i + SPARK_COUNT + BLURE_COUNT + SHIELD_PARTICLE_COUNT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
|
||||
Camera* retCam;
|
||||
s32 csType = 0;
|
||||
|
||||
if ((csId < 0) || (sCutsceneMgr.csId != CS_ID_NONE)) {
|
||||
if ((csId <= CS_ID_NONE) || (sCutsceneMgr.csId != CS_ID_NONE)) {
|
||||
return csId;
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
|
||||
s16 CutsceneManager_Stop(s16 csId) {
|
||||
ActorCutscene* csEntry;
|
||||
|
||||
if (csId < 0) {
|
||||
if (csId <= CS_ID_NONE) {
|
||||
return csId;
|
||||
}
|
||||
|
||||
@@ -468,28 +468,28 @@ ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) {
|
||||
}
|
||||
|
||||
s16 CutsceneManager_GetAdditionalCsId(s16 csId) {
|
||||
if (csId < 0) {
|
||||
if (csId <= CS_ID_NONE) {
|
||||
return CS_ID_NONE;
|
||||
}
|
||||
return CutsceneManager_GetCutsceneEntryImpl(csId)->additionalCsId;
|
||||
}
|
||||
|
||||
s16 CutsceneManager_GetLength(s16 csId) {
|
||||
if (csId < 0) {
|
||||
if (csId <= CS_ID_NONE) {
|
||||
return -1;
|
||||
}
|
||||
return CutsceneManager_GetCutsceneEntryImpl(csId)->length;
|
||||
}
|
||||
|
||||
s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId) {
|
||||
if (csId < 0) {
|
||||
if (csId <= CS_ID_NONE) {
|
||||
return -1;
|
||||
}
|
||||
return CutsceneManager_GetCutsceneEntryImpl(csId)->scriptIndex;
|
||||
}
|
||||
|
||||
s16 CutsceneManager_GetCutsceneCustomValue(s16 csId) {
|
||||
if (csId < 0) {
|
||||
if (csId <= CS_ID_NONE) {
|
||||
return -1;
|
||||
}
|
||||
return CutsceneManager_GetCutsceneEntryImpl(csId)->customValue;
|
||||
|
||||
@@ -3867,7 +3867,6 @@ void Interface_DrawItemButtons(PlayState* play) {
|
||||
OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow(OVERLAY_DISP, gButtonBackgroundTex, 0x20, 0x20, D_801BF9D4[0],
|
||||
D_801BF9DC[0], D_801BFAF4[0], D_801BFAF4[0], D_801BF9E4[0] * 2,
|
||||
D_801BF9E4[0] * 2, 100, 255, 120, interfaceCtx->bAlpha);
|
||||
if (1) {}
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
// C-Left Button Color & Texture
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
if ((objectCtx->status[i].id < 0 ? -objectCtx->status[i].id : objectCtx->status[i].id) == objectId) {
|
||||
if (ABS_ALT(objectCtx->status[i].id) == objectId) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ void AnimatedMat_DrawMain(PlayState* play, AnimatedMaterial* matAnim, f32 alphaR
|
||||
if ((matAnim != NULL) && (matAnim->segment != 0)) {
|
||||
do {
|
||||
segment = matAnim->segment;
|
||||
segmentAbs = ((segment < 0) ? -segment : segment) + 7;
|
||||
segmentAbs = ABS_ALT(segment) + 7;
|
||||
matAnimDrawHandlers[matAnim->type](play, segmentAbs, Lib_SegmentedToVirtual(matAnim->params));
|
||||
matAnim++;
|
||||
} while (segment >= 0);
|
||||
|
||||
+11
-9
@@ -42,9 +42,6 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
|
||||
break;
|
||||
}
|
||||
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
// Actors which may be pictographed anywhere
|
||||
switch (actor->id) {
|
||||
case ACTOR_EN_KAKASI:
|
||||
@@ -71,15 +68,20 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
|
||||
case ACTOR_EN_GE2:
|
||||
seen |= PICTO_SEEN_ANYWHERE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!seen) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If actor is recordable, run its validity function and record if valid
|
||||
if (seen) {
|
||||
pictoActor = (PictoActor*)actor;
|
||||
if (pictoActor->validationFunc != NULL) {
|
||||
if ((pictoActor->validationFunc)(play, actor) == 0) {
|
||||
validCount++;
|
||||
}
|
||||
pictoActor = (PictoActor*)actor;
|
||||
if (pictoActor->validationFunc != NULL) {
|
||||
if (pictoActor->validationFunc(play, actor) == 0) {
|
||||
validCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ void Sram_GenerateRandomSaveFields(void) {
|
||||
|
||||
do {
|
||||
randBombers = Rand_S16Offset(0, 6);
|
||||
} while (randBombers <= 0 || randBombers >= 6);
|
||||
} while ((randBombers <= 0) || (randBombers >= 6));
|
||||
|
||||
gSaveContext.save.saveInfo.bomberCode[0] = randBombers;
|
||||
|
||||
@@ -558,7 +558,7 @@ void Sram_GenerateRandomSaveFields(void) {
|
||||
|
||||
do {
|
||||
randBombers = Rand_S16Offset(0, 6);
|
||||
} while (randBombers <= 0 || randBombers >= 6);
|
||||
} while ((randBombers <= 0) || (randBombers >= 6));
|
||||
|
||||
sp2A = 0;
|
||||
do {
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
*/
|
||||
void guPositionF(f32 mf[4][4], f32 rot, f32 pitch, f32 yaw, f32 scale, f32 x, f32 y, f32 z) {
|
||||
static f32 D_80134D00 = M_PI / 180.0f;
|
||||
f32 sinr, sinp, sinh;
|
||||
f32 cosr, cosp, cosh;
|
||||
f32 sinr;
|
||||
f32 sinp;
|
||||
f32 sinh;
|
||||
f32 cosr;
|
||||
f32 cosp;
|
||||
f32 cosh;
|
||||
|
||||
rot *= D_80134D00;
|
||||
pitch *= D_80134D00;
|
||||
|
||||
@@ -66,7 +66,8 @@ s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid) {
|
||||
u8 buf[BLOCKSIZE];
|
||||
u8 comp[BLOCKSIZE];
|
||||
u8 mask = 0;
|
||||
s32 i, j = 0;
|
||||
s32 i = 0;
|
||||
s32 j = 0;
|
||||
u16 index[4];
|
||||
|
||||
newid->repaired = 0xFFFFFFFF;
|
||||
|
||||
@@ -18,8 +18,10 @@ s32 osPfsChecker(OSPfs* pfs) {
|
||||
__OSInodeUnit nextNodeInFile[16];
|
||||
__OSInodeCache cache;
|
||||
s32 fixed = 0;
|
||||
u8 bank, prevBank = 254;
|
||||
s32 cc, cl;
|
||||
u8 bank = 254;
|
||||
u8 prevBank = 254;
|
||||
s32 cc;
|
||||
s32 cl;
|
||||
s32 offset;
|
||||
|
||||
ret = __osCheckId(pfs);
|
||||
|
||||
@@ -5,7 +5,7 @@ ldiv_t ldiv(long numer, long denom) {
|
||||
|
||||
val.quot = numer / denom;
|
||||
val.rem = numer - denom * val.quot;
|
||||
if (val.quot < 0 && val.rem > 0) {
|
||||
if ((val.quot < 0) && (val.rem > 0)) {
|
||||
val.quot++;
|
||||
val.rem -= denom;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ lldiv_t lldiv(long long numer, long long denom) {
|
||||
|
||||
val.quot = numer / denom;
|
||||
val.rem = numer - denom * val.quot;
|
||||
if (val.quot < 0 && val.rem > 0) {
|
||||
if ((val.quot < 0) && (val.rem > 0)) {
|
||||
val.quot++;
|
||||
val.rem -= denom;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user