<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — Bug in smgr.getMeshFromFileIO ?]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=396&amp;type=atom" />
	<updated>2009-12-29T04:15:19Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=396</id>
		<entry>
			<title type="html"><![CDATA[Re: Bug in smgr.getMeshFromFileIO ?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1511#p1511" />
			<content type="html"><![CDATA[<p>greetings porcus!&nbsp; its been a while i hope all is well <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; thank you very much for the detailed bug report and especially the compilable code.&nbsp; it really helps when troubleshooting issues.&nbsp; you were correct in there was an issue with the getMeshFromFileIO method.&nbsp; whenever a C++ object is wrapped, by the Irrlicht mod i must be sure to say whether it needs dropped or not.&nbsp; essentially, any method that starts with &quot;create&quot; i must be sure to tell the wrapping BMAX type to decrement the internal reference counter when dropped.&nbsp; anything that starts with &quot;add&quot; or &quot;get&quot; i must tell it to not decrement the counter.&nbsp; in this instance i incorrectly told it to decrement when it should not, causing the exception.&nbsp; a new version of the mod has been uploaded with the appropriate fix.&nbsp; you may download it by visiting the v1.6 announcements forum entry.</p>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2009-12-29T04:15:19Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1511#p1511</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug in smgr.getMeshFromFileIO ?]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1510#p1510" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Incbin &quot;cone.b3d&quot;
Incbin &quot;cube.b3d&quot;
Incbin &quot;cylinder.b3d&quot;
Incbin &quot;pyramid.b3d&quot;
Incbin &quot;sphere.b3d&quot;
Incbin &quot;plane.b3d&quot;

Function CreatePlane:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;plane.b3d&quot;),IncbinLen(&quot;plane.b3d&quot;),&quot;Plane.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function

Function CreateCone:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;cone.b3d&quot;),IncbinLen(&quot;cone.b3d&quot;),&quot;Cone.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function

Function CreateCube:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;cube.b3d&quot;),IncbinLen(&quot;cube.b3d&quot;),&quot;Cube.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function

Function CreateCylinder:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;cylinder.b3d&quot;),IncbinLen(&quot;cylinder.b3d&quot;),&quot;Cylinder.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function

Function CreatePyramid:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;pyramid.b3d&quot;),IncbinLen(&quot;pyramid.b3d&quot;),&quot;Pyramid.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function

Function CreateSphere:ianimatedmeshscenenode()
Local mtmp:ireadfile=device.getfilesystem().creatememoryreadfile(IncbinPtr(&quot;sphere.b3d&quot;),IncbinLen(&quot;sphere.b3d&quot;),&quot;Sphere.b3d&quot;,False)
Local mtmpb:ianimatedmeshscenenode=smgr.addanimatedmeshscenenode(smgr.getMeshFromFileIO(mtmp))
mtmpb.setmaterialflag(emf_lighting,False)
mtmp.drop()
Return mtmpb
End Function</code></pre></div>]]></content>
			<author>
				<name><![CDATA[porcus]]></name>
				<uri>https://gprogs.com/profile.php?id=127</uri>
			</author>
			<updated>2009-12-28T20:45:31Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1510#p1510</id>
		</entry>
</feed>
