mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 15:03:32 +00:00
REMOVE: png server dependency
This commit is contained in:
@@ -10,6 +10,7 @@ struct MemoryReader {
|
||||
};
|
||||
|
||||
static void pngMemoryRead(png_structp pngPtr, png_bytep outBytes, png_size_t byteCountToRead) {
|
||||
#ifndef STANDALONE_SERVER
|
||||
MemoryReader* reader = (MemoryReader*)png_get_io_ptr(pngPtr);
|
||||
if (!reader)
|
||||
return;
|
||||
@@ -21,10 +22,12 @@ static void pngMemoryRead(png_structp pngPtr, png_bytep outBytes, png_size_t byt
|
||||
|
||||
memcpy(outBytes, reader->data + reader->pos, byteCountToRead);
|
||||
reader->pos += byteCountToRead;
|
||||
#endif
|
||||
}
|
||||
|
||||
TextureData loadPngFromMemory(const unsigned char* data, size_t size) {
|
||||
TextureData out;
|
||||
#ifndef STANDALONE_SERVER
|
||||
if (!data || size == 0) return out;
|
||||
|
||||
png_structp pngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
@@ -89,6 +92,7 @@ TextureData loadPngFromMemory(const unsigned char* data, size_t size) {
|
||||
|
||||
png_destroy_read_struct(&pngPtr, &infoPtr, NULL);
|
||||
delete[] rowPtrs;
|
||||
#endif
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user