void plSimulationMgr::AddCollisionMsg(plKey hitee, plKey hitter, bool enter) { // First, make sure we have no dupes for (CollisionVec::iterator it = fCollideMsgs.begin(); it != fCollideMsgs.end(); ++it) { plCollideMsg* pMsg = *it; // Should only ever be one receiver. // Oh, it seems we should update the hit status. The latest might be different than the older... // Even in the same frame >.< if (pMsg->fOtherKey == hitter && pMsg->GetReceiver(0) == hitee) { pMsg->fEntering = enter; DetectorLogRed("DUPLICATE COLLISION: %s hit %s", (hitter ? hitter->GetName().c_str() : "(nil)"), (hitee ? hitee->GetName().c_str() : "(nil)")); return; } } // Still here? Then this must be a unique hit! plCollideMsg* pMsg = new plCollideMsg; pMsg->AddReceiver(hitee); pMsg->fOtherKey = hitter; pMsg->fEntering = enter; fCollideMsgs.push_back(pMsg); }
void plSimulationMgr::ISendCollisionMsg(plKey receiver, plKey hitter, bool entering) { DetectorLogYellow("Collision: %s is inside %s. Sending an %s msg", hitter ? hitter->GetName().c_str() : "(nil)", receiver->GetName().c_str(), entering ? "'enter'" : "'exit'"); plCollideMsg* msg = new plCollideMsg; msg->fOtherKey = hitter; msg->fEntering = entering; msg->AddReceiver(receiver); msg->Send(); }
//============================================================================ void plNCAgeJoiner::IResMgrProgressBarCallback (plKey key) { #ifndef PLASMA_EXTERNAL_RELEASE if (s_instance) s_instance->progressBar->SetStatusText(key->GetName()); #endif if (s_instance) s_instance->progressBar->Increment(1); }
// // save or load a key. return the key. // const plKey plSynchedValueBase::ISaveOrLoad(const plKey key, hsBool32 save, hsStream* stream, hsResMgr* mgr) { if (save) { if (key) { stream->WriteByte(1); // I need to write a key to MY stream... #if 0 // DEBUG int32_t len = hsStrlen(key->GetName()); stream->WriteLE32(len); stream->Write(len, key->GetName()); #endif key->GetUoid().Write(stream); } else { stream->WriteByte(0); } return key; } else { int32_t has=stream->ReadByte(); if (has) { // read a key from MY stream #if 0 // DEBUG int32_t len = stream->ReadLE32(); char tmp[256]; hsAssert(len<256, "key name overflow"); stream->Read(len, tmp); #endif plUoid uoid; uoid.Read(stream); return mgr->FindKey(uoid); } else return (nil); } return nil; }
pfKIListPlayerItem( plKey key, bool inRange = false ) : pfGUIListText(), fPlayerKey( key ) { static char str[ 256 ]; if( key == nil ) SetText( "<Everyone>" ); else { const char *name = plNetClientMgr::GetInstance()->GetPlayerName( key ); if( inRange ) { sprintf( str, ">%s<", name != nil ? name : key->GetName() ); SetText( str ); } else SetText( name != nil ? name : key->GetName() ); } ISetJustify( true ); }
void plPageOptimizer::KeyedObjectProc(plKey key) { plString keyName = key->GetName(); const char* className = plFactory::GetNameOfClass(key->GetUoid().GetClassType()); // For now, ignore any key that isn't in the location we're looking at. That means stuff like textures. if (fInstance->fLoc != key->GetUoid().GetLocation()) return; KeySet& loadedKeys = fInstance->fLoadedKeys; KeyVec& loadOrder = fInstance->fKeyLoadOrder; KeySet::iterator it = loadedKeys.lower_bound(key); if (it != loadedKeys.end() && *it == key) { printf("Keyed object %s(%s) loaded more than once\n", keyName.c_str(), className); } else { loadedKeys.insert(it, key); loadOrder.push_back(key); } }
void plNetMsgRoomsList::AddRoom(plKey rmKey) { fRooms.push_back(rmKey->GetUoid().GetLocation()); fRoomNames.push_back(rmKey->GetName()); }