Posho
Member
Hello, I have this issue. I'm working on a function that basically draws SWF sprites on a surface and saves them as regular sprites to use them as 3D textures for walls and stuff. I started implementing an user-set quality variable, which basically helps with setting the new sprites' size.
qual = 2 -> 1024x1024 texture
qual = 1 -> 512x512 texture (original SWF size)
qual = 0.5 -> 256x256 texture
qual = 0.25 -> 128x128 texture
etc.
The thing is that when qual is somewhere between 0 and 1 the outcome works as expected, however when qual is bigger than 1 it starts darkening the texture until 2 when it becomes pitch-black.
qual = 0.5 -> right color
qual = 1 -> right color
qual = 1.5 -> darker color
qual = 2 -> pitch-black
Take a look at the code if you want. As you can see I set the Draw color to c_white before drawing and the original textures' sizes are all a power of 2, so I don't know what the issue would be.
Any ideas? I've been days stuck on this thing.
qual = 2 -> 1024x1024 texture
qual = 1 -> 512x512 texture (original SWF size)
qual = 0.5 -> 256x256 texture
qual = 0.25 -> 128x128 texture
etc.
The thing is that when qual is somewhere between 0 and 1 the outcome works as expected, however when qual is bigger than 1 it starts darkening the texture until 2 when it becomes pitch-black.
qual = 0.5 -> right color
qual = 1 -> right color
qual = 1.5 -> darker color
qual = 2 -> pitch-black
Take a look at the code if you want. As you can see I set the Draw color to c_white before drawing and the original textures' sizes are all a power of 2, so I don't know what the issue would be.
Code:
draw_enable_swf_aa(true);
draw_set_swf_aa_level(1);
draw_set_color(c_white)
qual = 2
surf = surface_create(sprite_get_width(argument0)*qual,sprite_get_height(argument0)*qual)
surface_set_target(surf)
draw_clear_alpha(make_colour_hsv(0,0,10), false);
draw_sprite_stretched(argument0, 0, 0, 0, sprite_get_width(argument0)*qual, sprite_get_height(argument0)*qual)
surface_reset_target();
spr = sprite_create_from_surface(surf,0,0,sprite_get_width(argument0)*qual,sprite_get_height(argument0)*qual,argument1,true,(sprite_get_width(argument0)*qual)/2,sprite_get_height(argument0)*qual)
surface_free(surf)
Any ideas? I've been days stuck on this thing.