S
Sozidar
Guest
Original png file size is 3.58 kb and file size of the saved buffer is 1088 kb, which is kinda sad. Is there a way around this, or am I doing something wrong? Any help is greatly appreciated
I'm using chunk system for loading and unloading resources from included files to avoid loading screens since its open world. Have no problems with manipulating json files, but couldn't find any alternative to sprite_add. The only somewhat viable option I found is to replace all of the included images with generated surface buffer files (code above) and load them in game asynchronously and then project them onto the surfaces. This method is a lot faster than sprite_add, but the file sizes are unacceptably huge.
Code:
w = 128;
h = 2176;
surf = surface_create(w,h);
surface_set_target(surf);
draw_sprite(vst_castle_walls,0,0,0);
surface_reset_target();
size = w * h * 4;
buff = buffer_create(size, buffer_fixed, 1);
buffer_get_surface(buff, surf, buffer_surface_copy, 0, 0);
buffer_save_ext(buff,"test.txt",0,size);
Last edited by a moderator: