/* Walk the BSP tree and set the domain fields for subsectors. */ static void AnnotateNode(struct Node *node) { int ss; if ((node->chleft & 0x8000) != 0) { ss = node->chleft & ~0x8000; subsector_domains[ss] = SubsectorDomain(node->leftbox); } else { AnnotateNode(node->nextl); } if ((node->chright & 0x8000) != 0) { ss = node->chright & ~0x8000; subsector_domains[ss] = SubsectorDomain(node->rightbox); } else { AnnotateNode(node->nextr); } }
void AnnotateNodeTree(struct Node *root) { int i; subsector_domains = calloc(num_ssectors, sizeof(int16_t)); for (i = 0; i < num_ssectors; ++i) { subsector_domains[i] = 0; } AnnotateNode(root); }
void FCompilerResultsLog::Append(FCompilerResultsLog const& Other) { for (TSharedRef<FTokenizedMessage> const& Message : Other.Messages) { switch (Message->GetSeverity()) { case EMessageSeverity::Warning: { ++NumWarnings; break; } case EMessageSeverity::Error: { ++NumErrors; break; } } Messages.Add(Message); UEdGraphNode* OwnerNode = nullptr; for (TSharedRef<IMessageToken> const& Token : Message->GetMessageTokens()) { if (Token->GetType() != EMessageToken::Object) { continue; } FWeakObjectPtr ObjectPtr = ((FUObjectToken&)Token.Get()).GetObject(); if (!ObjectPtr.IsValid()) { continue; } UObject* ObjectArgument = ObjectPtr.Get(); OwnerNode = Cast<UEdGraphNode>(ObjectArgument); if (UEdGraphPin const* Pin = Cast<UEdGraphPin>(ObjectArgument)) { OwnerNode = Pin->GetOwningNodeUnchecked(); } } AnnotateNode(OwnerNode, Message); } }
/** Create a tokenized message record from a message containing @@ indicating where each UObject* in the ArgPtr list goes and place it in the MessageLog. */ void FCompilerResultsLog::InternalLogMessage(const EMessageSeverity::Type& Severity, const TCHAR* Message, va_list ArgPtr) { UEdGraphNode* OwnerNode = nullptr; // Create the tokenized message TSharedRef<FTokenizedMessage> Line = FTokenizedMessage::Create( Severity ); Messages.Add(Line); const TCHAR* DelimiterStr = TEXT("@@"); int32 DelimLength = FCString::Strlen(DelimiterStr); const TCHAR* Start = Message; if (Start && DelimLength) { while (const TCHAR* At = FCString::Strstr(Start, DelimiterStr)) { // Found a delimiter, create a token from the preceding text Line->AddToken( FTextToken::Create( FText::FromString( FString(At - Start, Start) ) ) ); Start += DelimLength + (At - Start); // And read the object and add another token for the object UObject* ObjectArgument = va_arg(ArgPtr, UObject*); FText ObjText; if (ObjectArgument) { // Remap object references to the source nodes ObjectArgument = FindSourceObject(ObjectArgument); if (ObjectArgument) { UEdGraphNode* Node = Cast<UEdGraphNode>(ObjectArgument); const UEdGraphPin* Pin = (Node? nullptr : Cast<UEdGraphPin>(ObjectArgument)); //Get owner node reference, consider the first if (OwnerNode == nullptr) { OwnerNode = (Pin ? Pin->GetOwningNodeUnchecked() : Node); } if (ObjectArgument->GetOutermost() == GetTransientPackage()) { ObjText = LOCTEXT("Transient", "(transient)"); } else if (Node != NULL) { ObjText = Node->GetNodeTitle(ENodeTitleType::ListView); } else if (Pin != NULL) { ObjText = Pin->GetDisplayName(); } else { ObjText = FText::FromString( ObjectArgument->GetName() ); } } else { ObjText = LOCTEXT("None", "(none)"); } } else { ObjText = LOCTEXT("None", "(none)"); } Line->AddToken( FUObjectToken::Create( ObjectArgument, ObjText ) ); } Line->AddToken( FTextToken::Create( FText::FromString( Start ) ) ); } va_end(ArgPtr); // Register node error/warning. AnnotateNode(OwnerNode, Line); if( !bSilentMode && (!bLogInfoOnly || (Severity == EMessageSeverity::Info)) ) { if(Severity == EMessageSeverity::CriticalError || Severity == EMessageSeverity::Error) { UE_LOG(LogBlueprint, Error, TEXT("[compiler] %s"), *Line->ToText().ToString()); } else if(Severity == EMessageSeverity::Warning || Severity == EMessageSeverity::PerformanceWarning) { UE_LOG(LogBlueprint, Warning, TEXT("[compiler] %s"), *Line->ToText().ToString()); } else { UE_LOG(LogBlueprint, Log, TEXT("[compiler] %s"), *Line->ToText().ToString()); } } }