You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Blueprint real number support. This change deprecates the use the of "float" and "double" types in Blueprints in favor of a new "real". By default, "real" is back by a double precision floating point number. However, it can be single precision if the number is a native float property or function parameter. This distinction won't be visible to the Blueprint user: in both instances, they'll be represented by "real" pin types. During deserialization, we'll automatically convert Blueprint pin types to use real/doubles, unless they're used to represent native code (including delegate signatures). One consequence of this change is that we need to perform implicit casts between single and double precision real numbers. During Blueprint compilation, the compiler will detect points in the graph for when either a widening or narrowing conversion needs to occur. Subsequently, the script bytecode will contain a new cast instruction that performs the conversion. This also works on container types, but each entry in the container will have to be converted. This can introduce unwanted overhead for large containers that are frequently passed between Blueprint and native code. The scope of this change affects Blueprints used by Gameplay, Animation, Control Rig, and UMG. #rb marc.audy (serialization changes) #jira UE-116484 #preflight 61f8bdd5a2514ba12ff7bdfc #ROBOMERGE-AUTHOR: dave.jones2 #ROBOMERGE-SOURCE: CL 18809077 in //UE5/Release-5.0/... via CL 18809455 via CL 18822548 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545) [CL 18823569 by dave jones2 in ue5-main branch]
88 lines
2.3 KiB
C++
88 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ScriptDisassembler.h: Disassembler for Kismet bytecode.
|
|
=============================================================================*/
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/Script.h"
|
|
|
|
/**
|
|
* Kismet bytecode disassembler; Can be used to create a human readable version
|
|
* of Kismet bytecode for a specified structure or class.
|
|
*/
|
|
class FKismetBytecodeDisassembler
|
|
{
|
|
private:
|
|
TArray<uint8> Script;
|
|
FString Indents;
|
|
FOutputDevice& Ar;
|
|
public:
|
|
/**
|
|
* Construct a disassembler that will output to the specified archive.
|
|
*
|
|
* @param InAr The archive to emit disassembled bytecode to.
|
|
*/
|
|
SCRIPTDISASSEMBLER_API FKismetBytecodeDisassembler(FOutputDevice& InAr);
|
|
|
|
/**
|
|
* Disassemble all of the script code in a single structure.
|
|
*
|
|
* @param [in,out] Source The structure to disassemble.
|
|
*/
|
|
SCRIPTDISASSEMBLER_API void DisassembleStructure(UFunction* Source);
|
|
|
|
/**
|
|
* Disassemble all functions in any classes that have matching names.
|
|
*
|
|
* @param InAr The archive to emit disassembled bytecode to.
|
|
* @param ClassnameSubstring A class must contain this substring to be disassembled.
|
|
*/
|
|
SCRIPTDISASSEMBLER_API static void DisassembleAllFunctionsInClasses(FOutputDevice& Ar, const FString& ClassnameSubstring);
|
|
private:
|
|
|
|
// Reading functions
|
|
int32 ReadINT(int32& ScriptIndex);
|
|
uint64 ReadQWORD(int32& ScriptIndex);
|
|
uint8 ReadBYTE(int32& ScriptIndex);
|
|
FString ReadName(int32& ScriptIndex);
|
|
uint16 ReadWORD(int32& ScriptIndex);
|
|
float ReadFLOAT(int32& ScriptIndex);
|
|
double ReadDOUBLE(int32& ScriptIndex);
|
|
FVector ReadFVECTOR(int32& ScriptIndex);
|
|
CodeSkipSizeType ReadSkipCount(int32& ScriptIndex);
|
|
FString ReadString(int32& ScriptIndex);
|
|
FString ReadString8(int32& ScriptIndex);
|
|
FString ReadString16(int32& ScriptIndex);
|
|
|
|
EExprToken SerializeExpr(int32& ScriptIndex);
|
|
void ProcessCommon(int32& ScriptIndex, EExprToken Opcode);
|
|
|
|
void InitTables();
|
|
|
|
template<typename T>
|
|
void Skip(int32& ScriptIndex)
|
|
{
|
|
ScriptIndex += sizeof(T);
|
|
}
|
|
|
|
void AddIndent()
|
|
{
|
|
Indents += TEXT(" ");
|
|
}
|
|
|
|
void DropIndent()
|
|
{
|
|
// Blah, this is awful
|
|
Indents.LeftInline(Indents.Len() - 2);
|
|
}
|
|
|
|
template <typename T>
|
|
T* ReadPointer(int32& ScriptIndex)
|
|
{
|
|
return (T*)ReadQWORD(ScriptIndex);
|
|
}
|
|
};
|