TGC Codebase Backup



Delete All Function by Pyramid Games Ltd

8th Oct 2007 21:46
Summary

This function deletes everything that you have loaded into DBP. Recoded by JosephB.



Description

Quoted from my forum post,

I know this command is probably crappy and useless, but I was using this instead typing in

cls
delete object 1
delete matrix 1
blah blah...

This Will Be Added in My Soon to Come eyeCORE Functions.
Recoded by JosephB.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `///Recoded By JosephB
function DeleteAll()
sync rate 0    `speed up process
delete objects 1,lastobjectnumber `This is the last object number 
    for i = 1 to 0xffff
        if i < 256
            if memblock exist(i) = 1 then delete memblock i
            if matrix exist(i) = 1 then delete matrix i
            if terrain exist(i) = 1 then delete terrain i
            if effect exist(i) = 1 then delete effect i
            if i < 33
                if file open(i) =1 then close file i
                if animation exist(i) =1 then delete animation i
                if i < 8
                    if light exist(i) = 1 then delete light i
                endif
            endif
        endif
        if image exist(i) = 1 then delete image i
        if sprite exist(i) = 1 then delete sprite i
        if sound exist(i) = 1 then delete sound i
        if music exist(i) = 1 then delete music i
        if mesh exist(i) = 1 then delete mesh i
    next i
endfunction