simplify integration

This commit is contained in:
Arnaud Jamin
2023-10-10 23:53:34 -04:00
parent 7094dbf1f5
commit eb963614b9
45 changed files with 217 additions and 230 deletions
@@ -23,7 +23,7 @@ public class CogDebug : ModuleRules
{
"Core",
"CogImgui",
"CogInterface",
"CogCommon",
}
);
@@ -1,13 +1,14 @@
#include "CogDebugDraw.h"
#include "CogDebugDrawHelper.h"
#include "CogDebugShape.h"
#include "CogDebugHelper.h"
#include "CogDebugDrawImGui.h"
#include "CogImguiHelper.h"
#include "CogDebugHelper.h"
#include "CogDebugLog.h"
#include "CogDebugModule.h"
#include "CogDebugReplicator.h"
#include "CogDebugSettings.h"
#include "CogDebugShape.h"
#include "CogImguiHelper.h"
#include "Engine/SkeletalMesh.h"
#include "VisualLogger/VisualLogger.h"
@@ -1,7 +1,7 @@
#include "CogDebugLogBlueprint.h"
#include "CogCommon.h"
#include "CogDebugLog.h"
#include "CogDebugLogMacros.h"
//--------------------------------------------------------------------------------------------------------------------------
void UCogDebugLogBlueprint::Log(const UObject* WorldContextObject, FCogLogCategory LogCategory, ECogLogVerbosity Verbosity, const FString& Text)
@@ -1,6 +1,6 @@
#include "CogDebugPlotBlueprint.h"
#include "CogDebugDefines.h"
#include "CogCommon.h"
#include "CogDebugPlot.h"
//--------------------------------------------------------------------------------------------------------------------------
@@ -1,6 +1,6 @@
#include "CogDebugSettings.h"
#include "CogInterfaceDebugFilteredActor.h"
#include "CogCommonDebugFilteredActorInterface.h"
//--------------------------------------------------------------------------------------------------------------------------
TWeakObjectPtr<AActor> FCogDebugSettings::Selection;
@@ -92,7 +92,7 @@ bool FCogDebugSettings::IsDebugActiveForObject(const UObject* WorldContextObject
return true;
}
if (Cast<ICogInterfacesDebugFilteredActor>(Outer))
if (Cast<ICogCommonDebugFilteredActorInterface>(Outer))
{
return false;
}
@@ -1,7 +0,0 @@
#pragma once
#include "CoreMinimal.h"
#ifndef ENABLE_COG
#define ENABLE_COG (ENABLE_DRAW_DEBUG && !NO_LOGGING)
#endif
@@ -1,7 +1,7 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugLogMacros.h"
#include "CogCommon.h"
class USkeletalMeshComponent;
struct FCogDebugShape;
@@ -1,7 +1,6 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugDefines.h"
namespace EDrawDebugTrace { enum Type; }
@@ -1,7 +1,6 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugDefines.h"
#include "Logging/LogVerbosity.h"
//--------------------------------------------------------------------------------------------------------------------------
@@ -1,53 +0,0 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugDefines.h"
#include "CogDebugSettings.h"
#include "Templates/IsArrayOrRefOfType.h"
#if !ENABLE_COG
#define COG_LOG_ACTIVE_FOR_OBJECT(Object) (0)
#define COG_LOG(LogCategory, Verbosity, Format, ...) (0)
#define COG_LOG_FUNC(LogCategory, Verbosity, Format, ...) (0)
#define COG_LOG_OBJECT(LogCategory, Verbosity, Actor, Format, ...) (0)
#define COG_LOG_OBJECT_NO_CONTEXT(LogCategory, Verbosity, Actor, Format, ...) (0)
#else //!ENABLE_COG
//--------------------------------------------------------------------------------------------------------------------------
#define COG_LOG_ACTIVE_FOR_OBJECT(Object) (FCogDebugSettings::IsDebugActiveForObject(Object))
//--------------------------------------------------------------------------------------------------------------------------
#define COG_LOG(LogCategory, Verbosity, Format, ...) \
{ \
static_assert(TIsArrayOrRefOfType<decltype(Format), TCHAR>::Value, "Formatting string must be a TCHAR array."); \
if ((LogCategory).IsSuppressed(Verbosity) == false) \
{ \
FMsg::Logf_Internal(nullptr, 0, (LogCategory).GetCategoryName(), Verbosity, Format, ##__VA_ARGS__); \
} \
} \
//--------------------------------------------------------------------------------------------------------------------------
#define COG_LOG_FUNC(LogCategory, Verbosity, Format, ...) \
COG_LOG(LogCategory, Verbosity, TEXT("%s - %s"), ANSI_TO_TCHAR(__FUNCTION__), *FString::Printf(Format, ##__VA_ARGS__)); \
//--------------------------------------------------------------------------------------------------------------------------
#define COG_LOG_OBJECT(LogCategory, Verbosity, Object, Format, ...) \
if (COG_LOG_ACTIVE_FOR_OBJECT(Object) || (int32)Verbosity <= (int32)ELogVerbosity::Warning) \
{ \
COG_LOG(LogCategory, Verbosity, TEXT("%s - %s - %s"), \
*GetNameSafe(Object), \
ANSI_TO_TCHAR(__FUNCTION__), \
*FString::Printf(Format, ##__VA_ARGS__)); \
} \
//--------------------------------------------------------------------------------------------------------------------------
#define COG_LOG_OBJECT_NO_CONTEXT(LogCategory, Verbosity, Object, Format, ...) \
if (COG_LOG_ACTIVE_FOR_OBJECT(Object) || (int32)Verbosity <= (int32)ELogVerbosity::Warning) \
{ \
COG_LOG(LogCategory, Verbosity, TEXT("%s - %s"), *GetNameSafe(Object), *FString::Printf(Format, ##__VA_ARGS__)); \
} \
#endif //!ENABLE_COG
@@ -1,7 +1,7 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugDefines.h"
#include "CogCommon.h"
#ifdef ENABLE_COG
@@ -1,7 +1,7 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugDefines.h"
#include "CogCommon.h"
#include "imgui.h"
#include "implot.h"
@@ -1,7 +1,6 @@
#pragma once
#include "CoreMinimal.h"
#include "CogDebugLogMacros.h"
struct COGDEBUG_API FCogDebugSettings
{