Free Shadow Bank?

Blitz3D Forums/Blitz3D Programming/Free Shadow Bank?

Dock(Posted 2004) [#1]
I'm using sswift's shadow system, and I was wondering how I would go about 'Free'ing the current static shadows.

Occassionally I move and change the objects in my scene, so I'd like to completely redo the static shadows. However, as it stands the shadows remain and I can't figure out how to get rid of them, let alone update them.

So... how do I kill Static_shadows?


Rob Farley(Posted 2004) [#2]
Contact Sswift maybe?


Dock(Posted 2004) [#3]
Perhaps, but if other people are having trouble too (or in future) then it would be better for such info to be in a forum. Also, there are lots of people here with experience with the shadow system.

Okay, to rephrase the question to have a little more general appeal. How do I empty 'Banks', or find out which banks are currently occupied?


AntonyWells(Posted 2004) [#4]
I've never had any probs with his sys, so can only answer generally...as far as banks go. Create a wrapper class.

i.e,


type bank
   field real
end type

function NewBank(Size)
    out.bank =new bank
    out\real=createBank(size)
    return out\real
end function

function countBank()
   for b.bank =each bank
       bc=bc+1
   next
   return bc
end function

function getBank(Index)
  for out.bank =each bank
     index=index-1
     if index=0 return out\real
  next
end function

function DeleteBank(bank)
   for b.bank =each bank
       if b\real=bank 
          freeBank bank
          delete b
          return
       endif
   next
   runtimeerror "bank does not exist"
end function


(cracks fingers)

and you can count through them, etc. You pretty much have to write wrapper 'classes' for anything b3d does..


Dock(Posted 2004) [#5]
Thanks for the help Antony. Unfortunately that didn't really seem to help me, or I was misunderstanding how to apply it.

Further developments into this (it's been a busy week, so I'm just coming back to coding now)... It seems that if I call update_static_shadows(cam) more than once in my loop, it will give an error of "entity does not exist" or "texture does not exist".

Could this be because I'm using an array of entities rather than individual entities? I have no idea... -_-