forked from Ports/perfect_dark
port: fix sliding doors exploding at non-60fps framerates
This commit is contained in:
1 parent
72e9e2af95
commit
32b2e9c28e
2 files changed
+10
-1
No files matched your search
@@ -7671,7 +7671,12 @@ void doorTick(struct prop *doorprop)
|
||||
}
|
||||
|
||||
// Update frac
|
||||
#ifdef PLATFORM_N64
|
||||
if (door->lastcalc60 < g_Vars.lvframe60 || g_Vars.lvupdate240 == 0) {
|
||||
#else
|
||||
// lastcalc60 actually stores lvframe240
|
||||
if (door->lastcalc60 < g_Vars.lvframe240 || g_Vars.lvupdate240 == 0) {
|
||||
#endif
|
||||
doorsCalcFrac(door);
|
||||
}
|
||||
|
||||
@@ -20333,7 +20338,11 @@ void doorsCalcFrac(struct doorobj *door)
|
||||
func0f08d460(loopdoor);
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
loopdoor->lastcalc60 = g_Vars.lvframe60;
|
||||
#else
|
||||
loopdoor->lastcalc60 = g_Vars.lvframe240; // actually use the 240hz counter for higher framerates
|
||||
#endif
|
||||
loopdoor = loopdoor->sibling;
|
||||
|
||||
if (loopdoor == door) {
|
||||
|
||||
+1
-1
@@ -1523,7 +1523,7 @@ struct doorobj { // objtype 0x01
|
||||
/*0xc4*/ s16 portalnum;
|
||||
/*0xc6*/ s8 soundtype;
|
||||
/*0xc7*/ s8 fadetime60; // counts down
|
||||
/*0xc8*/ s32 lastcalc60;
|
||||
/*0xc8*/ s32 lastcalc60; // port: actually stores 240hz frame number
|
||||
/*0xcc*/ u8 laserfade;
|
||||
/*0xcd*/ u8 unusedmaybe[3];
|
||||
/*0xd0*/ u8 shadeinfo1[4]; // player 1
|
||||
|
||||
Reference in new issue
Block a user