WIP
This commit is contained in:
parent
58513d70c0
commit
0c6105e418
7 changed files with 168 additions and 2 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <Spectre/Graphics/Image.h>
|
||||
#include "ImageLoader.h"
|
||||
|
||||
#include "Image/IcoFormat.h"
|
||||
|
||||
// Disable some file formats that we don't use.
|
||||
#define STBI_NO_PSD
|
||||
#define STBI_NO_PIC
|
||||
|
|
@ -50,6 +52,11 @@ bool ImageLoader::loadFromMemory(const void *data, unsigned size, Image& img)
|
|||
int w, h, n_comp;
|
||||
const stbi_uc *ptr = (const stbi_uc *) data;
|
||||
|
||||
if (ptr[0] == 0x0) {
|
||||
image::IcoFormat ico;
|
||||
return ico.decode(img, ptr, size);
|
||||
}
|
||||
|
||||
unsigned char *pixels = stbi_load_from_memory(ptr, size, &w, &h, &n_comp, 4);
|
||||
|
||||
if (pixels) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue