Skip to content

Commit

Permalink
Fixed #91, #92 and #93 - HIFI Networking
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Aug 11, 2021
1 parent ccf019e commit 6f0afa7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
3 changes: 0 additions & 3 deletions engine/source/core/torqueConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
/// Define me to enable Torque HiFi support
#define TORQUE_HIFI_NET

/// Define me for a temporary HiFi fix
#define TORQUE_HIFI_TEMP_FIX // TODO: Fix properly and remove this

//-----------------------------------------------------------------------------
// Marble Blast related configuration defines

Expand Down
8 changes: 1 addition & 7 deletions engine/source/game/gameBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ bool GameBase::onAdd()
return false;

if (gSPMode)
mTypeMask &= ~GameBaseObjectType;
mTypeMask &= ~GameBaseHiFiObjectType;

return true;
}
Expand Down Expand Up @@ -482,15 +482,9 @@ TickCacheEntry* GameBase::addTickCacheEntry()

void GameBase::ageTickCache(S32 numToAge, S32 len)
{
#ifdef TORQUE_HIFI_TEMP_FIX
// TODO: this is not a proper fix for hifi crashes, figure it out later
if (!mTickCacheHead || mTickCacheHead->numEntry < numToAge)
return;
#else
AssertFatal(mTickCacheHead,"No tick cache head");
AssertFatal(mTickCacheHead->numEntry>=numToAge,"Too few entries!");
AssertFatal(mTickCacheHead->numEntry>numToAge,"Too few entries!");
#endif

while (numToAge--)
dropOldest();
Expand Down
8 changes: 1 addition & 7 deletions engine/source/game/gameConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,8 @@ S32 GameConnection::getServerTicks(U32 serverTickNum)
serverTicks -= MaxTickCount;
else if (-serverTicks > HalfMaxTickCount)
serverTicks += MaxTickCount;
#ifndef TORQUE_HIFI_TEMP_FIX
// TEMP: This assert keeps getting hit when using preview mode, disabling until we can find out why.
AssertFatal(serverTicks >= 0, "Server can't tick backwards!!!");
#endif
//AssertFatal(serverTicks >= 0, "Server can't tick backwards!!!");
if (serverTicks < 0)
serverTicks = 0;
}
Expand Down Expand Up @@ -1009,11 +1007,7 @@ void GameConnection::readPacket(BitStream* bstream)
totalCatchup = mLastClientMove - mFirstMoveIndex;

getCurrentClientProcessList()->ageTickCache(ourTicks + (tickDiff > 0 ? tickDiff : 0), totalCatchup + 1);

#ifndef TORQUE_HIFI_TEMP_FIX
// TODO: disabling this is not a proper fix for hifi crashes, figure it out later
getCurrentClientProcessList()->forceHifiReset(tickDiff != 0);
#endif

mDamageFlash = 0;
mWhiteOut = 0;
Expand Down

0 comments on commit 6f0afa7

Please sign in to comment.