thandwiches01
Member
I have a memory leak in my minimap object, but I can't find it, any help would be appreciated
Here is my code:
Here is my code:
Code:
/*
I have all my objects visible from the map, set to a child of par_minimap.
*/
//CREATE EVENT FOR MINIMAP OBJECT
oSurface = surface_create(400,400);
//STEP EVENT FOR MINIMAP OBJECT
if !surface_exists(oSurface)
sw = surface_get_width(oSurface)
sh = surface_get_height(oSurface)
{
oSurface = surface_create(400,400)
}
if surface_exists(oSurface)
{
surface_set_target(oSurface);
draw_clear(c_gray);
d3d_set_projection_ortho(obj_player.x,obj_player.y,400,400,-obj_player.direction+90)
var numObjects = instance_number(par_minimap)
for (var i = 0; i < numObjects; i++)
{
var obj = instance_find(par_minimap,i);
var _px = obj_player.x
var _py = obj_player.y
with(obj)
{
draw_sprite_ext(sprite_index,0,x+128+72, y+128+72,1,1,0,c_white,1)
}
}
surface_reset_target()
}
surface_reset_target()
//DRAW GUI EVENT FOR MINIMAP OBJECT
if surface_exists(oSurface)
{
draw_surface_ext(oSurface, 8, 8, 0.5,0.5,0,c_white,1);
var old = draw_get_color();
draw_set_alpha(0.5)
draw_set_color(c_black)
draw_rectangle(8,8,8+200,8+200,true);
draw_rectangle(8-1,8-1,8+200+1,8+200+1,true);
draw_set_colour(old)
draw_set_alpha(1)