2 Commits

Author SHA1 Message Date
Dron 5d75f89cbb Merge branch 'master' of http://192.168.1.163:3000/Dron/Ivazovsky
# Conflicts:
#	Content/Maps/MainScene.umap
2025-09-23 19:38:05 +05:00
Dron 2a6b4c1846 upd streetlamp, light, dof, c++ xml parse 2025-09-23 19:37:20 +05:00
32 changed files with 1002 additions and 35 deletions
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -2
View File
@@ -33,7 +33,7 @@ r.AllowOcclusionQueries=True
r.MinScreenRadiusForLights=0.010000 r.MinScreenRadiusForLights=0.010000
r.DefaultFeature.AntiAliasing=2 r.DefaultFeature.AntiAliasing=2
r.TessellationAdaptivePixelsPerTriangle=1024.000000 r.TessellationAdaptivePixelsPerTriangle=1024.000000
r.RayTracing.Shadows=False r.RayTracing.Shadows=True
r.RayTracing.Skylight=False r.RayTracing.Skylight=False
r.Lumen.HardwareRayTracing=True r.Lumen.HardwareRayTracing=True
r.ReflectionMethod=1 r.ReflectionMethod=1
@@ -47,6 +47,7 @@ SkeletalMesh.UseExperimentalChunking=1
r.SkinCache.DefaultBehavior=0 r.SkinCache.DefaultBehavior=0
r.GenerateMeshDistanceFields=True r.GenerateMeshDistanceFields=True
r.DynamicGlobalIlluminationMethod=1 r.DynamicGlobalIlluminationMethod=1
r.AllowStaticLighting=False
[/Script/Engine.UserInterfaceSettings] [/Script/Engine.UserInterfaceSettings]
UIScaleCurve=(EditorCurveData=(Keys=((Time=540.000000,Value=0.250000),(Time=2160.000000,Value=1.000000)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None) UIScaleCurve=(EditorCurveData=(Keys=((Time=540.000000,Value=0.250000),(Time=2160.000000,Value=1.000000)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None)
@@ -197,7 +198,7 @@ bEnableDLSSInPlayInEditorViewports=False
bShowDLSSSDebugOnScreenMessages=False bShowDLSSSDebugOnScreenMessages=False
[/Script/Engine.GarbageCollectionSettings] [/Script/Engine.GarbageCollectionSettings]
gc.IncrementalBeginDestroyEnabled=False gc.IncrementalBeginDestroyEnabled=True
gc.MaxObjectsInGame=25165824 gc.MaxObjectsInGame=25165824
[/Script/Engine.AudioSettings] [/Script/Engine.AudioSettings]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -8,7 +8,7 @@ public class GraffModule : ModuleRules
{ {
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","UMG" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","UMG", "EasyXMLParser" });
PrivateDependencyModuleNames.AddRange(new string[] { }); PrivateDependencyModuleNames.AddRange(new string[] { });
+121 -2
View File
@@ -6,10 +6,12 @@
#include "Misc/paths.h" #include "Misc/paths.h"
#include "Engine/levelstreamingdynamic.h" #include "Engine/levelstreamingdynamic.h"
#include "cppFuncLibrary.h" #include "cppFuncLibrary.h"
#include "Misc/FileHelper.h"
#include "Async/Async.h"
/*for working tarray::Contains*/ /*for working tarray::Contains*/
bool operator==(const Fcppcoords& c1, const Fcppcoords& c2) { static bool operator==(const Fcppcoords& c1, const Fcppcoords& c2) {
return c1.flat == c2.flat && return c1.flat == c2.flat &&
c1.floor == c2.floor && c1.floor == c2.floor &&
c1.house == c2.house && c1.house == c2.house &&
@@ -18,7 +20,7 @@ bool operator==(const Fcppcoords& c1, const Fcppcoords& c2) {
c1.zone == c2.zone; c1.zone == c2.zone;
} }
/*for working tarray::Contains*/ /*for working tarray::Contains*/
bool operator==(const FcppLevelStruct& c1, const FcppLevelStruct& c2) { static bool operator==(const FcppLevelStruct& c1, const FcppLevelStruct& c2) {
return c1.anotherLvl == c2.anotherLvl && return c1.anotherLvl == c2.anotherLvl &&
c1.coords == c2.coords && c1.coords == c2.coords &&
c1.dontUnload == c2.dontUnload && c1.dontUnload == c2.dontUnload &&
@@ -27,6 +29,8 @@ bool operator==(const FcppLevelStruct& c1, const FcppLevelStruct& c2) {
c1.Z == c2.Z; c1.Z == c2.Z;
} }
TArray<ULevelStreaming*> UcppGI::cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords, uint8 currentState) TArray<ULevelStreaming*> UcppGI::cppLvlManage(UObject* WorldContextObject, Fcppcoords currentCoords, uint8 currentState)
{ {
TArray<ULevelStreaming*> outStruct; TArray<ULevelStreaming*> outStruct;
@@ -236,3 +240,118 @@ void UcppGI::cppCoordsToCppFlat(UObject* WorldContextObject, Fcppcoords coords,
} }
void UcppGI::cpp_parseXmlAsync(UObject* WorldContextObject, const TMap<int32, FIntPoint>& houseIds, FLatentActionInfo LatentInfo) {
UWorld* World = WorldContextObject ? WorldContextObject->GetWorld() : nullptr;
if (!World) return;
struct FParseXmlLatent : public FPendingLatentAction {
FName ExecutionFunction;
int32 OutputLink;
FWeakObjectPtr CallbackTarget;
bool bDone = false;
FParseXmlLatent(const FLatentActionInfo& Info)
: ExecutionFunction(Info.ExecutionFunction)
, OutputLink(Info.Linkage)
, CallbackTarget(Info.CallbackTarget) {}
virtual void UpdateOperation(FLatentResponse& Response) override {
Response.FinishAndTriggerIf(bDone, ExecutionFunction, OutputLink, CallbackTarget);
}
};
FParseXmlLatent* Action = new FParseXmlLatent(LatentInfo);
World->GetLatentActionManager().AddNewAction(LatentInfo.CallbackTarget, LatentInfo.UUID, Action);
Async(EAsyncExecution::ThreadPool, [this, houseIds, Action]() {
EEasyXMLParserFound fou;
EEasyXMLParserErrorCode er;
FString er1;
auto xfile = UEasyXMLParseManager::LoadFromFile(FPaths::ProjectSavedDir() + FString("flatdata.xml"), true, er, er1);
if (!xfile) { AsyncTask(ENamedThreads::GameThread, [Action]() { Action->bDone = true; }); return; }
auto offers = xfile->ReadElements(FString("realty-feed.offer"), fou);
if (fou != EEasyXMLParserFound::Found) { AsyncTask(ENamedThreads::GameThread, [Action]() { Action->bDone = true; }); return; }
TMap<FIntPoint, int32> flatKeyToOfferIdx;
flatKeyToOfferIdx.Reserve(offers.Num());
for (int32 i = 0; i < offers.Num(); ++i) {
auto& offer = offers[i];
const int32 houseId = offer->ReadInt(FString("yandex-house-id"), 0);
if (const FIntPoint* housePoint = houseIds.Find(houseId)) {
const int32 apartment = offer->ReadInt(FString("location.apartment"), 0);
flatKeyToOfferIdx.Add({ housePoint->X, apartment }, i);
}
}
struct FFlatUpdate { int32 Index; int32 Price; float Square; bool Available; FIntPoint Deadline; };
TArray<FFlatUpdate> updates;
updates.Reserve(flatArray.Num());
for (int32 idx = 0; idx < flatArray.Num(); ++idx) {
const auto& flat = flatArray[idx];
const int32* xmlFlatIdPtr = flatKeyToOfferIdx.Find({ flat.Zone, flat.FlatN });
if (!xmlFlatIdPtr) continue;
const int32 xmlFlatId = *xmlFlatIdPtr;
auto& xf = offers[xmlFlatId];
FFlatUpdate u;
u.Index = idx;
u.Price = xf->ReadInt(FString("price.value"), 0);
u.Square = xf->ReadFloat(FString("area.value"), 0);
u.Available = true;
u.Deadline = { xf->ReadInt(FString("ready-quarter"), 0), xf->ReadInt(FString("built-year"), 0) };
updates.Add(MoveTemp(u));
}
AsyncTask(ENamedThreads::GameThread, [this, Action, updates = MoveTemp(updates)]() mutable {
for (const auto& u : updates) {
if (!flatArray.IsValidIndex(u.Index)) continue;
auto& flat = flatArray[u.Index];
flat.Price = u.Price;
if (u.Square) flat.Square = u.Square;
flat.available = u.Available;
flat.deadline = u.Deadline;
flat.price_meter = (flat.Price && flat.Square) ? flat.Price / flat.Square : 0;
}
Action->bDone = true;
});
});
}
void UcppGI::fixXmlAsync(UObject* WorldContextObject, FString xmlPath, FLatentActionInfo LatentInfo) {
UWorld* World = WorldContextObject ? WorldContextObject->GetWorld() : nullptr;
if (!World) return;
struct FFixXmlLatent : public FPendingLatentAction {
FName ExecutionFunction;
int32 OutputLink;
FWeakObjectPtr CallbackTarget;
bool bDone = false;
FFixXmlLatent(const FLatentActionInfo& Info)
: ExecutionFunction(Info.ExecutionFunction)
, OutputLink(Info.Linkage)
, CallbackTarget(Info.CallbackTarget) {}
virtual void UpdateOperation(FLatentResponse& Response) override {
Response.FinishAndTriggerIf(bDone, ExecutionFunction, OutputLink, CallbackTarget);
}
};
FFixXmlLatent* Action = new FFixXmlLatent(LatentInfo);
World->GetLatentActionManager().AddNewAction(LatentInfo.CallbackTarget, LatentInfo.UUID, Action);
Async(EAsyncExecution::ThreadPool, [Action, xmlPath]() {
FString xml;
FFileHelper::LoadFileToString(xml, *xmlPath);
xml.ReplaceInline(L"><!", L">");
xml.ReplaceInline(L"]><", L"]<");
FFileHelper::SaveStringToFile(xml, *xmlPath);
AsyncTask(ENamedThreads::GameThread, [Action]() {
Action->bDone = true;
});
});
}
+7
View File
@@ -4,6 +4,8 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "EasyXMLElement.h"
#include "EasyXMLParseManager.h"
#include "cppGI.generated.h" #include "cppGI.generated.h"
/** /**
@@ -93,6 +95,11 @@ public:
UFUNCTION(blueprintcallable, blueprintPure, category = "Data", meta = (WorldContext = "WorldContextObject", BlueprintAutocast)) UFUNCTION(blueprintcallable, blueprintPure, category = "Data", meta = (WorldContext = "WorldContextObject", BlueprintAutocast))
static void cppCoordsToCppFlat(UObject* WorldContextObject, Fcppcoords coords, FcppflatStruct& flat, bool onlyCoords = true); static void cppCoordsToCppFlat(UObject* WorldContextObject, Fcppcoords coords, FcppflatStruct& flat, bool onlyCoords = true);
UFUNCTION(blueprintcallable, meta=(WorldContext = "WorldContextObject", Latent, LatentInfo="LatentInfo"), category = "Data")
void cpp_parseXmlAsync(UObject* WorldContextObject, const TMap<int32, FIntPoint>& houseIds, struct FLatentActionInfo LatentInfo);
UFUNCTION(blueprintcallable, meta=(WorldContext = "WorldContextObject", Latent, LatentInfo="LatentInfo"), category = "Data")
void fixXmlAsync(UObject* WorldContextObject, FString xmlPath, struct FLatentActionInfo LatentInfo);
/*list of lvls for anyway loading*/ /*list of lvls for anyway loading*/
UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "levelLoading") UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "levelLoading")