<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ref="http://purl.org/rss/1.0/modules/reference/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://www.emix8.org/rss.rdf">
		<title>Emix8.org Ville Krumlinde: Delphi programming</title>
		<link>http://www.emix8.org/index.php</link>
		<description><![CDATA[(C) 2012 Ville Krumlinde, Sweden. Emix System AB.]]></description>
		<items>
			<rdf:Seq>
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry120711-095541" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry110926-154624" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry110908-165856" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry110331-142954" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry110310-142129" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry101226-154653" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry101206-160834" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry100308-134937" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry100216-172259" />
				<rdf:li resource="http://www.emix8.org/index.php?entry=entry090410-191437" />
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry120711-095541">
		<title>Two ZGE Android titles on Google Play</title>
		<link>http://www.emix8.org/index.php?entry=entry120711-095541</link>
		<description><![CDATA[The <a href="http://www.emix8.org/forum/viewtopic.php?t=874" target="_blank" >Android port of the ZGE engine</a> is moving along rapidly and two little game demos have already been made to show the potential:<br /><br />They should work on most Android devices with Android 2.2 or later installed.<br /><br />&quot;<a href="https://play.google.com/store/apps/details?id=com.rado1.Eater" target="_blank" >Eater</a>&quot; by Rado1.<br /><br />&quot;<a href="https://play.google.com/store/apps/details?id=com.iterationgames.SaucerInvasion" target="_blank" >Saucer Invasion</a>&quot; by Jph Wacheski<br /><br /><img src="images/rado1_eater.jpg" width="500" height="300" border="0" alt="" /><br /><br /><img src="images/jph_saucer.jpg" width="500" height="281" border="0" alt="" />]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry110926-154624">
		<title>DelphiUnitSizes - Display the size of each unit in your Delphi exe-files</title>
		<link>http://www.emix8.org/index.php?entry=entry110926-154624</link>
		<description><![CDATA[I wrote a little tool that will display the size of each unit in a Delphi-generated exe-file. <a href="http://www.emix8.org/static.php?page=delphiunitsizes" target="_blank" >More info here</a>.<br /><br /><a href="javascript:openpopup('images/delphiunitsizes.png',927,600,false);"><img src="images/delphiunitsizes.png" width="500" height="324" border="0" alt="" /></a>]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry110908-165856">
		<title>Delphi XE2: Upgrading ZGameEditor to 64-bit</title>
		<link>http://www.emix8.org/index.php?entry=entry110908-165856</link>
		<description><![CDATA[The latest Delphi version called XE2 was released recently and one of the major new features is 64-bit compiler support. I wanted to try this out so here are some notes on what I had to do to make ZGameEditor run in 64-bit mode.<br /><br /><a href="javascript:openpopup('images/zge64_particles.jpg',934,575,false);"><img src="images/zge64_particles.jpg" width="500" height="308" border="0" alt="" /></a><br /><br /><a href="http://www.zgameeditor.org" target="_blank" >ZGameEditor</a> is a cross platform open source game engine based on OpenGL. It compiles on 32-bit Windows, Linux and OS X with Delphi or Freepascal compiler. <br /><br />There are two parts of the project: The runtime engine and the editor. This blog entry will cover the update of the runtime engine.<br /><br /><h2>Pointers</h2><br />ZGameEditor (ZGE) has a component model that can modify properties (fields) in objects based on their names or ordinal index. It is like RTTI but heavily stripped down because one of the design goals is to minimize exe-sizes (compressed zge-generated empty project exe is only 28kb). I have code that looks like this:<br /><br /><pre>var<br />  P : pointer;<br />begin<br />  P := pointer(integer(Self) + Prop.Offset);</pre><br />This is a problem in 64-bit mode because Self is a 64-bit pointer and integers are still 32-bits.<br /><br />It can be solved like this:<br /><pre>P := pointer(NativeInt(Self) + Prop.Offset);</pre><br /><b>NativeInt</b> is the integer datatype that has the same size as pointers. I think it is a good decision by Embarcadero to keep the integer datatype 32-bit in 64-bit mode but it would have been helpful if casting pointer to integer would generate a &quot;suspicious cast&quot; warning like it does for certain ansistring/unicode casts. Right now I may still have casts like this lurking in my code and I won&#039;t find them until it generates a runtime error. Funnily enough it will still work in 64-bit when the pointer has a value that fits in 32-bit (which seems to be the case when running in the Delphi debugger), so it may not be immediately obvious that the error is there.<br /><br />Alternatively I could have used:<br /><pre>{$POINTERMATH ON}<br />P := pointer(PByte(Self) + Prop.Offset);</pre><br /><h2>OpenGL</h2><br />ZGE use the OpenGL API for graphics. The ZOpenGL unit contains the module headers needed to dynamically link to OpenGL. It use $IFDEFs to separate differences between Windows and Linux, like this.<br /><br /><pre>{$IFDEF Win32}<br />opengl = &#039;opengl32.dll&#039;;<br />{$ENDIF}</pre><br />I thought I would have to change the above to &#039;opengl64.dll&#039; but it turns out that it is still called opengl32 in 64-bit mode (the same with Windows module user32.dll).<br /><br />In 64-bit mode the name Win32 is not defined. Since most of the opengl definitions are the same in 32 and 64 I changed my ifdefs to &quot;{$IF Defined(Win32) or Defined(Win64)}&quot;.<br /><br />There are also IFDEFs to use different calling conventions depending on platform but I did not have to change these. I seem to remember reading somewhere that calling convention directives are ignored in 64-bit compilation but I don&#039;t find that information now when I google or search the help files.<br /><br /><h2>Unit names</h2><br />In Delphi XE2 the standard units have namespaces so I had to replace &quot;uses Windows&quot; to &quot;uses Winapi.Windows&quot; in a couple of places. I could alternatively have solved this with the new -NS compiler directive that allows old-style shorter unit names.<br /><br /><h2>Scripting</h2><br />ZGE use a custom scripting language that is compiled to a binary format and interpreted at runtime. This is the area that required most work to run in 64-bits because I had taken some shortcuts in relying on the fact that pointers are the same size as other datatypes such as integers and single floating point values.<br /><br />The runtime stack was declared like this:<br /><br /><pre>var<br />  ZcStack : array[0..ZcStackSize div SizeOf(Integer)] of integer;<br />  ZcStackPtr : PInteger;</pre><br />I changed this to:<br /><br /><pre>type<br />  TStackElement = NativeUInt;<br />  PStackElement = ^TStackElement;<br /><br />var<br />  ZcStack : array[0..ZcStackSize div SizeOf(TStackElement)] of TStackElement;<br />  ZcStackPtr : PStackElement;</pre><br />That was necessary for the stack to be able to hold pointer data types that the scripting supports (currently <b>string</b> and <b>model</b>).<br /><br />Then I had to find code that expected pointers to be the same size as single and make changes so that pointers were given a separate execution path instead. This required changes in the compiler too so it would generate correct code.<br /><br />Google code links:<br />- <a href="http://code.google.com/p/zgameeditor/source/diff?spec=svn284&amp;r=284&amp;format=side&amp;path=/trunk/ZExpressions.pas" target="_blank" >Diff for ZExpressions-unit</a>.<br />- <a href="http://code.google.com/p/zgameeditor/source/diff?spec=svn284&amp;r=284&amp;format=side&amp;path=/trunk/tools/ZDesigner/Compiler/Compiler.pas" target="_blank" >Diff for Compiler-unit</a>.<br /><br /><h2>Using single precision math</h2><br />Eric Grange <a href="http://delphitools.info/2011/09/05/xe2-single-precision-floating-point-disappointment/" target="_blank" >discovered</a> that expressions involving the single datatype generates slow code in 64-bit mode. This is because the compiler by default converts all values to double precision during the computation and then back to single again when storing the result. <br /><br />That behavior is fine when you want maximum precision but bad when you prefer speed over precision like I do in this project. It is also not very smart implemented because expressions like &quot;y:=x*x*x&quot; will generate code to convert x to double three times, that is once for every use. However good news came after a few days when an undocumented compiler directive related to this was revealed:<br /><br /><pre>{$EXCESSPRECISION OFF}</pre><br />This disables the automatic promotion of single precision expressions to double. Adding this line at the top of my dpr-file made the resulting binary 5kb smaller. That&#039;s a lot of conversion instructions that got removed and the code became faster too :)<br /><br /><h2>Summary</h2><br />With the changes above I got the runtime working in 64-bit mode! I think Embarcadero has made a great job with the Delphi XE2 product and I recommend all Delphi users to upgrade. I hope they get some new users too because this must be the most productive tool on the market for making native 64-bit Window exe-files.<br /><br />The image at the top of this page shows the ParticleToy sample ZGE project running in 64-bit mode. Only glitch is the caption of the window which displays garbled characters, I hope to solve this soon!]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry110331-142954">
		<title>ZGameEditor Visualizer (ZgeViz) plugin released!</title>
		<link>http://www.emix8.org/index.php?entry=entry110331-142954</link>
		<description><![CDATA[I&#039;m immensely proud to announce that the <b>ZGameEditor based visualizer</b> ZgeViz (final name &quot;ZGameEditor Visualizer&quot;) is released as part of FL-Studio 10!<br /><br />More info here on Image-Lines announcement: <a href="http://www.image-line.com/documents/news.php?entry_id=1301017795&amp;title=fl-studio-10" target="_blank" >http://www.image-line.com/documents/new ... -studio-10</a><br /><br />This has been a lot of fun to develop for Jph and me so we hope it will be successful enough to leave room for more cool updates later on!<br /><br />The visualizer comes with over 40 built-in effects (all with the zgeproj-sources) and of course you can use ZGameEditor to develop your own effects.<br /><br />One of the last minute additions we made is a feature to use a video source to texture objects in the effects, demo here by Jph: <br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/B0qIysFdcqM" frameborder="0" allowfullscreen></iframe><br /><br />One more video by Alphaanimal:<br /> <iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/7zEWyEWKUfY" frameborder="0" allowfullscreen></iframe>]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry110310-142129">
		<title>NanoJPEG decoder for Delphi</title>
		<link>http://www.emix8.org/index.php?entry=entry110310-142129</link>
		<description><![CDATA[Added page <a href="static.php?page=nanoJpeg" target="_blank" >NanoJPEG decoder for Delphi</a>.<br />]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry101226-154653">
		<title>ZgeViz music visualizer</title>
		<link>http://www.emix8.org/index.php?entry=entry101226-154653</link>
		<description><![CDATA[Two demo videos of the upcoming music visualizer <b>ZgeViz</b> which is based on ZGameEditor:<br /><br /><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/0qjJoX2dBa8?fs=1&hl=sv_SE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0qjJoX2dBa8?fs=1&hl=sv_SE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object><br /><br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/R3eplkfOxtI?fs=1&hl=sv_SE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/R3eplkfOxtI?fs=1&hl=sv_SE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry101206-160834">
		<title>Qoob modeler with ZGameEditor integration</title>
		<link>http://www.emix8.org/index.php?entry=entry101206-160834</link>
		<description><![CDATA[<a href="http://qoob.weebly.com/index.html" target="_blank" >Qoob</a> by Auld is a new 3d-modeler based on procedural techniques and is therefore perfectly suited for projects where minimal size is a priority such as the demo scene and <a href="http://www.zgameeditor.org" target="_blank" >ZGameEditor</a>.<br /><br />I&#039;ve created a DLL that allows applications created with ZGE to use models from Qoob. Visit <a href="http://www.emix8.org/forum/viewtopic.php?t=710&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=" target="_blank" >the thread on ZGameEditor forum</a> for more information.<br /><br /><a href="javascript:openpopup('http://www.emix8.org/forum/files/qoob2_173.jpg',800,600,false);"><img src="http://www.emix8.org/forum/files/qoob2_173.jpg" border="0" alt="" /></a><br /><br /><a href="javascript:openpopup('http://www.emix8.org/forum/files/qoob1_224.jpg',800,600,false);"><img src="http://www.emix8.org/forum/files/qoob1_224.jpg" border="0" alt="" /></a><br /><br /><a href="javascript:openpopup('http://www.emix8.org/forum/files/qoobzge_297.jpg',800,600,false);"><img src="http://www.emix8.org/forum/files/qoobzge_297.jpg" border="0" alt="" /></a>]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry100308-134937">
		<title>ZGameEditor 1.9.9 released!</title>
		<link>http://www.emix8.org/index.php?entry=entry100308-134937</link>
		<description><![CDATA[<b>ZGameEditor</b> is a free game authoring tool that generates native high-performance stand-alone compact executables for Win32, Linux x86 and OS X. Now 3 years after initial release ZGameEditor has reached version 1.9.9 and it&#039;s <i>the most feature packed update yet</i>!<br /><br />ZGameEditor is an ideal tool for experimenting with <b>procedural content generation</b> techniques and developing <b>OpenGL-applications</b>. Make games, demos and screen savers using advanced graphics features such as multiple render passes, render targets and shaders. Instant GUI feedback of your changes. No waiting for build times!<br /><br /><b>ZGameEditor is 100% Free Open Source software.</b><br /><br /><b>New features</b> in 1.9.9 include:<br /><br />      - render to texture<br />      - multiple render passes<br />      - web-connectivity<br />      - string support in scripting language<br />      - calling external libraries<br /><br />And also many other improvements and changes!<br /><br />Download ZGameEditor here:<br /><br /><h1><a href="http://www.zgameeditor.org/" target="_blank" >http://www.zgameeditor.org/</a></h1><br /><br /><img src="http://www.zgameeditor.org/images/frontpage/zge_recursive_mesh_jph.jpg" width="500" height="391" border="0" alt="" /><br /><br /><img src="http://www.zgameeditor.org/images/frontpage/zge_recursive_mesh_ville.jpg" width="500" height="342" border="0" alt="" />]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry100216-172259">
		<title>SonnenmördeR - New game from JPH Wacheski </title>
		<link>http://www.emix8.org/index.php?entry=entry100216-172259</link>
		<description><![CDATA[JPH keeps making quality games with <a href="http://www.zgameeditor.org/" target="_blank" >ZGameEditor</a>. This time it is a Galaxian-style space shooter called <b>SonnenmördeR</b>.<br /><br /><img src="images/sunmurderer_sceen01.jpg" width="500" height="1000" border="0" alt="" /><br /><br /><a href="files/zzdc/SunMurderer_proto7.zip" target="_blank" >Download here</a>.<br /><br />More info in <a href="http://forums.tigsource.com/index.php?topic=9682.0" target="_blank" >this thread on Tigsource</a>.]]></description>
	</item>
	<item rdf:about="http://www.emix8.org/index.php?entry=entry090410-191437">
		<title>VectorLocust  - New game from JPH Wacheski </title>
		<link>http://www.emix8.org/index.php?entry=entry090410-191437</link>
		<description><![CDATA[A new game from JPH Wacheski made with ZGameEditor: &quot;<b>vectorLocust</b>&quot;. It is a vector based shooter in the same style as classic games BattleZone and Star Glider. But better than both of those in my opinion!<br /><br />Video 1:<br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3AfXdCdfxHQ&hl=sv&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3AfXdCdfxHQ&hl=sv&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br />Video 2:<br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/s5umfvWA4Yc&hl=sv&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/s5umfvWA4Yc&hl=sv&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br />JPHs homepage:  <a href="http://www.iterationgames.com/" target="_blank" >http://www.iterationgames.com/</a><br /><br />ZGameEditor game creation tool homepage:  <a href="http://www.zgameeditor.org/" target="_blank" >www.zgameeditor.org</a><br /><br />vectorLocust - more info and download:<br /><a href="http://forums.tigsource.com/index.php?topic=4976.0" target="_blank" >http://forums.tigsource.com/index.php?topic=4976.0</a>]]></description>
	</item>
</rdf:RDF>

