Skip to content

Commit

Permalink
fixed 4.27 build
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeioris committed Jul 6, 2023
1 parent bd6323c commit 0a2df52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Source/glTFRuntime/Private/glTFRuntimeParserMaterials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,12 +1398,12 @@ void FglTFRuntimeDDS::LoadMips(const int32 TextureIndex, TArray<FglTFRuntimeMipM

int32 FglTFRuntimeTextureMipDataProvider::GetMips(const FTextureUpdateContext& Context, int32 StartingMipIndex, const FTextureMipInfoArray& MipInfos, const FTextureUpdateSyncOptions& SyncOptions)
{
#if ENGINE_MAJOR_VERSION == 4
#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION < 27
const int32 CurrentFirstLODIdx = Context.CurrentFirstMipIndex;
#endif
for (int32 MipIndex = StartingMipIndex; MipIndex < CurrentFirstLODIdx; MipIndex++)
{
#if ENGINE_MAJOR_VERSION >= 5
#if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 27
const FTexture2DMipMap& MipMap = *Context.MipsView[MipIndex];
#else
// pretty brutal (we are always assuming UTexture2D), but should be safe
Expand Down
10 changes: 7 additions & 3 deletions Source/glTFRuntime/Public/glTFRuntimeParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ struct FglTFRuntimeMipMap
class FglTFRuntimeTextureMipDataProvider : public FTextureMipDataProvider
{
public:
#if ENGINE_MAJOR_VERSION >= 5
#if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 27
FglTFRuntimeTextureMipDataProvider(const UTexture* Texture, ETickState InTickState, ETickThread InTickThread) : FTextureMipDataProvider(Texture, InTickState, InTickThread)
#else
FglTFRuntimeTextureMipDataProvider(ETickState InTickState, ETickThread InTickThread) : FTextureMipDataProvider(InTickState, InTickThread)
Expand Down Expand Up @@ -1340,12 +1340,16 @@ class UglTFRuntimeTextureMipDataProviderFactory : public UTextureMipDataProvider
GENERATED_BODY()

public:
#if ENGINE_MAJOR_VERSION >= 5
#if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 27
virtual FTextureMipDataProvider* AllocateMipDataProvider(UTexture* Asset) { return new FglTFRuntimeTextureMipDataProvider(Asset, FTextureMipDataProvider::ETickState::Init, FTextureMipDataProvider::ETickThread::Async); }
virtual bool WillProvideMipDataWithoutDisk() const override { return true; }
#else
virtual FTextureMipDataProvider* AllocateMipDataProvider() { return new FglTFRuntimeTextureMipDataProvider(FTextureMipDataProvider::ETickState::Init, FTextureMipDataProvider::ETickThread::Async); }
#endif

#if ENGINE_MAJOR_VERSION >= 5
virtual bool WillProvideMipDataWithoutDisk() const override { return true; }
#endif

};

struct FglTFRuntimeTextureTransform
Expand Down

0 comments on commit 0a2df52

Please sign in to comment.