mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
updates
Fixed streaming logic to only happen when we are not editing a mission, also some issues with objects that cannot be streamed eg camera, and player. Reverted limits
This commit is contained in:
parent
eecc2bdaee
commit
1fed963d82
5 changed files with 37 additions and 23 deletions
|
|
@ -267,17 +267,3 @@ DefineEngineFunction( isValidObjectName, bool, (const char * name), , "( string
|
||||||
|
|
||||||
ConsoleFunctionGroupEnd( SimFunctions );
|
ConsoleFunctionGroupEnd( SimFunctions );
|
||||||
|
|
||||||
void SceneStreaming::processTick()
|
|
||||||
{
|
|
||||||
if (smStreaming)
|
|
||||||
{
|
|
||||||
for (U32 i = 0; i < mMaxObjects && !smPendingRegister.empty(); i++)
|
|
||||||
{
|
|
||||||
SimObject* obj = smPendingRegister.first();
|
|
||||||
smPendingRegister.pop_front();
|
|
||||||
|
|
||||||
if (!obj->onAdd())
|
|
||||||
obj->unregisterObject();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -628,3 +628,23 @@ void SimDataBlockGroup::sort()
|
||||||
dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey);
|
dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SceneStreaming::processTick()
|
||||||
|
{
|
||||||
|
if (true)
|
||||||
|
{
|
||||||
|
for (U32 i = 0; i < mMaxObjects && !smPendingRegister.empty(); i++)
|
||||||
|
{
|
||||||
|
SimObject* obj = smPendingRegister.first();
|
||||||
|
smPendingRegister.pop_front();
|
||||||
|
|
||||||
|
Sim::gIdDictionary->insert(obj);
|
||||||
|
|
||||||
|
Sim::gNameDictionary->insert(obj);
|
||||||
|
|
||||||
|
|
||||||
|
if (!obj->onAdd())
|
||||||
|
obj->unregisterObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@
|
||||||
|
|
||||||
#include "sim/netObject.h"
|
#include "sim/netObject.h"
|
||||||
#include "scene/sceneObject.h"
|
#include "scene/sceneObject.h"
|
||||||
|
#include "T3D/camera.h"
|
||||||
|
#include "T3D/player.h"
|
||||||
|
|
||||||
ImplementBitfieldType(GameTypeMasksType,
|
ImplementBitfieldType(GameTypeMasksType,
|
||||||
"The type of animation effect to apply to this material.\n"
|
"The type of animation effect to apply to this material.\n"
|
||||||
|
|
@ -114,7 +116,7 @@ namespace Sim
|
||||||
extern SimIdDictionary *gIdDictionary;
|
extern SimIdDictionary *gIdDictionary;
|
||||||
extern U32 gNextObjectId;
|
extern U32 gNextObjectId;
|
||||||
}
|
}
|
||||||
|
extern bool gEditingMission;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -723,15 +725,21 @@ bool SimObject::registerObject()
|
||||||
AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
|
AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
|
||||||
"SimObject::registerObject - tried to register an object before Sim::init()!");
|
"SimObject::registerObject - tried to register an object before Sim::init()!");
|
||||||
|
|
||||||
Sim::gIdDictionary->insert(this);
|
|
||||||
|
if (true && dynamic_cast<SceneObject*>(this) &&
|
||||||
Sim::gNameDictionary->insert(this);
|
!(dynamic_cast<Camera*>(this) || dynamic_cast<Player*>(this)) &&
|
||||||
|
!gEditingMission
|
||||||
if (Sim::sgStreamingInstance->smStreaming && dynamic_cast<SceneObject*>(this))
|
)
|
||||||
{
|
{
|
||||||
Sim::sgStreamingInstance->smPendingRegister.push_back(this);
|
Sim::sgStreamingInstance->smPendingRegister.push_back(this);
|
||||||
return true; // pretend success
|
return true; // pretend success
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Sim::gIdDictionary->insert(this);
|
||||||
|
|
||||||
|
Sim::gNameDictionary->insert(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Notify object
|
// Notify object
|
||||||
bool ret = onAdd();
|
bool ret = onAdd();
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ U32 NetConnection::getSequence()
|
||||||
static U32 gPacketRateToServer = 32;
|
static U32 gPacketRateToServer = 32;
|
||||||
static U32 gPacketUpdateDelayToServer = 32;
|
static U32 gPacketUpdateDelayToServer = 32;
|
||||||
static U32 gPacketRateToClient = 10;
|
static U32 gPacketRateToClient = 10;
|
||||||
static U32 gPacketSize = 1500;
|
static U32 gPacketSize = 508;
|
||||||
|
|
||||||
void NetConnection::consoleInit()
|
void NetConnection::consoleInit()
|
||||||
{
|
{
|
||||||
|
|
@ -319,7 +319,7 @@ void NetConnection::checkMaxRate()
|
||||||
// These changes introduced in T3D 1.1 Preview reduce the packet headroom which leads
|
// These changes introduced in T3D 1.1 Preview reduce the packet headroom which leads
|
||||||
// to some spells and effects running out of room when dynamic variables are used
|
// to some spells and effects running out of room when dynamic variables are used
|
||||||
// to send launch-time parameters to clients.
|
// to send launch-time parameters to clients.
|
||||||
packetSize = 1500;
|
packetSize = 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
gPacketUpdateDelayToServer = 1024 / packetRateToServer;
|
gPacketUpdateDelayToServer = 1024 / packetRateToServer;
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ void NetConnection::ghostWritePacket(BitStream *bstream, PacketNotify *notify)
|
||||||
bstream->writeInt(sendSize - 3, GhostIndexBitSize);
|
bstream->writeInt(sendSize - 3, GhostIndexBitSize);
|
||||||
|
|
||||||
S32 bytesThisPacket = 0;
|
S32 bytesThisPacket = 0;
|
||||||
U32 maxBytesPerPacket = mGhostByteBudget;
|
U32 maxBytesPerPacket = mMaxRate.packetSize;
|
||||||
//
|
//
|
||||||
for(i = mGhostZeroUpdateIndex - 1; i >= 0 && !bstream->isFull(); i--)
|
for(i = mGhostZeroUpdateIndex - 1; i >= 0 && !bstream->isFull(); i--)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue