mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
Merge branch 'voxel-upd' into vixel-upd-2
This commit is contained in:
commit
d9e1d353d5
36 changed files with 498 additions and 286 deletions
|
|
@ -302,7 +302,7 @@ void JObject::num(std::string key, float& dst) const {
|
|||
dst = getNum(key, dst);
|
||||
}
|
||||
|
||||
void JObject::num(std::string key, ubyte& dst) const {
|
||||
void JObject::num(std::string key, u_char8& dst) const {
|
||||
dst = getInteger(key, dst);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace json {
|
|||
void num(std::string key, uint& dst) const;
|
||||
void num(std::string key, int64_t& dst) const;
|
||||
void num(std::string key, uint64_t& dst) const;
|
||||
void num(std::string key, ubyte& dst) const;
|
||||
void num(std::string key, u_char8& dst) const;
|
||||
void num(std::string key, double& dst) const;
|
||||
JObject* obj(std::string key) const;
|
||||
JArray* arr(std::string key) const;
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
#include <png.h>
|
||||
|
||||
// returns 0 if all-right, 1 otherwise
|
||||
int _png_write(const char* filename, uint width, uint height, const ubyte* data, bool alpha) {
|
||||
uint pixsize = alpha ? 4 : 3;
|
||||
int _png_write(const char* filename, u_int width, u_int height, const u_char8* data, bool alpha) {
|
||||
u_int pixsize = alpha ? 4 : 3;
|
||||
|
||||
// Open file for writing (binary mode)
|
||||
FILE* fp = fopen(filename, "wb");
|
||||
|
|
@ -355,5 +355,5 @@ Texture* png::load_texture(std::string filename) {
|
|||
}
|
||||
|
||||
void png::write_image(std::string filename, const ImageData* image) {
|
||||
_png_write(filename.c_str(), image->getWidth(), image->getHeight(), (const ubyte*)image->getData(), image->getFormat() == ImageFormat::rgba8888);
|
||||
_png_write(filename.c_str(), image->getWidth(), image->getHeight(), (const u_char8*)image->getData(), image->getFormat() == ImageFormat::rgba8888);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue