Sprite Automatic Transparency (problem)

Blitz3D Forums/Blitz3D Beginners Area/Sprite Automatic Transparency (problem)

Just as a matter of being tidy, i think your creating a memory leak if you use this code:


;If KeyHit(2) Then
;FreeEntity Soldier
;Soldier=LoadSprite(StartWeapon$,1)
;ShotgunS(1)=LoadTexture("images/personageShotgun1.bmp",1)
;EndIf


Your freeing the sprite, and reloading it. Fair enough. BUT your also loading a texture into the same place the previous texture was. Now you have no reference to the last texture and it will sit in memory, thus creating a memory leak.