Revert "LagCompensation: fix PVS issues?"
This reverts commitccc349c057
. Revert "LagCompensation: optimization, cache PVS info" This reverts commit48d07eaa63
.
This commit is contained in:
parent
1915e52302
commit
a4be356f41
@ -39,12 +39,6 @@
|
|||||||
"library" "server"
|
"library" "server"
|
||||||
"linux" "@_ZN18CCollisionProperty24MarkPartitionHandleDirtyEv"
|
"linux" "@_ZN18CCollisionProperty24MarkPartitionHandleDirtyEv"
|
||||||
}
|
}
|
||||||
|
|
||||||
"RecomputePVSInformation"
|
|
||||||
{
|
|
||||||
"library" "server"
|
|
||||||
"linux" "@_ZN22CServerNetworkProperty23RecomputePVSInformationEv"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"Functions"
|
"Functions"
|
||||||
|
@ -16,7 +16,7 @@ public Plugin myinfo =
|
|||||||
name = "LagCompensation",
|
name = "LagCompensation",
|
||||||
author = "BotoX",
|
author = "BotoX",
|
||||||
description = "",
|
description = "",
|
||||||
version = "1.1",
|
version = "1.0",
|
||||||
url = ""
|
url = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -31,8 +31,6 @@ bool g_bHasPhysHooks = true;
|
|||||||
#define EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS (1<<14)
|
#define EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS (1<<14)
|
||||||
#define EFL_CHECK_UNTOUCH (1<<24)
|
#define EFL_CHECK_UNTOUCH (1<<24)
|
||||||
#define COORDINATE_FRAME_SIZE 14
|
#define COORDINATE_FRAME_SIZE 14
|
||||||
#define PVSINFO_OFFSET 16
|
|
||||||
#define PVSINFO_SIZE 32/4
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -87,7 +85,6 @@ enum struct LagRecord
|
|||||||
float angAbsRotation[3];
|
float angAbsRotation[3];
|
||||||
float flSimulationTime;
|
float flSimulationTime;
|
||||||
float rgflCoordinateFrame[COORDINATE_FRAME_SIZE];
|
float rgflCoordinateFrame[COORDINATE_FRAME_SIZE];
|
||||||
int PVSInfo[PVSINFO_SIZE];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum struct EntityLagData
|
enum struct EntityLagData
|
||||||
@ -112,7 +109,6 @@ bool g_bCleaningUp = true;
|
|||||||
|
|
||||||
Handle g_hCalcAbsolutePosition;
|
Handle g_hCalcAbsolutePosition;
|
||||||
Handle g_hMarkPartitionHandleDirty;
|
Handle g_hMarkPartitionHandleDirty;
|
||||||
Handle g_hRecomputePVSInformation;
|
|
||||||
|
|
||||||
Handle g_hUTIL_Remove;
|
Handle g_hUTIL_Remove;
|
||||||
Handle g_hRestartRound;
|
Handle g_hRestartRound;
|
||||||
@ -126,7 +122,6 @@ int g_iParent;
|
|||||||
int g_iSpawnFlags;
|
int g_iSpawnFlags;
|
||||||
int g_iTouchStamp;
|
int g_iTouchStamp;
|
||||||
int g_iCollision;
|
int g_iCollision;
|
||||||
int g_iNetwork;
|
|
||||||
int g_iSolidFlags;
|
int g_iSolidFlags;
|
||||||
int g_iSolidType;
|
int g_iSolidType;
|
||||||
int g_iSurroundType;
|
int g_iSurroundType;
|
||||||
@ -168,15 +163,6 @@ public void OnPluginStart()
|
|||||||
}
|
}
|
||||||
g_hMarkPartitionHandleDirty = EndPrepSDKCall();
|
g_hMarkPartitionHandleDirty = EndPrepSDKCall();
|
||||||
|
|
||||||
// CServerNetworkProperty::RecomputePVSInformation
|
|
||||||
StartPrepSDKCall(SDKCall_Raw);
|
|
||||||
if(!PrepSDKCall_SetFromConf(hGameData, SDKConf_Signature, "RecomputePVSInformation"))
|
|
||||||
{
|
|
||||||
delete hGameData;
|
|
||||||
SetFailState("PrepSDKCall_SetFromConf(hGameData, SDKConf_Signature, \"RecomputePVSInformation\") failed!");
|
|
||||||
}
|
|
||||||
g_hRecomputePVSInformation = EndPrepSDKCall();
|
|
||||||
|
|
||||||
|
|
||||||
// ::UTIL_Remove
|
// ::UTIL_Remove
|
||||||
g_hUTIL_Remove = DHookCreateFromConf(hGameData, "UTIL_Remove");
|
g_hUTIL_Remove = DHookCreateFromConf(hGameData, "UTIL_Remove");
|
||||||
@ -335,7 +321,6 @@ public void OnMapStart()
|
|||||||
g_iSpawnFlags = FindDataMapInfo(0, "m_spawnflags");
|
g_iSpawnFlags = FindDataMapInfo(0, "m_spawnflags");
|
||||||
g_iTouchStamp = FindDataMapInfo(0, "touchStamp");
|
g_iTouchStamp = FindDataMapInfo(0, "touchStamp");
|
||||||
g_iCollision = FindDataMapInfo(0, "m_Collision");
|
g_iCollision = FindDataMapInfo(0, "m_Collision");
|
||||||
g_iNetwork = FindDataMapInfo(0, "m_Network");
|
|
||||||
g_iSolidFlags = FindDataMapInfo(0, "m_usSolidFlags");
|
g_iSolidFlags = FindDataMapInfo(0, "m_usSolidFlags");
|
||||||
g_iSolidType = FindDataMapInfo(0, "m_nSolidType");
|
g_iSolidType = FindDataMapInfo(0, "m_nSolidType");
|
||||||
g_iSurroundType = FindDataMapInfo(0, "m_nSurroundType");
|
g_iSurroundType = FindDataMapInfo(0, "m_nSurroundType");
|
||||||
@ -901,17 +886,6 @@ void RecordDataIntoRecord(int iEntity, LagRecord Record)
|
|||||||
GetEntDataVector(iEntity, g_iAngAbsRotation, Record.angAbsRotation);
|
GetEntDataVector(iEntity, g_iAngAbsRotation, Record.angAbsRotation);
|
||||||
GetEntDataArray(iEntity, g_iCoordinateFrame, view_as<int>(Record.rgflCoordinateFrame), COORDINATE_FRAME_SIZE);
|
GetEntDataArray(iEntity, g_iCoordinateFrame, view_as<int>(Record.rgflCoordinateFrame), COORDINATE_FRAME_SIZE);
|
||||||
Record.flSimulationTime = GetEntDataFloat(iEntity, g_iSimulationTime);
|
Record.flSimulationTime = GetEntDataFloat(iEntity, g_iSimulationTime);
|
||||||
|
|
||||||
// Make sure to have fresh PVS info before caching it.
|
|
||||||
// NetworkProp()->RecomputePVSInformation();
|
|
||||||
Address NetworkProp = GetEntityAddress(iEntity) + view_as<Address>(g_iNetwork);
|
|
||||||
SDKCall(g_hRecomputePVSInformation, NetworkProp);
|
|
||||||
|
|
||||||
if(GetEdictFlags(iEntity) & FL_EDICT_DIRTY_PVS_INFORMATION)
|
|
||||||
PrintToBoth("POST FL_EDICT_DIRTY_PVS_INFORMATION !!!!!!!!");
|
|
||||||
|
|
||||||
// CServerNetworkProperty::GetPVSInfo(): return this + 16;
|
|
||||||
GetEntDataArray(iEntity, g_iNetwork + PVSINFO_OFFSET, view_as<int>(Record.PVSInfo), PVSINFO_SIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DoesRotationInvalidateSurroundingBox(int iEntity)
|
bool DoesRotationInvalidateSurroundingBox(int iEntity)
|
||||||
@ -952,19 +926,12 @@ bool DoesRotationInvalidateSurroundingBox(int iEntity)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvalidatePhysicsRecursive(int iEntity, LagRecord Record)
|
void InvalidatePhysicsRecursive(int iEntity)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
// NetworkProp()->MarkPVSInformationDirty()
|
// NetworkProp()->MarkPVSInformationDirty()
|
||||||
int fStateFlags = GetEdictFlags(iEntity);
|
int fStateFlags = GetEdictFlags(iEntity);
|
||||||
fStateFlags |= FL_EDICT_DIRTY_PVS_INFORMATION;
|
fStateFlags |= FL_EDICT_DIRTY_PVS_INFORMATION;
|
||||||
SetEdictFlags(iEntity, fStateFlags);
|
SetEdictFlags(iEntity, fStateFlags);
|
||||||
*/
|
|
||||||
|
|
||||||
if(GetEdictFlags(iEntity) & FL_EDICT_DIRTY_PVS_INFORMATION)
|
|
||||||
PrintToBoth("RESTORE FL_EDICT_DIRTY_PVS_INFORMATION !!!!!!!!");
|
|
||||||
|
|
||||||
SetEntDataArray(iEntity, g_iNetwork + PVSINFO_OFFSET, view_as<int>(Record.PVSInfo), PVSINFO_SIZE);
|
|
||||||
|
|
||||||
// CollisionProp()->MarkPartitionHandleDirty();
|
// CollisionProp()->MarkPartitionHandleDirty();
|
||||||
Address CollisionProp = GetEntityAddress(iEntity) + view_as<Address>(g_iCollision);
|
Address CollisionProp = GetEntityAddress(iEntity) + view_as<Address>(g_iCollision);
|
||||||
@ -988,7 +955,7 @@ void RestoreEntityFromRecord(int iEntity, LagRecord Record)
|
|||||||
SetEntDataArray(iEntity, g_iCoordinateFrame, view_as<int>(Record.rgflCoordinateFrame), COORDINATE_FRAME_SIZE);
|
SetEntDataArray(iEntity, g_iCoordinateFrame, view_as<int>(Record.rgflCoordinateFrame), COORDINATE_FRAME_SIZE);
|
||||||
SetEntDataFloat(iEntity, g_iSimulationTime, Record.flSimulationTime);
|
SetEntDataFloat(iEntity, g_iSimulationTime, Record.flSimulationTime);
|
||||||
|
|
||||||
InvalidatePhysicsRecursive(iEntity, Record);
|
InvalidatePhysicsRecursive(iEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1143,11 +1110,6 @@ void LagRecord_Copy(LagRecord obj, const LagRecord other)
|
|||||||
{
|
{
|
||||||
obj.rgflCoordinateFrame[i] = other.rgflCoordinateFrame[i];
|
obj.rgflCoordinateFrame[i] = other.rgflCoordinateFrame[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < PVSINFO_SIZE; i++)
|
|
||||||
{
|
|
||||||
obj.PVSInfo[i] = other.PVSInfo[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CompareVectors(const float vec1[3], const float vec2[3])
|
bool CompareVectors(const float vec1[3], const float vec2[3])
|
||||||
|
Loading…
Reference in New Issue
Block a user