bool FEnvQueryInstance::PrepareContext(UClass* Context, TArray<FVector>& Data)
{
	if (Context == NULL)
	{
		return false;
	}

	FEnvQueryContextData ContextData;
	const bool bSuccess = PrepareContext(Context, ContextData);

	if (bSuccess && ContextData.ValueType && ContextData.ValueType->IsChildOf(UEnvQueryItemType_LocationBase::StaticClass()))
	{
		UEnvQueryItemType_LocationBase* DefTypeOb = (UEnvQueryItemType_LocationBase*)ContextData.ValueType->GetDefaultObject();
		const uint16 DefTypeValueSize = DefTypeOb->GetValueSize();
		uint8* RawData = (uint8*)ContextData.RawData.GetTypedData();

		Data.Init(ContextData.NumValues);
		for (int32 i = 0; i < ContextData.NumValues; i++)
		{
			Data[i] = DefTypeOb->GetLocation(RawData);
			RawData += DefTypeValueSize;
		}
	}

	return bSuccess;
}
Esempio n. 2
0
/** Resets the control context. 

The default implementation first resets the graphics context given by aGc, 
and then calls PrepareContext(). The function may be overridden by derived 
classes.

@param aGc The graphics context to be reset. */
EXPORT_C void MCoeControlContext::ResetContext(CWindowGc& aGc) const
	{
	aGc.Reset();
	PrepareContext(aGc);
	}
Esempio n. 3
0
/** Activates a graphics context for the specified window.

This function is called whenever a control is about to be drawn. Its default 
implementation activates the graphics context given by aGc for the window 
given by aWindow, and calls PrepareContext(). 

This function may be overridden by derived classes.

@param aGc The graphics context to activate. When called from CCoeControl::ActivateGc(), 
this is the system graphics context.
@param aWindow The window for which the graphics context is to be activated. */
EXPORT_C void MCoeControlContext::ActivateContext(CWindowGc& aGc,RDrawableWindow& aWindow) const
	{
	aGc.Activate(aWindow);
	PrepareContext(aGc);
	}