[PICA] Add texture format -> string function

This commit is contained in:
wheremyfoodat 2023-03-06 23:36:38 +02:00
parent f0e2db19ea
commit 8a15a42763
2 changed files with 29 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <array>
#include <string>
#include "boost/icl/interval.hpp"
#include "helpers.hpp"
#include "opengl.hpp"
@ -67,6 +68,14 @@ struct Texture {
static u32 getSwizzledOffset(u32 u, u32 v, u32 width, u32 bytesPerPixel);
static u32 getSwizzledOffset_4bpp(u32 u, u32 v, u32 width);
// Returns the string representation of a texture format
static std::string textureFormatToString(Formats fmt);
// Returns the format of this texture as a string
std::string formatToString() {
return textureFormatToString(format);
}
// Returns the texel at coordinates (u, v) of an ETC1(A4) texture
// TODO: Make hasAlpha a template parameter
u32 getTexelETC(bool hasAlpha, u32 u, u32 v, u32 width, const void* data);