document gGlobalTimer and related functions

This commit is contained in:
mariob92
2024-09-02 12:35:38 +02:00
parent 98e97f4e95
commit ec98c1620c
53 changed files with 102 additions and 102 deletions

View File

@@ -27,7 +27,7 @@ void chBadShad_update(Actor *this){
this->initialized = 1;
this->marker->collidable = 0;
}
if(!this->despawn_flag && this->unk1C_x < (f32)(func_8023DB5C() - 1) ){
if(!this->despawn_flag && this->unk1C_x < (f32)(globalTimer_getTime() - 1) ){
//unlink
if(this->unk104){
marker_getActor(this->unk104)->unk104 = 0;
@@ -116,7 +116,7 @@ void func_802D71A0(s32 this, s32 arg1){
if(sp3C){
marker_getActor(marker)->unk104 = sp3C->marker;
sp3C->unk104 = marker;
sp3C->unk1C[0] = func_8023DB5C();
sp3C->unk1C[0] = globalTimer_getTime();
sp3C->unk1C[1] = sp40;
sp3C->unk28 = sp28;
}
@@ -145,7 +145,7 @@ void func_802D729C(Actor *actor, f32 arg1){
if(sp1C->despawn_flag == TRUE)
return;
if(!((func_8023DB5C() ^ actor->marker->actrArrayIdx) & 0x7)){
if(!((globalTimer_getTime() ^ actor->marker->actrArrayIdx) & 0x7)){
sp1C->unk28 = func_802D7038(actor);
sp1C->position_x = D_8037DE10[0];
sp1C->position_y = D_8037DE10[1] + 6.0f;
@@ -158,6 +158,6 @@ void func_802D729C(Actor *actor, f32 arg1){
sp1C->position_x = actor->position_x;
sp1C->position_z = actor->position_z;
}
sp1C->unk1C[0] = func_8023DB5C();
sp1C->unk1C[0] = globalTimer_getTime();
sp1C->unk1C[1] = arg1;
}

View File

@@ -161,13 +161,13 @@ void func_802C6240(Actor *this){
if(!func_80329030(this, 0) && func_80329480(this)){
func_80328CEC(this, (s32)this->yaw, 90, 150);
}//L802C64EC
if(!(func_8023DB5C() & 0xf))
if(!(globalTimer_getTime() & 0xf))
func_80328CEC(this, (s32)this->yaw_ideal, 10, 20);
if(!(func_8023DB5C() & 0x7))
if(!(globalTimer_getTime() & 0x7))
subaddie_maybe_set_state_position_direction(this, 1, 0.16f, 1, 0.02f);
if( !(func_8023DB5C() & 0xf)
if( !(globalTimer_getTime() & 0xf)
&& func_80329078(this, (s32)this->yaw_ideal, 150)
&& subaddie_maybe_set_state(this, 3, 0.13f)
){
@@ -191,7 +191,7 @@ void func_802C6240(Actor *this){
subaddie_set_state(this, 2);
func_802C5E80(this);
}
if(!(func_8023DB5C() & 0xf) && subaddie_maybe_set_state(this, 2, 0.08f))
if(!(globalTimer_getTime() & 0xf) && subaddie_maybe_set_state(this, 2, 0.08f))
func_802C5E80(this);
func_802C5EB8(this);
break;
@@ -356,7 +356,7 @@ Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
break;
case 4://L802C6F50
if((func_8023DB5C() & 1) == 1){
if((globalTimer_getTime() & 1) == 1){
if(func_80259808(actor->yaw)){
func_802C6E3C(0xb, sp34);
func_802C6E3C(0xa, sp34);
@@ -369,7 +369,7 @@ Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
break;
case 1://L802C6FB4
if(actor_animationIsAt(actor, 0.85f)
&& (func_8023DB5C()& 0xe) == 8
&& (globalTimer_getTime()& 0xe) == 8
&& randf() < 0.6
){
func_8034A174(func_80329934(),5, sp40);

View File

@@ -232,7 +232,7 @@ void chCrab_update(Actor *this) {
static s32 D_803670B0 = 0;
static s32 D_803670B4 = 0;
sp34 = func_8023DB5C();
sp34 = globalTimer_getTime();
sp30 = time_getDelta();
is_mutant_snippet = this->modelCacheIndex == ACTOR_F5_MUTIE_SNIPPET;
if (!this->unk16C_4) {
@@ -343,7 +343,7 @@ void chCrab_update(Actor *this) {
break;
case 4: //L802CC024
if ((func_8023DB5C() & 0xF) == 9) {
if ((globalTimer_getTime() & 0xF) == 9) {
this->yaw_ideal = (f32) func_80329784(this);
}
func_80328FB0(this, 7.0f);

View File

@@ -76,10 +76,10 @@ void chfirefx_update(Actor *this){
}//L80359934
if(subaddie_playerIsWithinSphere(this, 2000)){
if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){
if(!(func_8023DB5C() & 3) && randf() < 0.1){
if(!(globalTimer_getTime() & 3) && randf() < 0.1){
__chfirefx_spawnSmoke(this->position, this->scale);
} //L803599AC
if(!(func_8023DB5C() & 3) && randf() < 0.3){
if(!(globalTimer_getTime() & 3) && randf() < 0.3){
__chfirefx_spawnSpark(this->position, this->scale);
}
}//L803599F4

View File

@@ -200,7 +200,7 @@ void func_8035B8A8(Actor *this){
void func_8035B900(Actor *this){
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
s32 sp30 = func_8023DB5C();
s32 sp30 = globalTimer_getTime();
f32 sp2C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
@@ -346,7 +346,7 @@ void func_8035BD48(Actor *this){
func_80343DEC(this);
}
if((func_8023DB5C() &0x3F) == 7 && randf() < 0.7){
if((globalTimer_getTime() &0x3F) == 7 && randf() < 0.7){
func_8030E878(0x3f4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
}
}

View File

@@ -83,7 +83,7 @@ int func_80359F40(Actor *this, f32 arg1[3]){
f32 sp20;
sp24 = func_80257204(this->position[0], this->position[2], arg1[0], arg1[2]);
if((func_8023DB5C() & 0xF) == 4){
if((globalTimer_getTime() & 0xF) == 4){
this->velocity[2] = (f32)randi2(-45, 45);
}
sp20 = this->yaw;
@@ -177,7 +177,7 @@ void func_8035A694(Actor *this){
sp3C = this->yaw;
sp38 = this->unk28*1.5 + 1.0;
tmp_v0 = func_8023DB5C();
tmp_v0 = globalTimer_getTime();
this->yaw += sp38;
if(360.0f < this->yaw)
this->yaw -= 360.0f;

View File

@@ -113,7 +113,7 @@ void chSnowball_update(Actor *this) {
this->initialized = TRUE;
player_getPosition(sp7C);
sp7C[1] += 1.0f;
phi_a1 = (func_8023DB5C() & 1) ? 0x15 : 0x2B;
phi_a1 = (globalTimer_getTime() & 1) ? 0x15 : 0x2B;
for(i = 0; i < 3; i++){
sp58[i] = sp7C[i] + (sp7C[i] - this->unk1C[i]) * phi_a1;
}

View File

@@ -98,7 +98,7 @@ void __chSnowman_spawnHat(ActorMarker *marker){
other->velocity[0] = 34.0f;
sp28 = (func_8023DB5C() & 1)? 0x3C : 0x78;
sp28 = (globalTimer_getTime() & 1)? 0x3C : 0x78;
ml_vec3f_yaw_rotate_copy(other->velocity, other->velocity, other->yaw - sp28);
other->velocity[1] = 30.0f;
}
@@ -260,7 +260,7 @@ void chSnowman_update(Actor *this){
|| fileProgressFlag_get(0x13)
){//L802E2318
if(0.0 < local->unk4){
if( (func_8023DB5C() & 1)
if( (globalTimer_getTime() & 1)
|| func_8028ECAC() == BSGROUP_A_FLYING
){//L802E236C
local->unk4 -= dt;

View File

@@ -150,7 +150,7 @@ void chTermite_update(Actor *this) {
static s32 D_80372F48 = 0;
static s32 D_80372F4C = 0;
sp34 = func_8023DB5C();
sp34 = globalTimer_getTime();
if (!this->unk16C_4) {
marker_setCollisionScripts(this->marker, NULL, __chTermite_ow, __chTermite_die);
this->unk124_0 = this->unk138_31 = FALSE;