Following is the better and easier to use version which i posted in DBPro forum. You will find it useful believe me.
USE ATTACHED MEDIA
Rem ***** Main Source File *****
REM SCREEN INIT
Sync Rate 60 : Sync On : AutoCam Off : Backdrop On
Set Camera Range 0, 0.1, 10000 : Set Camera Fov 62
Set Normalization On
Set Ambient Light 75
REM MAKE LEVEL
oTerrain = terrainCreate(\"1\", 2.0, 0.0, 0.0, 0.0)
vegetationCreate(\"1\", oTerrain, 100, 32, 255, 0, 1)
GLOBAL mx, my, mz, mmx, mmy, mmz
setMouse(0)
While Not EscapeKey()
setMouse(0)
ax# = WrapValue(ax# + mmy)
ay# = WrapValue(ay# + mmx)
Rotate Camera ax#, ay#, 0.0
If MouseClick()=1 Then Move Camera 5
If MouseClick()=2 Then Move Camera -5
vegetationUpdate(400)
Print freeObject()
GOSUB Info
Sync
EndWhile
End
Function vegetationUpdate(minDistance As Integer)
For i = 1 To Array Count(vegetation())
If Object Exist(vegetation(i))
If getDistanceObjToCam(vegetation(i)) > minDistance
Exclude Object On vegetation(i)
Else
Exclude Object Off vegetation(i)
Point Object vegetation(i), Camera Position X(), Object Position Y(vegetation(i)), Camera Position Z()
EndIf
EndIf
Next i
EndFunction
Function vegetationCreate(folder As String, terrain As Integer, minHeight As Integer, grassSize As Integer, grassColor As Byte, treeColor As Byte, random As Boolean)
grass1Obj = freeObject() : Make Object Plain grass1Obj, grassSize, grassSize, 1
grass1Img = freeImage() : Load Image folder + \"/grass/grass1.tga\", grass1Img
Texture Object grass1Obj, grass1Img : Set Object Transparency grass1Obj, 6
Offset Limb grass1Obj, 0, 0, Object Size Y(grass1Obj)/2.0, 0
grass2Obj = freeObject() : Make Object Plain grass2Obj, grassSize, grassSize, 1
grass2Img = freeImage() : Load Image folder + \"/grass/grass2.tga\", grass2Img
Texture Object grass2Obj, grass2Img : Set Object Transparency grass2Obj, 6
Offset Limb grass2Obj, 0, 0, Object Size Y(grass2Obj)/2.0, 0
grass3Obj = freeObject() : Make Object Plain grass3Obj, grassSize, grassSize, 1
grass3Img = freeImage() : Load Image folder + \"/grass/grass3.tga\", grass3Img
Texture Object grass3Obj, grass3Img : Set Object Transparency grass3Obj, 6
Offset Limb grass3Obj, 0, 0, Object Size Y(grass3Obj)/2.0, 0
grass4Obj = freeObject() : Make Object Plain grass4Obj, grassSize, grassSize, 1
grass4Img = freeImage() : Load Image folder + \"/grass/grass4.tga\", grass4Img
Texture Object grass4Obj, grass4Img : Set Object Transparency grass4Obj, 6
Offset Limb grass4Obj, 0, 0, Object Size Y(grass4Obj)/2.0, 0
DIM vegetation(0) As Integer
bmpPlantMap = freeBitmap()
Load Bitmap folder + \"/plant.bmp\", bmpPlantMap
Set Current Bitmap bmpPlantMap
Local color As dWord
For x = 1 To Bitmap Width(bmpPlantMap)
For z = 1 To Bitmap Height(bmpPlantMap)
color = RgbG(Point(x,z))
If color = grassColor
x# = (Object Size X(terrain) / Bitmap Width(bmpPlantMap) * x) - (Object Size X(terrain)/2.0)
z# = (Object Size Z(terrain) / Bitmap Height(bmpPlantMap) * z) - (Object Size Z(terrain)/2.0)
If random = 1
x# = x# + (Rnd(grassSize)-(grassSize/2.0))
z# = z# + (Rnd(grassSize)-(grassSize/2.0))
EndIf
y# = Get Terrain Ground Height (terrain, x#, z#)
If y# < minHeight
Array Insert At Bottom vegetation()
arrayCount = Array Count(vegetation())
obj = freeObject()
vegetation(arrayCount) = obj
sourceObj = Rnd(3)+1
If sourceObj = 1 Then Instance Object obj, grass1Obj
If sourceObj = 2 Then Instance Object obj, grass2Obj
If sourceObj = 3 Then Instance Object obj, grass3Obj
If sourceObj = 4 Then Instance Object obj, grass4Obj
Position Object obj, x#, y#, z#
EndIf
EndIf
Next z
Next x
Set Current bitmap 0
Delete Bitmap bmpPlantMap
EndFunction
Info:
Set Cursor 0, 0
Print \"Fps: \",Screen Fps()
Print \"Static: \", Statistic(1)
`Paste Image showImage, 576, 0
Return
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
`folder = terrains folder
`s = size
`x,y,z = position coordinates
Function terrainCreate(folder As String, s As Float, x As Float, y As Float, z As Float)
imgC = freeImage() : Load Image folder + \"/color.bmp\", imgC
imgD = freeImage() : Load Image folder + \"/detail.tga\", imgD
oTer = freeObject()
Make Object Terrain oTer
Set Terrain Heightmap oTer, folder + \"/height.bmp\"
Set Terrain Scale oTer, 5.0*s, 0.5*s, 5.0*s
Set Terrain Split oTer, 8
Set Terrain Tiling oTer, 4
`Set Terrain Light oTer, x#, y#, z#, 1, 1, 0.78, 0.5
Set Terrain Texture oTer, imgC, imgD
Build Terrain oTer
Position Object oTer, x-Object Size X(oTer)/2.0, y, z-Object Size Z(oTer)/2.0
Set Object Light oTer, 1
EndFunction oTer
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function getDistanceObjToCam(o As Integer)
xd# = Camera Position x() - Object Position x(o)
yd# = Camera Position y() - Object Position y(o)
zd# = Camera Position z() - Object Position z(o)
Distance# = ((xd#*xd#) + (yd#*yd#) + (zd#*zd#))^0.5
EndFunction Distance#
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function setMouse(debug As Boolean)
mx = mouseX() : my = mouseY() : mz = mouseZ()
mmx = mouseMoveX() : mmy = mouseMoveY() : mmz = mouseMoveZ()
If debug > 0
Center Text mx, my+14, \"Mx: \"+Str$(mx)
Center Text mx, my+28, \"My: \"+Str$(my)
EndIf
endFunction
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeBitmap()
Repeat
Inc i
Until Bitmap Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeImage()
Repeat
Inc i
Until Image Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeObject()
Repeat
Inc i
Until Object Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Notes:
Any 64x64 map will do which has green colors, in this case green(255) is the color for grass.
you can easily add more colors for different items and make up a full eco-system like VUE5 has in no time.
It doesnt have to be plain objects, it can be any 3d object with a little tweaking of the code.
Play with this value
vegetationUpdate(400) like 100 or 500 to see what effect it does.
Change the height value in here
vegetationCreate(\"1\", oTerrain, 100, 32, 255, 0, 1) to 20 or 150 to see what effect it does.
EDIT:
CODE UPDATE
This is how you will add
WIND to your grass without any loss of FPS.(maybe 1 or 2 fps though depends on your hardware)
Rem ***** Main Source File *****
REM SCREEN INIT
Sync Rate 60 : Sync On : AutoCam Off : Backdrop On
Set Camera Range 0, 0.1, 10000 : Set Camera Fov 62
Set Normalization On
Set Ambient Light 75
REM MAKE LEVEL
oTerrain = terrainCreate(\"1\", 2.0, 0.0, 0.0, 0.0)
vegetationCreate(\"1\", oTerrain, 100, 32, 255, 0, 1)
GLOBAL mx, my, mz, mmx, mmy, mmz
setMouse(0)
While Not EscapeKey()
setMouse(0)
ax# = WrapValue(ax# + mmy)
ay# = WrapValue(ay# + mmx)
Rotate Camera ax#, ay#, 0.0
If MouseClick()=1 Then Move Camera 5
If MouseClick()=2 Then Move Camera -5
vegieAngle# = wrapNumStraight(vegieAngle#, 1, 0, 360)
vegiePingPong# = wrapNumPingPong(vegiePingPong#, vegieAngle#, 20, 0)
vegetationUpdate(400, vegiePingPong#)
Print freeObject()
GOSUB Info
Sync
EndWhile
End
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
`value = place holder to fake a global variable
`valueSpeed = how fast wrapping will be
`min,maxVal = minimum and maximum values of wrap
Function wrapNumStraight(value As Float, valueInc As Float, minValue As Float, maxValue As Float)
Inc value, valueInc
If value < minValue Or value > maxValue Then value = minValue
EndFunction value
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
`value = place holder to fake a global variable
`valueSpeed = how fast wrapping will be
`maxVal = maximum values of pingpong
`USAGE:
`ang# = wrapNumStraight(ang#, 0.1, 0, 360)
`x# = wrapNumPingPong(x#, ang#, 50, (0 or 1))
Function wrapNumPingPong(value As Float, valueInc As Float, maxValue As Float, situation As Byte)
If situation = 1
value = Sin(valueInc)*(maxValue/2.0) + (maxValue/2.0)
Else
value = Sin(valueInc)*maxValue
EndIf
EndFunction value
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function vegetationUpdate(minDistance As Integer, windVal As Float)
For i = 1 To Array Count(vegetation())
dist# = getDistanceObjToCam(vegetation(i))
If dist# > minDistance
Exclude Object On vegetation(i)
Else
Exclude Object Off vegetation(i)
Point Object vegetation(i), Camera Position X(), Object Position Y(vegetation(i)), Camera Position Z()
If dist# < minDistance / 2.0
xRotate Object vegetation(i), windVal
EndIf
EndIf
Next i
EndFunction
Function vegetationCreate(folder As String, terrain As Integer, minHeight As Integer, grassSize As Integer, grassColor As Byte, treeColor As Byte, random As Boolean)
grass1Obj = freeObject() : Make Object Plain grass1Obj, grassSize, grassSize, 1
grass1Img = freeImage() : Load Image folder + \"/grass/grass1.tga\", grass1Img
Texture Object grass1Obj, grass1Img : Set Object Transparency grass1Obj, 6
Offset Limb grass1Obj, 0, 0, Object Size Y(grass1Obj)/2.0, 0
Hide Object grass1Obj
grass2Obj = freeObject() : Make Object Plain grass2Obj, grassSize, grassSize, 1
grass2Img = freeImage() : Load Image folder + \"/grass/grass2.tga\", grass2Img
Texture Object grass2Obj, grass2Img : Set Object Transparency grass2Obj, 6
Offset Limb grass2Obj, 0, 0, Object Size Y(grass2Obj)/2.0, 0
Hide Object grass1Obj
grass3Obj = freeObject() : Make Object Plain grass3Obj, grassSize, grassSize, 1
grass3Img = freeImage() : Load Image folder + \"/grass/grass3.tga\", grass3Img
Texture Object grass3Obj, grass3Img : Set Object Transparency grass3Obj, 6
Offset Limb grass3Obj, 0, 0, Object Size Y(grass3Obj)/2.0, 0
Hide Object grass1Obj
grass4Obj = freeObject() : Make Object Plain grass4Obj, grassSize, grassSize, 1
grass4Img = freeImage() : Load Image folder + \"/grass/grass4.tga\", grass4Img
Texture Object grass4Obj, grass4Img : Set Object Transparency grass4Obj, 6
Offset Limb grass4Obj, 0, 0, Object Size Y(grass4Obj)/2.0, 0
Hide Object grass1Obj
DIM vegetation(0) As Integer
bmpPlantMap = freeBitmap()
Load Bitmap folder + \"/plant.bmp\", bmpPlantMap
Set Current Bitmap bmpPlantMap
Local color As dWord
For x = 1 To Bitmap Width(bmpPlantMap)
For z = 1 To Bitmap Height(bmpPlantMap)
color = RgbG(Point(x,z))
If color = grassColor
x# = (Object Size X(terrain) / Bitmap Width(bmpPlantMap) * x) - (Object Size X(terrain)/2.0)
z# = (Object Size Z(terrain) / Bitmap Height(bmpPlantMap) * z) - (Object Size Z(terrain)/2.0)
If random = 1
x# = x# + (Rnd(grassSize)-(grassSize/2.0))
z# = z# + (Rnd(grassSize)-(grassSize/2.0))
EndIf
y# = Get Terrain Ground Height (terrain, x#, z#)
If y# < minHeight
Array Insert At Bottom vegetation()
arrayCount = Array Count(vegetation())
obj = freeObject()
vegetation(arrayCount) = obj
sourceObj = Rnd(3)+1
If sourceObj = 1 Then Instance Object obj, grass1Obj
If sourceObj = 2 Then Instance Object obj, grass2Obj
If sourceObj = 3 Then Instance Object obj, grass3Obj
If sourceObj = 4 Then Instance Object obj, grass4Obj
Position Object obj, x#, y#, z#
EndIf
EndIf
Next z
Next x
Set Current bitmap 0
Delete Bitmap bmpPlantMap
EndFunction
Info:
Set Cursor 0, 0
Print \"Fps: \",Screen Fps()
Print \"Static: \", Statistic(1)
`Paste Image showImage, 576, 0
Return
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
`folder = terrains folder
`s = size
`x,y,z = position coordinates
Function terrainCreate(folder As String, s As Float, x As Float, y As Float, z As Float)
imgC = freeImage() : Load Image folder + \"/color.bmp\", imgC
imgD = freeImage() : Load Image folder + \"/detail.tga\", imgD
oTer = freeObject()
Make Object Terrain oTer
Set Terrain Heightmap oTer, folder + \"/height.bmp\"
Set Terrain Scale oTer, 5.0*s, 0.5*s, 5.0*s
Set Terrain Split oTer, 8
Set Terrain Tiling oTer, 4
`Set Terrain Light oTer, x#, y#, z#, 1, 1, 0.78, 0.5
Set Terrain Texture oTer, imgC, imgD
Build Terrain oTer
Position Object oTer, x-Object Size X(oTer)/2.0, y, z-Object Size Z(oTer)/2.0
Set Object Light oTer, 1
EndFunction oTer
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function getDistanceObjToCam(o As Integer)
xd# = Camera Position x() - Object Position x(o)
yd# = Camera Position y() - Object Position y(o)
zd# = Camera Position z() - Object Position z(o)
Distance# = ((xd#*xd#) + (yd#*yd#) + (zd#*zd#))^0.5
EndFunction Distance#
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function setMouse(debug As Boolean)
mx = mouseX() : my = mouseY() : mz = mouseZ()
mmx = mouseMoveX() : mmy = mouseMoveY() : mmz = mouseMoveZ()
If debug > 0
Center Text mx, my+14, \"Mx: \"+Str$(mx)
Center Text mx, my+28, \"My: \"+Str$(my)
EndIf
endFunction
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
lbl_funcFree:
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeDll()
Repeat
Inc i
Until DLL Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeMemblock()
Repeat
Inc i
Until MemBlock Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeObject()
Repeat
Inc i
Until Object Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeSound()
Repeat
Inc i
Until Sound Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeMusic()
Repeat
Inc i
Until Music Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeAnimation()
Repeat
Inc i
Until Animation Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeBitmap()
Repeat
Inc i
Until Bitmap Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeEffect()
Repeat
Inc i
Until Effect Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeImage()
Repeat
Inc i
Until Image Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeLight()
Repeat
Inc i
Until Light Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeLimb()
Repeat
Inc i
Until Limb Exist(i,i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeMatrix()
Repeat
Inc i
Until Matrix Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeMesh()
Repeat
Inc i
Until Mesh Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freePixelshader()
Repeat
Inc i
Until Pixel Shader Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeParticles()
`Repeat
Inc i
`Until Particles Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeSprite()
Repeat
Inc i
Until Sprite Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeTerrain()
Repeat
Inc i
Until Terrain Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeVertexshader()
Repeat
Inc i
Until Vertex Shader Exist(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Function freeFile()
Repeat
Inc i
Until File Open(i) = 0
EndFunction i
`<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I ask for full credits and an e-mail notification to tamer(@)eskisehirli.net (without
()) if any part of the code is used.