* split up FMultiPatchTexture into a builder class and the actual image source. * since images can now be referenced by multiple textures the old redirection mechanism has been removed. It can be done better and less intrusive now. Simple single patch textures already directly reference the underlying patch image now. * allocate all image source related data from a memory arena. Since this is all static this makes it a lot easier to free this in bulk.
44 lines
802 B
C++
44 lines
802 B
C++
#pragma once
|
|
|
|
#include "textures.h"
|
|
//-----------------------------------------------------------------------------
|
|
//
|
|
// This is not a real texture but will be added to the texture manager
|
|
// so that it can be handled like any other sky.
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
|
|
class FSkyBox : public FTexture
|
|
{
|
|
public:
|
|
|
|
FTexture * faces[6];
|
|
bool fliptop;
|
|
|
|
FSkyBox(const char *name = nullptr);
|
|
TArray<uint8_t> Get8BitPixels(bool alphatex);
|
|
int CopyPixels(FBitmap *bmp);
|
|
|
|
void SetSize()
|
|
{
|
|
if (faces[0])
|
|
{
|
|
CopySize(faces[0]);
|
|
}
|
|
}
|
|
|
|
bool Is3Face() const
|
|
{
|
|
return faces[5] == nullptr;
|
|
}
|
|
|
|
bool IsFlipped() const
|
|
{
|
|
return fliptop;
|
|
}
|
|
|
|
FImageSource *GetImage() const override
|
|
{
|
|
return faces[0] ? faces[0]->GetImage() : nullptr;
|
|
}
|
|
};
|