timeMgr.cpp linked

also formatting
This commit is contained in:
HeartPiece 2022-08-03 20:08:07 +10:00
parent 4bdee11403
commit 6e8748a23b
11 changed files with 142 additions and 144 deletions

View File

@ -189,6 +189,7 @@ pikmin2.usa.dol: `sha1: 90d328bf8f190c90472e8c19e7e53c6ad0fe0d1a`
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectYamashitaU/enemyStoenInfo.cpp">plugProjectYamashitaU/enemyStoenInfo.cpp</a>
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectYamashitaU/kochappyAnimator.cpp">plugProjectYamashitaU/kochappyAnimator.cpp</a>
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectYamashitaU/pelplantGenerator.cpp">plugProjectYamashitaU/pelplantGenerator.cpp</a>
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectYamashitaU/timeMgr.cpp">plugProjectYamashitaU/timeMgr.cpp</a>
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectYamashitaU/treasureLightMgr.cpp">plugProjectYamashitaU/treasureLightMgr.cpp</a>
- JSystem
- <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/data.cpp">JSystem/data.cpp</a>

View File

@ -11,9 +11,9 @@
inline float pikmin2_sinf(float x)
{
if (x < 0.0f) {
return -JMath::sincosTable_.m_table[((int)(x *= -325.9493f ) & 0x7ffU)].first;
return -JMath::sincosTable_.m_table[((int)(x *= -325.9493f) & 0x7ffU)].first;
}
return JMath::sincosTable_.m_table[((int)(x *= 325.9493f ) & 0x7ffU)].first;
return JMath::sincosTable_.m_table[((int)(x *= 325.9493f) & 0x7ffU)].first;
}
inline float pikmin2_cosf(float x)
@ -21,7 +21,7 @@ inline float pikmin2_cosf(float x)
if (x < 0.0f) {
x = -x;
}
return JMath::sincosTable_.m_table[((int)(x *= 325.9493f ) & 0x7ffU)].second;
return JMath::sincosTable_.m_table[((int)(x *= 325.9493f) & 0x7ffU)].second;
}
#endif

View File

@ -48,7 +48,7 @@ struct TimeMgrParms {
struct TimeMgr : public CNode {
TimeMgr();
virtual ~TimeMgr() { } // _00 - WEAK - from timeMgr.cpp
virtual ~TimeMgr() { } // _08 - WEAK - from timeMgr.cpp
float getRealDayTime();
float getSunGaugeRatio();

View File

@ -453,7 +453,7 @@ YAMASHITA:=\
$(BUILD_DIR)/asm/plugProjectYamashitaU/farm.o\
$(BUILD_DIR)/asm/plugProjectYamashitaU/farmMgr.o\
$(BUILD_DIR)/asm/plugProjectYamashitaU/genEnemy.o\
$(BUILD_DIR)/asm/plugProjectYamashitaU/timeMgr.o\
$(BUILD_DIR)/src/plugProjectYamashitaU/timeMgr.o\
$(BUILD_DIR)/src/plugProjectYamashitaU/pelplantGenerator.o\
$(BUILD_DIR)/src/plugProjectYamashitaU/enemyInteractActions.o\
$(BUILD_DIR)/src/plugProjectYamashitaU/enemyAnimatorBase.o\

View File

@ -73,15 +73,14 @@ void EnemyNode::makeGlobalData(MapNode* mapNode)
// get max radius of spawn
float radius = m_baseGen->m_radius;
// get random radius between 0 and max radius
radius = radius * (float) rand() / 32768.0f;
radius = radius * (float)rand() / 32768.0f;
// set random direction from 0 to 2pi (0 to 360 degrees)
m_direction = TAU * (float) rand() / 32768.0f;
m_direction = TAU * (float)rand() / 32768.0f;
// move position x and y (z) according to random radius and random direction
m_birthPos.x += radius * pikmin2_sinf(m_direction); // inlined in header
m_birthPos.z += radius * pikmin2_cosf(m_direction); // inlined in header
}
}

View File

@ -182,7 +182,7 @@ float TimeMgr::getSunGaugeRatio()
f32 var_f3 = m_currentTimeOfDay;
if (m_currentTimeOfDay < m_parms.parms.m_dayStartTime.m_value) {
var_f3 += 1.0f;
var_f3 += 24.0f;
}
return 1.0f - ((var_f3 - m_parms.parms.m_dayEndTime.m_value) / m_sunRatio);

View File

@ -202,8 +202,6 @@
.4byte 0x73706100
*/
// TODO: How is this string actually (not) used?
// DEFINE__PRINT("gameConfig");
// void fakeMatch_printGameConfig() { printf("gameConfig"); }