mirror of
				https://github.com/kevinporetti/UnrealImGui.git
				synced 2025-10-31 05:53:17 +00:00 
			
		
		
		
	fix template unqualified lookup build errors on clang
This commit is contained in:
		
							parent
							
								
									2e994ac124
								
							
						
					
					
						commit
						ab103ac65f
					
				| @ -10,6 +10,9 @@ | |||||||
| 
 | 
 | ||||||
| namespace Utilities | namespace Utilities | ||||||
| { | { | ||||||
|  | 	template<typename T> | ||||||
|  | 	FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj); | ||||||
|  | 
 | ||||||
| 	FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance) | 	FORCEINLINE const FWorldContext* GetWorldContext(const UGameInstance& GameInstance) | ||||||
| 	{ | 	{ | ||||||
| 		return GameInstance.GetWorldContext(); | 		return GameInstance.GetWorldContext(); | ||||||
| @ -21,12 +24,6 @@ namespace Utilities | |||||||
| 		return Obj.IsValid() ? GetWorldContext(*Obj.Get()) : nullptr; | 		return Obj.IsValid() ? GetWorldContext(*Obj.Get()) : nullptr; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	template<typename T> |  | ||||||
| 	FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj) |  | ||||||
| 	{ |  | ||||||
| 		return Obj ? GetWorldContext(*Obj) : nullptr; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	FORCEINLINE const FWorldContext* GetWorldContext(const UGameViewportClient& GameViewportClient) | 	FORCEINLINE const FWorldContext* GetWorldContext(const UGameViewportClient& GameViewportClient) | ||||||
| 	{ | 	{ | ||||||
| 		return GetWorldContext(GameViewportClient.GetGameInstance()); | 		return GetWorldContext(GameViewportClient.GetGameInstance()); | ||||||
| @ -37,5 +34,11 @@ namespace Utilities | |||||||
| 		return GetWorldContext(World.GetGameInstance()); | 		return GetWorldContext(World.GetGameInstance()); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	template<typename T> | ||||||
|  | 	FORCEINLINE const FWorldContext* GetWorldContext(const T* Obj) | ||||||
|  | 	{ | ||||||
|  | 		return Obj ? GetWorldContext(*Obj) : nullptr; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode); | 	const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode); | ||||||
| } | } | ||||||
|  | |||||||
| @ -22,13 +22,6 @@ namespace Utilities | |||||||
| 	// Editor context index.
 | 	// Editor context index.
 | ||||||
| 	static constexpr int32 EDITOR_CONTEXT_INDEX = 0; | 	static constexpr int32 EDITOR_CONTEXT_INDEX = 0; | ||||||
| 
 | 
 | ||||||
| 	template<typename T> |  | ||||||
| 	FORCEINLINE int32 GetWorldContextIndex(const T& Obj) |  | ||||||
| 	{ |  | ||||||
| 		const FWorldContext* WorldContext = GetWorldContext(Obj); |  | ||||||
| 		return WorldContext ? GetWorldContextIndex(*WorldContext) : INVALID_CONTEXT_INDEX; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	FORCEINLINE int32 GetWorldContextIndex(const FWorldContext& WorldContext) | 	FORCEINLINE int32 GetWorldContextIndex(const FWorldContext& WorldContext) | ||||||
| 	{ | 	{ | ||||||
| 		// In standalone game (WorldType = Game) we have only one context with index 0 (see GAME_CONTEXT_INDEX).
 | 		// In standalone game (WorldType = Game) we have only one context with index 0 (see GAME_CONTEXT_INDEX).
 | ||||||
| @ -51,6 +44,13 @@ namespace Utilities | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	template<typename T> | ||||||
|  | 	FORCEINLINE int32 GetWorldContextIndex(const T& Obj) | ||||||
|  | 	{ | ||||||
|  | 		const FWorldContext* WorldContext = GetWorldContext(Obj); | ||||||
|  | 		return WorldContext ? GetWorldContextIndex(*WorldContext) : INVALID_CONTEXT_INDEX; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	int32 GetWorldContextIndex(const UWorld& World) | 	int32 GetWorldContextIndex(const UWorld& World) | ||||||
| 	{ | 	{ | ||||||
| 		return (World.WorldType == EWorldType::Editor) ? EDITOR_CONTEXT_INDEX : GetWorldContextIndex(World.GetGameInstance()); | 		return (World.WorldType == EWorldType::Editor) ? EDITOR_CONTEXT_INDEX : GetWorldContextIndex(World.GetGameInstance()); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Mohammad S. Babaei
						Mohammad S. Babaei