Edit:
Seems i was wrong, using another (good) memory probe it seems the rapid growth is just a misrepresentation in Taskmanager
.
Grows a little but it can just be written up to other variable accumulation.
Back on track, happy camper, truly an amazing and useful plugin, many thanks!
<---------
Great plugin, many thanks.
( Can't be without it so i hope this can be fixed in an update
)
With the 2.05 & DBP 7.3 i noticed that it probably has a memory leak (have not rolled back to test the old memblock version yet).
I was rewriting stuff to prevent memory leaks in DP (more "ouch" there
) but i noticed my memory was eaten up anyway. On scene reset i have to remove or resetup the collisions. While in the main loop i reuse all objects so it's not noticeable then. The application has to be restarted eventually as it is now though.
Maybe a "clear all collisions" command like Mr Bigger suggested, but i suspect the leaked memory wont be returned by that.
Made a test program, two boxes colliding and getting removed, and a mode where it just uses sc_setupobject on the same objects again.
Check taskmanager...
` Test memory leak SC.
` testmode = 1 , object remove on impact.
` testmode = 2 , no object deletion just a new call to sc_setupobject, if i understand the helptext (below) correctly this should work.
`setupObject can be sucessfully called on an existing object, doing so
`will overwrite any stored collision data with the new object's data and reset collision to ON
`and scaling to False. The only drawback is re-settingup a complex/polygon object may take time.
testmode = 1
Sync Rate 60
Sync On
Set Window on
autocam off
Move Camera -100
gosub setup
do
text 1,1, "Check Taskmanager. (Press space to speed things up)"
if testmode = 1 then text 1,20, "FPS: " + str$(screen fps()) + ", testmode = Remove both objects"
if testmode = 2 then text 1,20, "FPS: " + str$(screen fps()) + ", testmode = Re-setup objects, no removal"
Control Camera Using Arrowkeys 0,3,3
if SC_objectCollision ( 1, 2 )
if Mode = 1
sc_removeobject 1
sc_removeobject 2
delete object 1
delete object 2
endif
gosub setup
endif
Move Object 1,1
Move Object 2,1
sc_updateobject 1
sc_updateobject 2
if spacekey()
Sync Rate 0
else
sync rate 60
endif
sync
loop
end
setup:
if Mode = 0 or testmode=1
Make Object Box 1,20,20,20
Make Object Box 2,20,20,20
Mode = testmode
endif
sc_setupobject 1,0,2
sc_setupobject 2,0,2
Position Object 1,-50,0,0
Position Object 2,50,0,0
Point Object 1,0,0,0
Point Object 2,0,0,0
return
Regards