Extlibs/STB: Update stb_image.h and add stb_image_write.h
Former-commit-id: 1b567271240b0207780c2d516fad9e03575ce388
This commit is contained in:
parent
ff0efbaf47
commit
883f2eca39
|
|
@ -3,7 +3,7 @@
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
#include <Nazara/Utility/Formats/STBLoader.hpp>
|
#include <Nazara/Utility/Formats/STBLoader.hpp>
|
||||||
#include <stb_image/stb_image.h>
|
#include <stb/stb_image.h>
|
||||||
#include <Nazara/Core/Endianness.hpp>
|
#include <Nazara/Core/Endianness.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Core/File.hpp>
|
#include <Nazara/Core/File.hpp>
|
||||||
|
|
@ -17,6 +17,12 @@ namespace Nz
|
||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
int Eof(void* userdata)
|
||||||
|
{
|
||||||
|
Stream* stream = static_cast<Stream*>(userdata);
|
||||||
|
return stream->GetCursorPos() >= stream->GetSize();
|
||||||
|
}
|
||||||
|
|
||||||
int Read(void* userdata, char* data, int size)
|
int Read(void* userdata, char* data, int size)
|
||||||
{
|
{
|
||||||
Stream* stream = static_cast<Stream*>(userdata);
|
Stream* stream = static_cast<Stream*>(userdata);
|
||||||
|
|
@ -29,12 +35,6 @@ namespace Nz
|
||||||
stream->SetCursorPos(static_cast<Int64>(stream->GetCursorPos()) + static_cast<Int64>(size));
|
stream->SetCursorPos(static_cast<Int64>(stream->GetCursorPos()) + static_cast<Int64>(size));
|
||||||
}
|
}
|
||||||
|
|
||||||
int Eof(void* userdata)
|
|
||||||
{
|
|
||||||
Stream* stream = static_cast<Stream*>(userdata);
|
|
||||||
return stream->GetCursorPos() >= stream->GetSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
static stbi_io_callbacks callbacks = {Read, Skip, Eof};
|
static stbi_io_callbacks callbacks = {Read, Skip, Eof};
|
||||||
|
|
||||||
bool IsSupported(const String& extension)
|
bool IsSupported(const String& extension)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue