Feature request > 2D

Destroying all objects/sounds etc etc

(1/2) > >>

MrTAToad:
Could do with a proper way of destroying all loaded objects, sprites, music and sfx etc etc - doing this by loading an invalid file is a bit inefficient.

Hemlos:
I never had a need for this, but i think this is how its done:

LOADSPRITE "myfile.bmp",0

LOADSPRITE "",0
edit:

Reuse the index's to unload and reload something new in its place.

MrTAToad:
Its how I do it - but having to loop through a large number of items is a bit time consuming.  A nice command to do it would be most useful.

In addition, I'm not sure doing a load with an invalid filename actually deletes the sprite/sound etc etc properly.

Hemlos:
It does delete it, or at least it USED TO....

im going to test it for you.
brb

Hemlos:
This definetly works in windows xp, memory is freed by using LOADSPRITE "",0


And this wont take but a fraction of a second:

--- Code: (glbasic) ---for i=0 to 10000
loadsprite "",i
x_loadobj "",i
loadsound "",i

next
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version