paulmm123
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Articles
Docs
Gallery
Posts posted by paulmm123
-
-
I can conclude that for boolean types, is not necessary pre check of bits as :
if (stream->writeFlag(mask & bitMask))
stream->writeFlag(mMyBool );
So instead I write and read directly the boolean...
pack:
stream->writeFlag(mMyBool );
unpack:
mMyBool = stream->readFlag();
This is what I've seen in others codes as player.cpp ...
-
I'm not sure, there is a small bug in Door::packUpdate and Door::unpackUpdate that dont update door property islocked on editor
The commented lines make work...
U32 Door::packUpdate(NetConnection *connection, U32 mask, BitStream *stream) { Con::errorf(ConsoleLogEntry::General, "Door::packUpdate"); U32 retMask = Parent::packUpdate(connection, mask, stream); stream->writeFlag(mBlockCheckEnable); //if (stream->writeFlag(mask & OpenMask))<--------if enabled, dont update door property islocked on editor stream->writeFlag(mIsOpen); //if (stream->writeFlag(mask & LockMask))<--------if enabled, dont update door property islocked on editor stream->writeFlag(mIsLocked); if (stream->writeFlag(key)) stream->writeRangedU32(key->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); //...rest of code }why only stream->writeFlag(mask & LockMask) dont work however only stream->writeFlag(mIsLocked); work ? :?:
void Door::unpackUpdate(NetConnection *connection, BitStream *stream) { Con::errorf(ConsoleLogEntry::General, "Door::unpackUpdate"); Parent::unpackUpdate(connection, stream); mBlockCheckEnable = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mBlockCheckEnable %d",mBlockCheckEnable); //if (stream->readFlag()) <-------if enabled, dont update door property islocked on editor { mIsOpen = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mIsOpen %d",mIsOpen); } //if (stream->readFlag()) <--------if enabled, dont update door property islocked on editor { mIsLocked = stream->readFlag(); Con::errorf(ConsoleLogEntry::General, "mIsLocked %d",mIsLocked); } //...rest of code }if I am not mistaken, both BitStream::writeFlag() and BitStream::readFlag() foward the bit mask from bitNum , if i call two times subsequently I would not take the wrong bit ?
Thanks for any help!
-
Add it to door class on file doors.cpp:
void Door::advanceTime(F32 dt)
{
advanceThreads(dt);
}
Now will be called, but still not working...
after advanceTime change, isGhost() ways true and mShapeInstance->getTriggerState not get some index...
-
Hey Jack, as promised in irc, I dug up that old solar system sim engine I had a copy of.
The code is oooooold, but it could give you some ideas on how to tackle things. You'd have to modernize the render code, but the basics for setup should carry across:
WOW, nice code Thank!!!

DoorClass advanceThreads not called
in C++
Posted
is working perfectly, i tested both client and server with sounds too.
I tried to keep orginal code the maximum that.
Thanks RichardM by code.