<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Code Snippets]]></title>
		<link>https://gprogs.com/index.php</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;fid=17&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent topics at GMan's Mods & Stuff.]]></description>
		<lastBuildDate>Fri, 27 Jul 2007 06:12:50 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Irrlicht Streams Complete 1.0]]></title>
			<link>https://gprogs.com/viewtopic.php?id=259&amp;action=new</link>
			<description><![CDATA[<p>Yay!&nbsp; Finished.&nbsp; And with the memory reader you can even access your Incbin via IncbinPtr()!</p><div class="codebox"><pre><code>&#039;RCD Software (TM)
&#039;by ninjarat

&#039;This is part of the RCD Irrlicht Addons


Const STREAM_TARGET_UNDEFINED=-1
Const STREAM_TARGET_FILE=0
Const STREAM_TARGET_RAM=1

Const STREAM_TYPE_READ=0
Const STREAM_TYPE_WRITE=1


&#039;irrlicht stream base class
Type TIrrStreamBase
    Field irrstream:TIrr_IUnknown
    Field pos,size,fname$
    Field endoffile=False
    Field irrstreamtype=-1
    
    Function create:TIrrStreamBase(file$,append=False)
        Return New TIrrStreamBase
    End Function
    
    Function createFromRAM:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
        Return New TIrrStreamBase
    End Function
    
    Method _reader:IReadFile()
        Return IReadFile(irrstream)
    End Method
    
    Method _writer:IWriteFile()
        Return IWriteFile(irrstream)
    End Method
    
    Method _setreader(r:IReadFile)
        irrstream=r
    End Method
    
    Method _setwriter(w:IWriteFile)
        irrstream=w
    End Method
    
    Method GetType()
        Return irrstreamtype
    End Method
    
    Method Eof()
        Return endoffile
    End Method
    
    Method GetSize()
        Return size
    End Method
    
    Method GetPos()
        Return pos
    End Method
    
    Method GetFName$()
        Return fname
    End Method
    
    Method Seek(pos,relativemove=False)
        If _reader() Then
            If Not _reader().seek(pos,relativemove) Then Return False Else pos=_reader().getPos()
        Else If _writer() Then
            If Not _writer().seek(pos,relativemove) Then Return False Else pos=_writer().getPos()
        Else
            Return False
        End If
        Return True
    End Method
    
    Method Destroy()
        If irrstream Then irrstream.drop
    End Method
    
    Method ToString$()
        str$=&quot;Stream Object~n~r&quot;
        If IReadFile(irrstream) Then
            str:+&quot;type:STREAM_TYPE_READ~n~r&quot;
        Else If IWriteFile(irrstream) Then
            str:+&quot;type:STREAM_TYPE_WRITE~n~r&quot;
        Else
            str:+&quot;type:STREAM_TYPE_NULLOBJECT~n~r&quot;
        End If
        str:+&quot;pos:&quot;+pos
        If IReadFile(irrstream) Then
            str:+&quot;~n~rsize:&quot;+size
        Else
            str:+&quot;~n~rsize:NON_TERMINATED&quot;
        End If
        str:+&quot;~n~rname:&quot;+fname+&quot;~n~reof:&quot;+TrFs(endoffile)+&quot;~n~rtarget:&quot;
        If irrstreamtype=0 Then
            str:+&quot;STREAM_TARGET_FILE~n~r&quot;
        Else If irrstreamtype=1 Then
            str:+&quot;STREAM_TARGET_RAM~n~r&quot;
        Else
            str:+&quot;STREAM_TARGET_UNDEFINED~n~r&quot;
        End If
        Return str
    End Method
End Type

&#039;extends irrlicht stream base in to a stream reader
Type TIrrStreamReader Extends TIrrStreamBase
    Function create:TIrrStreamBase(file$,append=False)
        read:TIrrStreamReader=New TIrrStreamReader
        read._initstd(file)
        Return read
    End Function
    
    Function createFromRAM:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
        read:TIrrStreamReader=New TIrrStreamReader
        read._initram(name,buffer,buflength)
        Return read
    End Function
    
    Method _initstd(file$)
        _setreader TIrrContainer.IrrFileSys.createAndOpenFile(file)
        fname=_reader().getFileName()
        pos=_reader().getPos()
        size=_reader().getSize()
        irrstreamtype=0
    End Method
    
    Method _initram(name$,buffer:Byte Ptr,buflength)
        _setreader TIrrContainer.IrrFileSys.createMemoryReadFile(buffer,buflength,name)
        fname=_reader().getFileName()
        pos=_reader().getPos()
        size=_reader().getSize()
        irrstreamtype=1
    End Method
    
    Method Read(buffer:Byte Ptr,numbytes)
        bytesread=_reader().read(buffer,numbytes)
        pos=_reader().getPos()
        If bytesread&lt;numbytes Or pos&gt;=size Then
            endoffile=True
            Return False
        End If
        Return True
    End Method
    
    Method ReadByte:Byte()
        If endoffile Then Return Null
        n:Byte=0
        If Not Read(Varptr n,1) Then n=Null
        Return n
    End Method
    
    Method ReadShort:Short()
        If endoffile Then Return Null
        n:Short=0
        If Not Read(Varptr n,2) Then n=Null
        Return n
    End Method
    
    Method ReadInt()
        If endoffile Then Return Null
        n=0
        If Not Read(Varptr n,4) Then n=Null
        Return n
    End Method
    
    Method ReadLong:Long()
        If endoffile Then Return Null
        n:Long=0
        If Not Read(Varptr n,8) Then n=Null
        Return n
    End Method
    
    Method ReadFloat#()
        If endoffile Then Return Null
        n#=0
        If Not Read(Varptr n,4) Then n=Null
        Return n
    End Method
    
    Method ReadDouble!()
        If endoffile Then Return Null
        n!=0
        If Not Read(Varptr n,8) Then n=Null
        Return n
    End Method
    
    Method ReadString$(numbytes)
        Assert numbytes&gt;0, &quot;Byte length must be greater than 0&quot;
        If endoffile Then Return Null
        Local buffer:Byte[numbytes]
        If Not Read(buffer,numbytes) Then n=Null
        Return String.FromBytes(buffer,numbytes)
    End Method
    
    Method ReadLine$()
        If endoffile Then Return Null
        Local buffer:Byte[1024],str$,char:Byte
        Repeat
            If Not Read(Varptr char,1) Then Exit
            If char=0 Then Exit
            If char=10 Then Exit
            If char=13 Then Continue
            buffer[posi]=char
            posi:+1
            If p&lt;&gt;buffer.length Then Continue
            str:+String.FromBytes(buffer,posi)
            posi=0
        Forever
        If posi Then str:+String.FromBytes(buffer,posi)
        Return str
    End Method
End Type

&#039;extends irrlicht stream base in to a stream writer
Type TIrrStreamWriter Extends TIrrStreamBase
    Function create:TIrrStreamBase(file$,append=False)
        write:TIrrStreamWriter=New TIrrStreamWriter
        write._initstd(file,append)
        Return write
    End Function
    
    &#039;override with null returning function, because RAM file writing
    &#039;isn&#039;t supported by irrlicht.
    Function createFromRAM:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
        Return Null
    End Function
    
    Method _initstd(file$,append,maxsize=100000)
        _setwriter TIrrContainer.IrrFileSys.createAndWriteFile(file,append)
        fname=_writer().getFileName()
        pos=_writer().getPos()
        size=maxsize
        irrstreamtype=0
    End Method
    
    Method Write(buffer:Byte Ptr,numbytes)
        byteswritten=_writer().write(buffer,numbytes)
        pos=_writer().getPos()
        If byteswritten&lt;numbytes Then Return False
        Return True
    End Method
    
    Method WriteByte(n:Byte)
        q:Byte=n
        Return Write(Varptr q,1)
    End Method
    
    Method WriteShort(n:Short)
        q:Short=n
        Return Write(Varptr q,2)
    End Method
    
    Method WriteInt(n)
        q=n
        Return Write(Varptr q,4)
    End Method
    
    Method WriteLong(n:Long)
        q:Long=n
        Return Write(Varptr q,8)
    End Method
    
    Method WriteFloat(n#)
        q#=n
        Return Write(Varptr q,4)
    End Method
    
    Method WriteDouble(n!)
        q!=n
        Return Write(Varptr q,8)
    End Method
    
    Method WriteString(str$)
        Local s:Byte Ptr
        s=str.ToCString()
        Return Write(s,str.length)
        MemFree s
    End Method
End Type

Function CreateIrrStream:TIrrStreamBase(file$,append=False,mode=STREAM_TYPE_READ)
    Select mode
        Case STREAM_TYPE_READ  Return TIrrStreamReader.Create(file)
        Case STREAM_TYPE_WRITE Return TIrrStreamWriter.Create(file,append)
    End Select
End Function

Function CreateIrrRAMStreamReader:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
    Return TIrrStreamReader.CreateFromRAM(name,buffer,buflength)
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ninjarat)]]></author>
			<pubDate>Fri, 27 Jul 2007 06:12:50 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=259&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[TIrrStream and TIrrStreamReader]]></title>
			<link>https://gprogs.com/viewtopic.php?id=255&amp;action=new</link>
			<description><![CDATA[<p>Check it out!&nbsp; More excerpts from my engine.&nbsp; This particular class doesn&#039;t use any other objects in my engine, so you can use it as is.&nbsp; Oh, except it does get the file system manager from my TIrrContainer object.&nbsp; You can get around that by replacing &#039;IrrContainer.IrrFileSys&#039; with &#039;device.getFileSystem()&#039;.&nbsp; It basically creates an advanced blitz-like stream reader based in the Irrlicht file system manager.</p><p>Special thanks to Mark and Simon.&nbsp; I could never have made this if I hadn&#039;t had a good look at their stream module first.</p><p>EDIT:&nbsp; Fixed an issue with ReadLine.&nbsp; When reading last line of text from the read target, an attempt to access null memory error occurred.&nbsp; I found a spot where I was freeing some memory when I shouldn&#039;t have.&nbsp; All cleared up now.&nbsp; I had to fix it the hard way, because the debug build worked for some reason.&nbsp; Probably a difference in garbage collection.</p><p>EDIT:&nbsp; Restructured for the addition of a stream writer object.&nbsp; Yay!&nbsp; Same basic use, mostly just stuff behind the scenes changed.&nbsp; You&#039;ll find that with the new version you&#039;ll have to use TIrrStreamReader(irrstreamobject) to get access to the functions, but these changes will make it more efficient in the long run.&nbsp; I swear.</p><div class="codebox"><pre><code>&#039;RCD Software (TM)
&#039;by ninjarat

&#039;This is part of the RCD Irrlicht Addons


Const STREAM_TARGET_UNDEFINED=-1
Const STREAM_TARGET_FILE=0
Const STREAM_TARGET_RAM=1


&#039;irrlicht stream base class
Type TIrrStreamBase
    Field irrstream:TIrr_IUnknown
    Field pos,size,fname$
    Field endoffile=False
    Field irrstreamtype=-1
    
    Function create:TIrrStreamBase(file$)
        Return New TIrrStreamBase
    End Function
    
    Function createFromRAM:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
        Return New TIrrStreamBase
    End Function
    
    Method _reader:IReadFile()
        Return IReadFile(irrstream)
    End Method
    
    Method _writer:IWriteFile()
        Return IWriteFile(irrstream)
    End Method
    
    Method _setreader(r:IReadFile)
        irrstream=r
    End Method
    
    Method _setwriter(w:IWriteFile)
        irrstream=w
    End Method
    
    Method GetType()
        Return irrstreamtype
    End Method
    
    Method Eof()
        Return endoffile
    End Method
    
    Method GetSize()
        Return size
    End Method
    
    Method GetPos()
        Return pos
    End Method
    
    Method GetFName$()
        Return fname
    End Method
    
    Method Destroy()
        If irrstream Then irrstream.drop
    End Method
    
    Method ToString$()
        str$=&quot;Stream Object~n~r&quot;
        If IReadFile(irrstream) Then
            str:+&quot;type:STREAM_TYPE_READ~n~r&quot;
        Else If IWriteFile(irrstream) Then
            str:+&quot;type:STREAM_TYPE_WRITE~n~r&quot;
        Else
            str:+&quot;type:STREAM_TYPE_NULLOBJECT~n~r&quot;
        End If
        str:+&quot;pos:&quot;+pos+&quot;~n~rsize:&quot;+size+&quot;~n~rname:&quot;+..
         fname+&quot;~n~reof:&quot;+TrFs(endoffile)+&quot;~n~rtarget:&quot;
        If irrstreamtype=0 Then
            str:+&quot;STREAM_TARGET_FILE~n~r&quot;
        Else If irrstreamtype=1 Then
            str:+&quot;STREAM_TARGET_RAM~n~r&quot;
        Else
            str:+&quot;STREAM_TARGET_UNDEFINED~n~r&quot;
        End If
        Return str
    End Method
End Type

&#039;extends irrlicht stream base in to a stream reader
Type TIrrStreamReader Extends TIrrStreamBase
    Function create:TIrrStreamBase(file$)
        read:TIrrStreamReader=New TIrrStreamReader
        read._init1(file,0)
        Return read
    End Function
    
    Function createFromRAM:TIrrStreamBase(name$,buffer:Byte Ptr,buflength)
        read:TIrrStreamReader=New TIrrStreamReader
        read._init2(name,buffer,buflength,1)
        Return read
    End Function
    
    Method _init1(file$,mode)
        _setreader TIrrContainer.IrrFileSys.createAndOpenFile(file)
        fname=_reader().getFileName()
        pos=_reader().getPos()
        size=_reader().getSize()
        irrstreamtype=mode
    End Method
    
    Method _init2(name$,buffer:Byte Ptr,buflength,mode)
        _setreader TIrrContainer.IrrFileSys.createMemoryReadFile(buffer,buflength,name)
        fname=_reader().getFileName()
        pos=_reader().getPos()
        size=_reader().getSize()
        irrstreamtype=mode
    End Method
    
    Method Read(buffer:Byte Ptr,numbytes)
        bytesread=_reader().read(buffer,numbytes)
        pos=_reader().getPos()
        If bytesread&lt;numbytes Or pos&gt;=size Then
            endoffile=True
            Return False
        End If
        Return True
    End Method
    
    Method Seek(pos,relativemove=False)
        If Not _reader().seek(pos,relativemove) Then Return False
        Return True
    End Method
    
    Method Eof()
        Return endoffile
    End Method
    
    Method GetSize()
        size=_reader().getSize()
        Return size
    End Method
    
    Method GetPos()
        pos=_reader().getPos()
        Return pos
    End Method
    
    Method ReadByte:Byte()
        If endoffile Then Return Null
        n:Byte=0
        If Not Read(Varptr n,1) Then n=Null
        Return n
    End Method
    
    Method ReadShort:Short()
        If endoffile Then Return Null
        n:Short=0
        If Not Read(Varptr n,2) Then n=Null
        Return n
    End Method
    
    Method ReadInt()
        If endoffile Then Return Null
        n=0
        If Not Read(Varptr n,4) Then n=Null
        Return n
    End Method
    
    Method ReadLong:Long()
        If endoffile Then Return Null
        n:Long=0
        If Not Read(Varptr n,4) Then n=Null
        Return n
    End Method
    
    Method ReadString$(numbytes)
        Assert numbytes&gt;0, &quot;Byte length must be greater than 0&quot;
        If endoffile Then Return Null
        Local buffer:Byte[numbytes]
        If Not Read(buffer,numbytes) Then n=Null
        Return String.FromBytes(buffer,numbytes)
    End Method
    
    Method ReadLine$()
        If endoffile Then Return Null
        Local buffer:Byte[1024],str$,char:Byte
        Repeat
            If Not Read(Varptr char,1) Then Exit
            If char=0 Then Exit
            If char=10 Then Exit
            If char=13 Then Continue
            buffer[posi]=char
            posi:+1
            If p&lt;&gt;buffer.length Then Continue
            str:+String.FromBytes(buffer,posi)
            posi=0
        Forever
        If posi Then str:+String.FromBytes(buffer,posi)
        Return str
    End Method
End Type

&#039;extends irrlicht stream base in to a stream writer
&#039;not yet added, as you can see.
&#039;Type TIrrStreamWriter Extends TIrrStreamBase
&#039;    Function create:TIrrStreamWriter()
&#039;    End Function
&#039;End Type

Const STREAM_TYPE_READ=0
Const STREAM_TYPE_WRITE=1

Function CreateIrrStream:TIrrStreamBase(file$,mode=STREAM_TYPE_READ)
    Select mode
        Case STREAM_TYPE_READ  Return TIrrStreamReader.Create(file)
        Case STREAM_TYPE_WRITE Return Null &#039;not yet supported
    End Select
End Function

Function CreateIrrRAMStream:TIrrStreamBase(name$,buffer:Byte Ptr,buflength,mode=STREAM_TYPE_READ)
    Select mode
        Case STREAM_TYPE_READ  Return TIrrStreamReader.CreateFromRAM(name,buffer,buflength)
        Case STREAM_TYPE_WRITE Return Null &#039;not yet supported
    End Select
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ninjarat)]]></author>
			<pubDate>Thu, 26 Jul 2007 04:19:26 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=255&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Ib3d sprite system sugestion]]></title>
			<link>https://gprogs.com/viewtopic.php?id=230&amp;action=new</link>
			<description><![CDATA[<p>Hi, I just wrote a type for a sprite system for Ib3d. It extends mesh type of ib3d and works with other ib3d functions. It has b3d sprite view modes. You only have to add sprite.update() in your main loop to make the sprites face the camera according to its view mode.<br />I did some quick stress tests and It was 5% faster than the irrlicht native billboards (with 1000 diferent sprites/billboards). </p><p>The only thing missing is a copyentity function.</p><p>To free the sprite use ib3d_FreeEntity( entity:Sprite ), like any other mesh.</p><div class="codebox"><pre><code>&#039;*****Sprite type ******

Type SPRITE Extends MESH
    Global SpriteList:TList=Null
    Global cont:Int &#039;addHillPlaneMesh requests a diferent name for each mesh, don&#039;t know why, yet...
    Global spMesh:IAnimatedMesh=Null
    
    Field tex:texture=Null
    Field angle:Float  &#039; rotatesprite
    &#039;Field handle_x:Float,handle_y:Float &#039;todo 
    Field view_mode:Int=1
    Global rot1:Vector3df,rot3:Vector3df,rot4:Vector3df &#039;update vectors
    
    Method New()
        If Not MeshList Then MeshList=New TList
        MeshList.AddLast(Self)
        If Not SpriteList Then SpriteList=New TList
        SpriteList.AddLast(Self)
    EndMethod
    
    Method Destroy()
        &#039;If tex Then tex.Free()  
        tex=Null
        _mesh=Null
        Super.Destroy()
        MeshList.Remove(Self)        
        SpriteList.Remove(Self)        
    EndMethod
    
    Function CreateSprite:Sprite(rotate_mode:Int=1,parent_ent:ib3d_Entity=Null)

        Local NewSprite:SPRITE=New SPRITE
        newsprite.cont:+1
        If rotate_mode=1  &#039;uses the already created spmesh, which is faster, if rotate all sprites with spmesh rotates.
            If spmesh=Null 
                spmesh=_g_ib3d_engine.smgr.addHillPlaneMesh(&quot;sprite&quot;+cont, _dimension2df(1.0 , 1.0) , _dimension2di(1 , 1) )
                If Not spmesh Or Not spmesh.IsValid() Then RuntimeError &quot;Unable to create sprite mesh&quot;
                NewSprite._mesh=spmesh
                NewSprite.setNode(_g_ib3d_engine.smgr.addMeshSceneNode(IAnimatedMesh(newsprite._mesh).getMesh(0)))
                _RotateAnimMesh(IAnimatedMesh(spmesh).handle,newsprite._node.handle,-90,0,0) &#039;HillPlaneMesh needs to be rotated to face the camera
            Else
            &#039;NewSprite._mesh= _g_ib3d_engine.smgr.addHillPlaneMesh(&quot;sprite&quot;+newSprite.cont, _dimension2df(1.0 , 1.0) , _dimension2di(1 , 1) )
            NewSprite._mesh=spmesh
            If Not NewSprite._mesh Or Not NewSprite._mesh.IsValid() Then RuntimeError &quot;Unable to create sprite mesh&quot;
    
            NewSprite.setNode(_g_ib3d_engine.smgr.addMeshSceneNode(IAnimatedMesh(newsprite._mesh).getMesh(0)))
            End If
        Else &#039;create a new mesh, slower but allows rotation
            NewSprite._mesh= _g_ib3d_engine.smgr.addHillPlaneMesh(&quot;sprite&quot;+newSprite.cont, _dimension2df(1.0 , 1.0) , _dimension2di(1 , 1) )
            If Not NewSprite._mesh Or Not NewSprite._mesh.IsValid() Then RuntimeError &quot;Unable to create sprite mesh&quot;    
            NewSprite.setNode(_g_ib3d_engine.smgr.addMeshSceneNode(IAnimatedMesh(newsprite._mesh).getMesh(0)))
            _RotateAnimMesh(IAnimatedMesh(spmesh).handle,newsprite._node.handle,-90,0,0) &#039;HillPlaneMesh needs to be rotated to face the camera
        End If
        If parent_ent Then NewSprite._node.setParent(parent_ent._node)  &#039; set the parent if there is one
        ib3d_EntityFX(newsprite,EMF_LIGHTING,0) 
        Return NewSprite
    End Function
    
    Function LoadSprite:Sprite(tex_file$,tex_flag%=EMT_SOLID,rotate_mode:Int=1,parent_ent:ib3d_Entity=Null)

        Local NewSprite:Sprite=CreateSprite(rotate_mode,parent_ent)
        
        ib3d_EntityBlend(newsprite,tex_flag)
        NewSprite.tex= ib3d_LoadTexture(tex_file)
        ib3d_EntityTexture(newsprite,newsprite.tex)
        
        Return NewSprite        
    End Function

    Method ScaleMesh(x_scale:Float,y_scale:Float,z_Scale:Float=1.0) &#039;z_scale is not used
        If Not _mesh Or Not _mesh.isValid() Then RuntimeError &quot;Mesh is invalid&quot;
        If IAnimatedMesh(_mesh) Then Throw &quot;Animated meshes are not editable&quot;        
        
        Local mm:IMeshManipulator=_g_ib3d_engine.smgr.getMeshManipulator()
        mm.ScaleMesh(SMesh(_mesh),Vector3df.createFromVals(x_scale,y_scale,1.0)) &#039;z=1.0
    EndMethod

    Function Update(cam:CAMERA)
        Local cam_rot:Vector3df
        Local temp:SPRITE
        If spritelist&lt;&gt;Null
            rot1=cam._node.GetRotation()
            rot1.setZ(0)
            rot3=cam._node.GetRotation()
            rot4=cam._node.GetRotation()
            rot4.setx(0)
            
            For temp=EachIn SpriteList
                            
                Select temp.view_mode  &#039;B3D Sprite view modes
                    Case 1                        
                        temp._node.SetRotation(rot1)&#039;cam_rot)                        
                    Case 2
                        &#039;FREE
                    Case 3                        
                        temp._node.SetRotation(rot3)&#039;cam_rot)    
                    Case 4
                        temp._node.SetRotation(rot4)&#039;cam_rot)    
                End Select        
            Next
        End If    
        
    End Function

End Type

Function ib3d_CreateSprite:SPRITE(rotate_mode:Int=1,parent:ib3d_Entity=Null)
    If Not _g_ib3d_engine Then RuntimeError &quot;iB3D engine has not been initialized&quot;
    Return sprite.CreateSprite(rotate_mode:Int,parent)
EndFunction

Function ib3d_LoadSprite:SPRITE(file:String,flag:Int=EMT_SOLID,rotate_mode:Int=1,parent:ib3d_Entity=Null)
    If Not _g_ib3d_engine Then RuntimeError &quot;iB3D engine has not been initialized&quot;
    Return sprite.LoadSprite(file,flag,rotate_mode:Int,parent)
EndFunction

Function ib3d_SpriteViewMode(sp:SPRITE,mode:Int)
    If mode&gt;0 And mode&lt;5
        sp.view_mode=mode
    End If
End Function
    
Function ib3d_RotateSprite(sp:SPRITE,angle:Float)
    sp.angle:+angle
    _RotateAnimMesh(IAnimatedMesh(sp._mesh).handle,sp._node.handle,0,0,sp.angle)
End Function

Function ib3d_ScaleSprite(sp:SPRITE,x_scale:Float,y_scale:Float)
    ib3d_ScaleEntity(sp,x_scale,y_scale,1)
End Function</code></pre></div><p>*EDIT* small update</p><p>note: you need to put SPRITE.update() in the main loop to update the sprites.</p><p>Any suggestion will be appreciated.<br />thanks,</p>]]></description>
			<author><![CDATA[null@example.com (ksalomao)]]></author>
			<pubDate>Thu, 17 May 2007 22:36:55 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?id=230&amp;action=new</guid>
		</item>
	</channel>
</rss>
