Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions include/vtfpp/VTF.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,17 @@ class VTF {
ImageConversion::ResizeMethod widthResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
ImageConversion::ResizeMethod heightResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::BILINEAR;
Flags flags = FLAG_NONE;
uint16_t initialFrameCount = 1;
uint16_t initialSliceCount = 1;
uint16_t startFrame = 0;
bool isCubeMap = false;
bool hasSphereMap = false;
uint16_t initialSliceCount = 1;
bool createMips = true;
bool createThumbnail = true;
bool createReflectivity = true;
Flags flags = FLAG_NONE;
float bumpMapScale = 1.f;
uint16_t startFrame = 0;
uint8_t compressionLevel = 6;
float bumpMapScale = 1.f;
};

/// This value is only valid when passed to VTF::create through CreationOptions
Expand All @@ -172,8 +173,6 @@ class VTF {

static constexpr int32_t MAX_RESOURCES = 32;

static constexpr uint16_t SPHEREMAP_START_FRAME = 0xffff;

VTF();

explicit VTF(std::vector<std::byte>&& vtfData, bool parseHeaderOnly = false);
Expand Down Expand Up @@ -246,19 +245,19 @@ class VTF {

[[nodiscard]] uint8_t getFaceCount() const;

bool setFaceCount(bool hasMultipleFaces, bool hasSphereMap = false);
bool setFaceCount(bool isCubemap, bool hasSphereMap = false);

//bool computeSphereMap();

[[nodiscard]] uint16_t getSliceCount() const;

bool setSliceCount(uint16_t newSliceCount);

bool setFrameFaceAndSliceCount(uint16_t newFrameCount, bool hasMultipleFaces, bool hasSphereMap = false, uint16_t newSliceCount = 1);
bool setFrameFaceAndSliceCount(uint16_t newFrameCount, bool isCubemap, bool hasSphereMap = false, uint16_t newSliceCount = 1);

[[nodiscard]] uint16_t getStartFrame() const;

bool setStartFrame(uint16_t newStartFrame);
void setStartFrame(uint16_t newStartFrame);

[[nodiscard]] sourcepp::math::Vec3f getReflectivity() const;

Expand Down Expand Up @@ -347,8 +346,6 @@ class VTF {

static void createInternal(VTF& writer, CreationOptions options);

[[nodiscard]] static uint8_t getFaceCountFor(uint16_t width, uint16_t height, uint32_t majorVersion, uint32_t minorVersion, Flags flags, uint16_t startFrame);

[[nodiscard]] Resource* getResourceInternal(Resource::Type type);

void setResourceInternal(Resource::Type type, std::span<const std::byte> data_);
Expand Down
Loading