Updated STB_image to v2.00b
Former-commit-id: a0887de0a051fab7ceb34c4ed5e9aedde0e6b1a9
This commit is contained in:
parent
e69c2982b9
commit
119b043201
|
|
@ -15,29 +15,29 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
int Read(void* userdata, char* data, int size)
|
||||
int Read(void* userdata, char* data, int size)
|
||||
{
|
||||
NzInputStream* stream = static_cast<NzInputStream*>(userdata);
|
||||
return static_cast<int>(stream->Read(data, size));
|
||||
}
|
||||
|
||||
void Skip(void* userdata, int size)
|
||||
{
|
||||
NzInputStream* stream = reinterpret_cast<NzInputStream*>(userdata);
|
||||
return static_cast<int>(stream->Read(data, size));
|
||||
NzInputStream* stream = static_cast<NzInputStream*>(userdata);
|
||||
stream->SetCursorPos(static_cast<nzInt64>(stream->GetCursorPos()) + static_cast<nzInt64>(size));
|
||||
}
|
||||
|
||||
void Skip(void* userdata, unsigned int size)
|
||||
{
|
||||
NzInputStream* stream = reinterpret_cast<NzInputStream*>(userdata);
|
||||
stream->Read(nullptr, size);
|
||||
}
|
||||
|
||||
int Eof(void* userdata)
|
||||
{
|
||||
NzInputStream* stream = reinterpret_cast<NzInputStream*>(userdata);
|
||||
return stream->GetCursorPos() >= stream->GetSize();
|
||||
}
|
||||
int Eof(void* userdata)
|
||||
{
|
||||
NzInputStream* stream = static_cast<NzInputStream*>(userdata);
|
||||
return stream->GetCursorPos() >= stream->GetSize();
|
||||
}
|
||||
|
||||
static stbi_io_callbacks callbacks = {Read, Skip, Eof};
|
||||
|
||||
bool IsSupported(const NzString& extension)
|
||||
{
|
||||
static std::set<NzString> supportedExtensions = {"bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "psd", "tga"};
|
||||
static std::set<NzString> supportedExtensions = {"bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "ppm", "pgm", "psd", "tga"};
|
||||
return supportedExtensions.find(extension) != supportedExtensions.end();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue