<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Galfar's Lair</title>
	<atom:link href="http://galfar.vevb.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://galfar.vevb.net/wp</link>
	<description>Oh hai!</description>
	<lastBuildDate>Fri, 13 Aug 2010 09:57:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PasJpeg2000 Update in Progress</title>
		<link>http://galfar.vevb.net/wp/2010/08/pasjpeg2000-update-in-progress/</link>
		<comments>http://galfar.vevb.net/wp/2010/08/pasjpeg2000-update-in-progress/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 09:56:23 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[JPEG 2000 for Pascal]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=756</guid>
		<description><![CDATA[I&#8217;m currently rewriting much of a Jpeg 2000 for Pascal library. There is a new IO class responsible for decoding and encoding of Jpeg 2000 files instead of only VCL TBitmap descendant. It&#8217;s cross platform and with only Delphi/FPC RTL dependencies. VCL and LCL TGraphic classes will be built using this IO class but it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently rewriting much of a Jpeg 2000 for Pascal library. There is a new IO class responsible for decoding and encoding of Jpeg 2000 files instead of only VCL TBitmap descendant. It&#8217;s cross platform and with only Delphi/FPC RTL dependencies. VCL and LCL TGraphic classes will be built using this IO class but it can be used independently as well (Imaging library will use it too). </p>
<p>New features of Jpeg 2000 for Pascal will be CMYK colorspace support and also indexed/palettized images support (yes, it&#8217;s possible to have image using palette in Jpeg 2000). These features as well as proper alpha channel definitions are patched into OpenJpeg library. Its team is not very active in incorporating larger patches into their code, so patches will probably always be additional step for people who want to recompile OpenJpeg themselves for use with PasJpeg2000.</p>
<p>You can follow the progress of the new version in SVN repository here: <a href="http://code.google.com/p/pasjpeg2000/source/browse/#svn/branches/v120" target="_blank">branch v120</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2010/08/pasjpeg2000-update-in-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ugly Images of Disabled Menu Items in Delphi</title>
		<link>http://galfar.vevb.net/wp/2010/04/ugly-images-of-disabled-items-in-delphi/</link>
		<comments>http://galfar.vevb.net/wp/2010/04/ugly-images-of-disabled-items-in-delphi/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 15:44:14 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Pascal & Delphi]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=726</guid>
		<description><![CDATA[Ever used 32bit images stored in TImageList in your Delphi application? Toolbars and some other VCL controls have DisabledImages property which is automatically used to get images for disabled toolbar buttons. But what about menu components? They don&#8217;t have this property and drawing of disabled images is handled by TImageList with original enabled images (TMainMenu.Images [...]]]></description>
			<content:encoded><![CDATA[<p>Ever used 32bit images stored in TImageList in your Delphi application? Toolbars and some other VCL controls have DisabledImages property which is automatically used to get images for disabled toolbar buttons. But what about menu components? They don&#8217;t have this property and drawing of disabled images is handled by TImageList with original enabled images (TMainMenu.Images property).  And the results are really abysmal. How can this be fixed?</p>
<p><a href="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/disabled-items-delphi.png" rel="lightbox[726]"><img class="aligncenter size-full wp-image-731" title="Disabled menu items" src="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/disabled-items-delphi.png" alt="" width="153" height="190" /></a>One way is to override DoDraw method of TImageList and change the code that draws disabled images. You can do regular RGB to grayscale conversion here or let  Windows draw it for you in grayscale with nearly no work on your part. You can do this by using <a href="http://msdn.microsoft.com/en-us/library/bb761537(VS.85).aspx" target="_blank">ImageList_DrawIndirect</a> with ILS_SATURATE parameter. Note that this works only on Windows XP and newer and for 32bit images only. For older targets or color depths doing your own RGB-&gt;grayscale conversion is an option (good idea would probably be to cache converted grayscale images somewhere so they won&#8217;t need to be converted on every draw call).</p>
<p>Here&#8217;s the code of DoDraw method using  ILS_SATURATE:</p>
<pre class="brush: delphi;">
type
// Descendant of regular TImageList
TSIImageList = class(TImageList)
protected
  procedure DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer;
    Style: Cardinal; Enabled: Boolean = True); override;
end;

procedure TSIImageList.DoDraw(Index: Integer; Canvas: TCanvas; X, Y: Integer;
  Style: Cardinal; Enabled: Boolean);
var
  Options: TImageListDrawParams;

  function GetRGBColor(Value: TColor): Cardinal;
  begin
    Result := ColorToRGB(Value);
    case Result of
      clNone: Result := CLR_NONE;
      clDefault: Result := CLR_DEFAULT;
    end;
  end;

begin
  if Enabled or (ColorDepth &lt;&gt; cd32Bit) then
    inherited
  else if HandleAllocated then
  begin
    FillChar(Options, SizeOf(Options), 0);
    Options.cbSize := SizeOf(Options);
    Options.himl := Self.Handle;
    Options.i := Index;
    Options.hdcDst := Canvas.Handle;
    Options.x := X;
    Options.y := Y;
    Options.cx := 0;
    Options.cy := 0;
    Options.xBitmap := 0;
    Options.yBitmap := 0;
    Options.rgbBk := GetRGBColor(BkColor);
    Options.rgbFg := GetRGBColor(BlendColor);
    Options.fStyle := Style;
    Options.fState := ILS_SATURATE; // Grayscale for 32bit images

    ImageList_DrawIndirect(@Options);
  end;
end;
</pre>
<p><strong>Important note: </strong>For ILS_SATURATE to work correctly source image files must be 32bit with proper alpha channel data, setting color depth of TImageList to 32bit is not enough! If you don&#8217;t see any images drawn this is probably the cause: 8/24bit image is loaded from file and then inserted into 32bit TImageList. As there is no alpha channel data in source image it is drawn as fully transparent so you don&#8217;t see anything.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">http://msdn.microsoft.com/en-us/library/bb761537(VS.85).aspx</div>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2010/04/ugly-images-of-disabled-items-in-delphi/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HoMaM 2 and Arena remakes</title>
		<link>http://galfar.vevb.net/wp/2010/04/homam-2-and-arena-remakes/</link>
		<comments>http://galfar.vevb.net/wp/2010/04/homam-2-and-arena-remakes/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 14:35:50 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=714</guid>
		<description><![CDATA[My favorite game from Heroes of Might and Magic series is the second one. I guess it&#8217;s mainly because of its graphics. I like these nicely done 2D sprites much more than renders of 3D models from HoMaM 3.
Today you can play original DOS version of  HoMaM 2 in DosBox. It wasn&#8217;t the case few [...]]]></description>
			<content:encoded><![CDATA[<p>My favorite game from Heroes of Might and Magic series is the second one. I guess it&#8217;s mainly because of its graphics. I like these nicely done 2D sprites much more than renders of 3D models from HoMaM 3.</p>
<p>Today you can play original DOS version of  HoMaM 2 in DosBox. It wasn&#8217;t the case few years ago when DosBox wasn&#8217;t able to run SVGA games. There&#8217;s also Windows version of HoMaM 2 executables in Heroes Of Might And Magic 2 Gold (expansion disk included). However, neither of these two options take advantage of today&#8217;s high resolution monitors. Map view will always be stretched from it&#8217;s original 640&#215;480 resolution.</p>
<p>Several years ago, I stumbled upon <a href="http://sourceforge.net/projects/fheroes2/" target="_blank">Free Heroes II</a> project. It&#8217;s a GPL cross-platform (SDL based) implementation of Heroes of the Might and Magic II engine. It&#8217;s been steadily progressing over the years and fortunately hasn&#8217;t died like many other remakes of older games. Today, &#8220;standard game&#8221; mode is playable as well as hot seat multiplayer. Very nice feature of Free Heroes II is that map view is not stretched to higher resolutions. Instead, you can see larger portion of a map without the need for a lot of scrolling around. Let&#8217;s hope we&#8217;ll see version 1.0 in near future.</p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/fheroes.png" rel="lightbox[714]"><img class="size-medium wp-image-713 aligncenter" title="Free Heroes 2" src="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/fheroes-400x310.png" alt="Free Heroes 2" width="400" height="310" /></a></p>
<p>Another game I&#8217;d like to see remade is the first The Elder Scrolls game Arena. There hasn&#8217;t been any known attempt at remake Arena &#8211; unlike its sequel Daggerfall (though all past remakes failed the latest one, <a href="http://daggerxl.wordpress.com/" target="_blank">DaggerXL</a>, remains very promising). No description of Arena file formats is available on the Internet either (with few exceptions of raw images or formats shared by more Bethesda games) &#8211; again unlike Daggerfall where almost everything is described in detail.</p>
<p>I was pleasantly surprised few months ago when I found out about WinArena. It was originally Arena resource extractor and converter (textures, maps, sounds, sprites, &#8230;) with 3D engine capable of  displaying Arena maps added later. Unfortunately there are only two versions you can find on the net and the latest is dated December 2005 &#8211; so it&#8217;s long since dead.</p>
<p>3D engine uses software rendering in 256 color mode like original Arena (it supports higher resolutions though). According to the author, many of the effects in the game are based on palette manipulation tricks so it wouldn&#8217;t be possible to get the exact Arena look using standard hardware accelerated 3D API like Direct3D or OpenGL.</p>
<p>What&#8217;s best on WinArena is that full source code is provided. And since it handles most if not all Arena file formats, getting their description is just a matter of going through the code. I&#8217;d also love the possibility to revisit all the main maps in the game so maybe I&#8217;ll modify it a little bit (WinArena currently starts at the beginning of actual Arena gameplay &#8211; in the prison like most TES games do).</p>
<p>You can get latest version of WinArena at <a href="http://www.tesnexus.com/downloads/file.php?id=8516" target="_blank">TESNexus</a>.</p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/winarena.png" rel="lightbox[714]"><img class="aligncenter size-medium wp-image-720" title="WinArena" src="http://galfar.vevb.net/wp/wp-content/uploads/2010/04/winarena-400x270.png" alt="WinArena" width="400" height="270" /></a></p>
<p>Just before publishing this post I also found <a href="http://code.google.com/p/pyarenalinux/" target="_blank">Python port of Elder Scrolls: Arena</a> which also seems inactive at the moment (there&#8217;s some resource extraction Python code in the project&#8217;s repository).</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2010/04/homam-2-and-arena-remakes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stats for 2009</title>
		<link>http://galfar.vevb.net/wp/2010/03/stats-for-2009/</link>
		<comments>http://galfar.vevb.net/wp/2010/03/stats-for-2009/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 20:25:00 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=693</guid>
		<description><![CDATA[I quite like looking at various stats and sometimes even big tables with a lots of numbers. Since I don&#8217;t have anything in particular to write about now, I&#8217;ll share some of the site stats for 2009.
Downloads
Top download is JPEG 2000 for Pascal package with about 700 downloads. Second place goes to glSOAR terrain renderer with [...]]]></description>
			<content:encoded><![CDATA[<p>I quite like looking at various stats and sometimes even big tables with a lots of numbers. Since I don&#8217;t have anything in particular to write about now, I&#8217;ll share some of the site stats for 2009.</p>
<h4>Downloads</h4>
<p>Top download is <a href="http://galfar.vevb.net/wp/projects/jpeg2000-for-pascal/" title="JPEG 2000 for Pascal">JPEG 2000 for Pascal</a> package with about 700 downloads. Second place goes to <a href="terrain#soar">glSOAR</a> terrain renderer with about 200 downloads. Third place is shared between <a href="earth-under-fire">Earth Under Fire</a> shooter and venerable <a href="oldprojects#ripper">JPEG Ripper</a> tool, both with meager 60 downloads.</p>
<h3>Visitors</h3>
<p>There have been around 4000 visitors since last March. 42% of them got here from referring sites,  35% used search engine, and 23% is direct traffic.</p>
<h3>Referring Pages</h3>
<p>Basically all of them are connected to Imaging Library or JPEG 2000 for Pascal (torry.net, delphiplus.org, imaginglib.sf.net, cc.embarcadero.com, etc.). For some reason there&#8217;s really a lot of referrals from images.google[.ru|.de|.fr|.com] pointing mostly to screenshots from Ufo: Extraterrestrials and <a href="terrain">Terrain Rendering</a> stuff. Few links to Earth Under Fire from pascalgamedevelopment.com are in the stats too.</p>
<h3>Browsers and OS</h3>
<p>Firefox is in the lead with 40% share, IE is second with 25%, third is Opera with 22%, Chrome and Safari have 7% and 2% respectively. Windows is major OS here with 91%, Linux and Mac OS X have about 4% each. There&#8217;s also one visit from Wii and one from PS3.</p>
<h3>Search Engine Keywords</h3>
<p>Most common keywords refer to these topics: Terrain rendering, JPEG 2000 for Delphi and Pascal, Ufo: Extraterrestrials, DirectX 11 for Delphi, and Daggerfall. You can find more or less information about these topics at this site.</p>
<p>Some keywords were very common too even though I wouldn&#8217;t think they&#8217;d be so popular:</p>
<ul>
<li>APNG  (mostly coupled with Delphi) &#8211; As far as I know my Imaging is only library for Pascal and Delphi that can read and write APNG animated images. That&#8217;s probably why Google search for &#8220;apng delphi&#8221; puts this site at top.</li>
<li>Delphi shr operator &#8211; Looks like there&#8217;s more people surprised that it treats negative values differently than shift right operator in C and some other languages. More on this in this post <a href="http://galfar.vevb.net/wp/2009/11/shift-right-delphi-vs-c/" title="Shift Right: Delphi vs C">Shift Right: Delphi vs C</a>.</li>
<li>Daggerfall music (&#8220;daggerfall gstory music&#8221;, &#8220;eric heberling&#8221; daggerfall&#8221;, &#8220;robert hood daggerfall&#8221;) &#8211; Great music indeed, much better than what&#8217;s in Morrowind and Oblivion.</li>
<li>SOAR terain rendering &#8211; here&#8217;s my Pascal implementation <a href="terrain#soar">glSOAR</a>.</li>
<li>Modula-2 related (&#8220;modula-2 vs c++, vs pascal, vs freepascal, on mac ox, for 8051, &#8230;&#8221; )</li>
</ul>
<p>And here are some uniques searches:</p>
<ul>
<li>&#8220;ancientlich&#8221; &#8211; My favorite monster in Daggerfall as well, checkout bestiary at <a href="http://www.uesp.net/wiki/Daggerfall:Bestiary" target="_blank">UESP</a> (top of the Undead section!).</li>
<li>&#8220;UFO old programming language&#8221; &#8211; that must be COBOL!</li>
<li>&#8220;ufo enemy ripped png picture&#8221; &#8211; anyone has these?</li>
<li>&#8220;directx 11 radeon x1950&#8243; &#8211; sadly no, otherwise I&#8217;d put it back in my PC right away.</li>
<li>&#8220;mng vs apng&#8221; &#8211; basically MNG is much more capable but harder to implement, more VS info <a href="http://mozilla.wikia.com/wiki/APNG_vs_MNG" target="_blank">here</a>.</li>
<li>&#8220;john the ripper directx 11&#8243; &#8211; is this some of kind of a game or what?</li>
<li>&#8220;mac os 7.5 emulator&#8221; &#8211; check out <a href="http://basilisk.cebix.net/" target="_blank">Basilisk </a>.</li>
<li>&#8220;midi format daggerfall&#8221; &#8211; It&#8217;s HMI (Human machine interfaces MIDI music file), WinAmp can play and convert that (and other old game MIDI formats as well).</li>
<li>&#8220;a price drop for gpu in 2010&#8243; &#8211; there better be one.</li>
<li>&#8220;earth on fire from space&#8221; &#8211; let&#8217;s hope not anytime soon.</li>
<li>&#8220;gulfar vivek&#8221;, &#8220;how is galfar doing?&#8221;, &#8220;large galfar image&#8221; &#8211; ???</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2010/03/stats-for-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imaging in C++ Builder</title>
		<link>http://galfar.vevb.net/wp/2009/12/imaging-in-c-builder/</link>
		<comments>http://galfar.vevb.net/wp/2009/12/imaging-in-c-builder/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 19:42:41 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=675</guid>
		<description><![CDATA[I tried compiling Imaging in C++ Builder (it uses Delphi compiler to generate .obj file which C++ linker can link and also generates C++ header for Pascal unit) few years ago. It didn&#8217;t work &#8211; there was internal compiler error, I think right in ImagingTypes unit. 
Few days ago I tried C++ Builder 2010 and [...]]]></description>
			<content:encoded><![CDATA[<p>I tried compiling Imaging in C++ Builder (it uses Delphi compiler to generate .obj file which C++ linker can link and also generates C++ header for Pascal unit) few years ago. It didn&#8217;t work &#8211; there was internal compiler error, I think right in ImagingTypes unit. </p>
<p>Few days ago I tried C++ Builder 2010 and was pleasantly surprised. It worked! I tried just the library core for now (ImagingTypes, Imaging, ImagingFormats, Pascal only file handlers, etc.) and it works without problems. I&#8217;m not sure which C++ Builder version is required for successful compile though. Versions 6 and 2006 stopped with internal error, 2010 worked, and there are 2 other versions between.</p>
<p>Anyway, I&#8217;ll try to check out most of the library until the 2010 trial expires for me. Hmm, I&#8217;m wondering how many people use C++ Builder for C++ development &#8211; I&#8217;ve never did something serious in it, basically just to get object files usable by Delphi &#8211; so I have no idea if it&#8217;s ok. </p>
<p>PS: Another C++ Builder related news &#8211; patch for OpenJpeg library to get it compiling in BCB is <a href="http://groups.google.com/group/openjpeg/browse_thread/thread/5a34751c74e290d5" target="_blank">posted here</a>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/12/imaging-in-c-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PasJpeg2000 News</title>
		<link>http://galfar.vevb.net/wp/2009/12/pasjpeg2000-news/</link>
		<comments>http://galfar.vevb.net/wp/2009/12/pasjpeg2000-news/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 19:37:55 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[JPEG 2000 for Pascal]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=657</guid>
		<description><![CDATA[JPEG 2000 for Pascal project is based on OpenJpeg library. For a very long time there was a bug that caused alpha (fourth and subsequent image channels) channel to be saved with all the samples having the value of 0.5 (128 for 8bit channels). This buggy behavior also depended on compiler settings &#8211; optimization level [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://galfar.vevb.net/wp/projects/jpeg2000-for-pascal/" title="JPEG 2000 for Pascal">JPEG 2000 for Pascal</a> project is based on <a href="http://www.openjpeg.org" target="_blank">OpenJpeg</a> library. For a very long time there was a bug that caused alpha (fourth and subsequent image channels) channel to be saved with all the samples having the value of 0.5 (128 for 8bit channels). This buggy behavior also depended on compiler settings &#8211; optimization level in case of GCC. You could use at most O1 in Windows and Linux, and only O0 in Mac OS X. Bug was also present when compiling with C++ Builder (to get object files usable in Delphi) but only when irreversible DWT transformation was enabled in OpenJpeg during encoding (it wasn&#8217;t before, but working versions of both PasJpeg2000 and Imaging use it now when lossy compression is selected by user to get smaller files).<br />
You can read more about it in <a href="http://groups.google.com/group/openjpeg/browse_thread/thread/d9d96dd4ec3e7443" target="_blank">this news group post</a>. Basically it was all fixed by changing a condition in one <strong>if</strong> statement to prevent accessing the fourth element of a three element array.</p>
<p>So what can you expect in the next version of PasJpeg2000 library?<br />
Higher GCC optimization levels should make it a lot faster when using Free Pascal (particularly in Mac OS X where O0 was used). Irreversible DWT transformation produces smaller lossy files than current PasJpeg2000 version and with optional MCT (multicomponent transform &#8211; basically RGB&gt;YCbCr) you get even smaller ones. There&#8217;s now also a patch that enables OpenJpeg to get palettes from JP2 files so indexed JPEG 2000 images could be supported too. And finally, there are some bug fixes (wrong reconstruction of subsampled files, &#8230;).</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/12/pasjpeg2000-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shift Right: Delphi vs C</title>
		<link>http://galfar.vevb.net/wp/2009/11/shift-right-delphi-vs-c/</link>
		<comments>http://galfar.vevb.net/wp/2009/11/shift-right-delphi-vs-c/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:33:59 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Pascal & Delphi]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=605</guid>
		<description><![CDATA[Few weeks ago I converted a little function from C language to Delphi. I kept getting completely wrong results all the time even though I was sure the C to Pascal conversion was right (it was really just few lines). After some desperate time, I just tried replacing SHR operator by normal DIV (as A [...]]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago I converted a little function from C language to Delphi. I kept getting completely wrong results all the time even though I was sure the C to Pascal conversion was right (it was really just few lines). After some desperate time, I just tried replacing <strong>SHR</strong> operator by normal <strong>DIV</strong> (as A SHR 1 = A DIV 2 and so on). To my surprise, I immediately got the right results. Can Delphi&#8217;s (I didn&#8217;t test it in Free Pascal) <strong>SHR</strong> operator behave differently than C&#8217;s <strong>&gt;&gt;</strong> operator?</p>
<p>It does in fact. SHR treats its first operand as unsigned value even though it is a variable of signed type whereas &gt;&gt; takes the sign bit into account. In the function I converted the operand for right shift was often negative and Delphi&#8217;s SHR just ignored the value of the sign bit.</p>
<h3>A Bit of Code</h3>
<pre class="brush: cpp;">
int a, b1, b2;
a = -512;
b1 = a &gt;&gt; 1;
b2 = a / 2;
</pre>
<p>After running this C code both <strong>b1</strong> and <strong>b2</strong> have a value of -256.</p>
<pre class="brush: delphi;">
var A, B1, B2: Integer;
A := -512;
B1 := A shr 1;
B2 := A div 2;
</pre>
<p>This Delphi code however yields different result: <strong>B2</strong> is -256 as expected but <strong>B1</strong> has a value of 2147483392.</p>
<h3>A Bit of Assembler</h3>
<p>Assembler output of C code:</p>
<pre class="brush: plain;">
Unit1.cpp.22: b1 = a &gt;&gt; 1;
mov eax,[ebp-$0c]
sar eax,1
mov [ebp-$10],eax
Unit1.cpp.23: b2 = a / 2;
mov edx,[ebp-$0c]
sar edx,1
jns $00401bb9
adc edx,$00
mov [ebp-$14],edx
</pre>
<p>Assembler output of Delphi code:</p>
<pre class="brush: plain;">
Unit1.pas.371: B1 := A shr 1;
mov eax,[ebp-$0c]
shr eax,1
mov [ebp-$1c],eax
Unit1.pas.373: B2 := A div 2;
mov eax,[ebp-$0c]
sar eax,1
jns $00565315
adc eax,$00
mov [ebp-$20],eax
</pre>
<p>As you can see, asm output of C and Delphi divisions is identical. What differs is asm for shift right operator. Delphi uses <strong>shr</strong> instruction whereas C uses <strong>sar</strong> instruction. The difference: shr does logical shift and sar does arithmetic one.</p>
<blockquote><p>The SHR instruction clears the most significant bit (see Figure 6-7 in the Intel Architecture Software Developer&#8217;s Manual, Volume 1); the SAR instruction sets or clears the most significant bit to correspond to the sign (most significant bit) of the original value in the destination operand.</p></blockquote>
<p>Quoted from: <a href="http://faydoc.tripod.com/cpu/shr.htm">http://faydoc.tripod.com/cpu/shr.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/11/shift-right-delphi-vs-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imaging 0.26.4 Released</title>
		<link>http://galfar.vevb.net/wp/2009/10/imaging-0-26-4-released/</link>
		<comments>http://galfar.vevb.net/wp/2009/10/imaging-0-26-4-released/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:28:32 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=598</guid>
		<description><![CDATA[Vampyre Imaging Library project was updated to version 0.26.4 few hours ago. This was supposed to be fix/patch/update release only but new features got in nevertheless (most notably APNG support I wrote about earlier and arbitrary angle image rotations).
More info and downloads at Imaging&#8217;s homepage.
]]></description>
			<content:encoded><![CDATA[<p><strong>Vampyre Imaging Library</strong> project was updated to version 0.26.4 few hours ago. This was supposed to be fix/patch/update release only but new features got in nevertheless (most notably APNG support I wrote about earlier and arbitrary angle image rotations).</p>
<p>More info and downloads at <a href="http://imaginglib.sourceforge.net">Imaging&#8217;s homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/10/imaging-0-26-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectX 11: GPUs and headers</title>
		<link>http://galfar.vevb.net/wp/2009/09/directx-11/</link>
		<comments>http://galfar.vevb.net/wp/2009/09/directx-11/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 22:10:32 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>
		<category><![CDATA[Pascal & Delphi]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=592</guid>
		<description><![CDATA[Few days ago I was wondering how long it will take to see DirectX 11 headers translated to Delphi/Pascal. I knew that translations of new DX components Direct2D and DirectWrite are part of Delphi 2010, but what about Direct3D and DirectCompute?
I checked out Clootie graphics pages but no luck there. Unfortunately, it&#8217;s not so active [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago I was wondering how long it will take to see DirectX 11 headers translated to Delphi/Pascal. I knew that translations of new DX components Direct2D and DirectWrite are part of Delphi 2010, but what about Direct3D and DirectCompute?</p>
<p>I checked out <a title="Clootie graphics pages" href="http://clootie.ru" target="_blank">Clootie graphics pages</a> but no luck there. Unfortunately, it&#8217;s not so active anymore. After that I thought DX11 for Pascal wouldn&#8217;t appear in like several months at least. Surprise, I found it about 5 minutes later. John Bladen published his DX11 translation on <a href="http://directxfordelphi.blogspot.com/" target="_blank">DirectX for Delphi</a> blog. Thanks John!</p>
<p>Now all that remains is buying a DX11 GPU. New Radeons should be released sometime during this week and I&#8217;m thinking of getting 5850 model in a few months. Rumours are that NVidia&#8217;s DX11 cards won&#8217;t be out before 2010, so probably no big price drops for 5800 Radeons are to be expected until then.</p>
<p>My pile of old graphic cards will get bigger once again. I don&#8217;t buy new CPU/motherboard/RAM too often (now it&#8217;s Core2 from 2007 and before that AthlonXP in 2002) and I usually manage to sell the old ones or put them on server duty somewhere. However, since GPU performance as well as requirements on it rise much more faster than that of CPU, I ended up with like 5 cards in last 8 years. I managed to sell Radeon 9000 and GeForce 6600 but I still have Riva TNT2 and Radeon X1950 in my closet somewhere (and S3 Trio!). Hopefully, I&#8217;ll find a buyer for my 1GB 4850 soon.</p>
<p>Lately, I&#8217;ve had bad luck buying some new stuff just before major price drop. Hopefully, this won&#8217;t happen with 5850. Not that I want it to remain expensive &#8211; just want to buy it after the drop, not  a little while before it.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/09/directx-11/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Block Compression, DXTC, And Imaging</title>
		<link>http://galfar.vevb.net/wp/2009/08/block-compression-dxtc-and-imaging/</link>
		<comments>http://galfar.vevb.net/wp/2009/08/block-compression-dxtc-and-imaging/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 01:12:55 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Image Formats]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=564</guid>
		<description><![CDATA[Imaging supported DXT image/texture compression since one of the earliest releases. Quality of compressed images isn&#8217;t very high though (at least the compression isn&#8217;t too slow). For future Imaging versions I plan to ditch the current compression code and add a new one. To be precise, two new ones &#8211; fast and lower quality (still [...]]]></description>
			<content:encoded><![CDATA[<p>Imaging supported DXT image/texture compression since one of the earliest releases. Quality of compressed images isn&#8217;t very high though (at least the compression isn&#8217;t too slow). For future Imaging versions I plan to ditch the current compression code and add a new one. To be precise, two new ones &#8211; fast and lower quality (still probably better than current Imaging&#8217;s compression), and slow and higher quality mode. Fast one will be based on <a href="http://cache-www.intel.com/cd/00/00/32/43/324337_324337.pdf" target="_blank">Real-Time DXT Compression</a> by Id Soft. I&#8217;m not decided on high quality one yet, but probably something like cluster fit algorithm from <a href="http://code.google.com/p/libsquish/" target="_blank">Squish library</a>.</p>
<p>Mainly for testing purposes during implementation of these new methods, I want to create extension for Imaging that compares two images (original and one reconstructed from compressed original) and measures PSNR and some other quality metrics.</p>
<p>I&#8217;m also thinking of implementing DXT5 based format using YCoCg colorspace and PVRTC (texture compression currently used in iPhone).</p>
<p>Few links if you&#8217;re interested:</p>
<ul>
<li>Brief DXTC overview: <a href="http://en.wikipedia.org/wiki/S3_Texture_Compression" target="_blank">http://en.wikipedia.org/wiki/S3_Texture_Compression</a></li>
<li>More technical details: <a href="http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt" target="_blank">http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt</a></li>
<li>YCoCg-DXT related: <a href="http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html" target="_blank">http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html</a></li>
</ul>
<p>Here&#8217;s some quick comparison of DXT compressors (click the image to see full size). Value in brackets is MSE (mean square error) &#8211; lesser number means compressed image is more similar to original.</p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/08/dxtcompare.png" rel="lightbox[564]"><img class="size-medium wp-image-567 aligncenter" title="DXT compressors comparison" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/08/dxtcompare-266x400.png" alt="DXT compressors comparison" width="266" height="400" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/08/block-compression-dxtc-and-imaging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Daggerfall for Free!</title>
		<link>http://galfar.vevb.net/wp/2009/07/daggerfall-for-free/</link>
		<comments>http://galfar.vevb.net/wp/2009/07/daggerfall-for-free/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 13:27:14 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=554</guid>
		<description><![CDATA[One of my all time favorite games was released as free download few weeks ago as a celebration of 15th anniversary of Elder Scrolls series. It’s 1996 title The Elder Scrolls: Daggerfall by Bethesda. You can get 150MiB zip archive with install at BethSoft&#8217;s site. Getting it working on modern OS is not easy but [...]]]></description>
			<content:encoded><![CDATA[<p>One of my all time favorite games was released as free download few weeks ago as a celebration of 15th anniversary of Elder Scrolls series. It’s 1996 title <a title="Elder Scrolls: Daggerfall" href="http://en.wikipedia.org/wiki/Daggerfall" target="_blank">The Elder Scrolls: Daggerfall</a> by Bethesda. You can get 150MiB zip archive with install at <a href="http://bethblog.com/index.php/2009/07/09/daggerfall-now-available-for-free/" target="_blank">BethSoft&#8217;s site</a>. Getting it working on modern OS is not easy but DosBox should help here.</p>
<p>There were a lot of attempts at remakes of Daggerfall but all failed so far. However, a new promising one appeared recently and it’s progressing at warp speed since then (one month from wrongly textured entrance of Privateer’s Hold dungeon to rendering city blocks). Check out development blog and downloads at the homepage of <a href="http://daggerxl.wordpress.com/" target="_blank">DaggerXL</a>. You need original Daggerfall data files to run the demo – no problem now when you can get it free.</p>
<p><a href="http://www.dfworkshop.net/" target="_blank">Daggerfall Workshop</a> was recently reopened as well. It’s a home of tools that let you explore Daggerfall’s game assets (textures, models, maps, music, etc.). There’s also a new exploring tool in development that looks really good, with very interesting blog posts about various Dagger’s file formats, rendering techniques, and so on.</p>
<p>I did my small share of dabbling in Daggerfall’s file formats too. Image and texture loaders in Object Pascal are part of ElderImagery extension of Imaging library and I’ve got BSA archive handler somewhere too. I’m now thinking of adding SKY format (backdrop images used in game for skies and far away mountains) loader, just for fun I guess.</p>
<p>When writing about Daggerfall, one cannot forget mentioning its music which was really excellent. Much more atmospheric and fitting than the music in recent Elder Scrolls games (there was also a lot more tracks). Check out <a href="http://www.rhmusic.net/dfmusicproject/music.html" target="_blank">Robert Hood’s arrangements</a> of Eric Heberling&#8217;s original music tracks.</p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag01.png" rel="lightbox[554]"><img class="alignnone size-thumbnail wp-image-555" title="Castle Wayrest" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag01-192x128.png" alt="Castle Wayrest" width="192" height="128" /></a><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag02.png" rel="lightbox[554]"><img class="alignnone size-thumbnail wp-image-556" title="Wildreness at night" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag02-192x128.png" alt="Wildreness at night" width="192" height="128" /></a></p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag03.png" rel="lightbox[554]"><img class="alignnone size-thumbnail wp-image-557" title="Wilderness" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag03-192x128.png" alt="Wilderness" width="192" height="128" /></a><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag04.png" rel="lightbox[554]"><img class="alignnone size-thumbnail wp-image-558" title="My character" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag04-192x128.png" alt="My character" width="192" height="128" /></a></p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag05.png" rel="lightbox[554]"><img class="size-thumbnail wp-image-559 aligncenter" title="My other character" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/07/dag05-192x128.png" alt="My other character" width="192" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/07/daggerfall-for-free/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>First JPEG 2000 for Pascal Release</title>
		<link>http://galfar.vevb.net/wp/2009/07/first-jpeg-2000-for-pascal-release/</link>
		<comments>http://galfar.vevb.net/wp/2009/07/first-jpeg-2000-for-pascal-release/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 13:18:39 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Image Formats]]></category>
		<category><![CDATA[JPEG 2000 for Pascal]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/07/first-jpeg-2000-for-pascal-release/</guid>
		<description><![CDATA[I finally released first version of JPEG 2000 for Pascal library. It’s based on translated header and precompiled OpenJpeg library that was part of Imaging for a long time – now released separately.
There’s header translation working with both Delphi and FPC and original C library precompiled to object files (Delphi) and static libraries (FPC for [...]]]></description>
			<content:encoded><![CDATA[<p>I finally released first version of JPEG 2000 for Pascal library. It’s based on translated header and precompiled <a href="http://www.openjpeg.org" target="_blank">OpenJpeg</a> library that was part of Imaging for a long time – now released separately.</p>
<p>There’s header translation working with both Delphi and FPC and original C library precompiled to object files (Delphi) and static libraries (FPC for Win32, Linux x86/x64, and Mac OS X).</p>
<p>I’ve written simple TBitmap descendant that loads and saves JPEG 2000 images. It’s only for Delphi now – can’t do LCL version with just few IFDEFS, there are lot more changes between VCL and LCL TBitmaps. I plan to write separate LCL version for one of upcoming releases (using TFPCustomImageWriter and TFPCustomImageReader classes).</p>
<p>You can get JPEG 2000 for Pascal library at it’s <a href="http://galfar.vevb.net/pasjpeg2000">project page</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/07/first-jpeg-2000-for-pascal-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APNG Update</title>
		<link>http://galfar.vevb.net/wp/2009/06/apng-update/</link>
		<comments>http://galfar.vevb.net/wp/2009/06/apng-update/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 02:45:17 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Image Formats]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/06/apng-update/</guid>
		<description><![CDATA[APNG loading and animating implementation for Imaging wasn&#8217;t very hard work. However, there are not that many test images to be found on the Internet and most of the available ones are very simple. They&#8217;re usually not using disposal methods and are basically just collection of independent images. Big difference compared to GIF files &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>APNG loading and animating implementation for Imaging wasn&#8217;t very hard work. However, there are not that many test images to be found on the Internet and most of the available ones are very simple. They&#8217;re usually not using disposal methods and are basically just collection of independent images. Big difference compared to GIF files &#8211; some of them were quite difficult to animate right. I even got most of nontrivial APNG test files by converting some more complex animated GIF files. Tools for creating APNG images are not yet as sophisticated as some GIF animation tools &#8211; there&#8217;s <a href="http://sourceforge.net/projects/giftoapngconver" target="_blank">GIF to APNG converter</a>, <a href="http://sites.google.com/site/cphktool/apng-anime-maker" target="_blank">APNG Anime Maker</a>, and some web based tools that assemble simple APNG file from bunch of uploaded single PNG frames.</p>
<p>Now I&#8217;m gonna extend PNG saver to allow saving multi images to simple APNG files, much like MNG saving works now. There&#8217;s really not a good unified way how to pass some more information to image file savers in current library design &#8211; that&#8217;s one of TODOs for new Imaging architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/06/apng-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APNG Support for Imaging</title>
		<link>http://galfar.vevb.net/wp/2009/05/apng-support-for-imaging/</link>
		<comments>http://galfar.vevb.net/wp/2009/05/apng-support-for-imaging/#comments</comments>
		<pubDate>Tue, 19 May 2009 20:32:30 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Image Formats]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/05/apng-support-for-imaging/</guid>
		<description><![CDATA[I started working on support for APNG format for Imaging library. APNG is unofficial extension of PNG image file format created by two guys from Mozilla Corporation. The point of APNG is to allow storing simple animations in PNG files (hence the &#8220;A&#8221; for &#8220;Animated&#8221;).
There is already PNG-like chunk based format for animations called MNG [...]]]></description>
			<content:encoded><![CDATA[<p>I started working on support for <strong>APNG</strong> format for Imaging library. APNG is unofficial extension of PNG image file format created by two guys from Mozilla Corporation. The point of APNG is to allow storing simple animations in PNG files (hence the &#8220;A&#8221; for &#8220;Animated&#8221;).</p>
<p>There is already PNG-like chunk based format for animations called <strong>MNG </strong>(already supported by Imaging &#8211; at least the basic features). However, MNG is quite complex format and its support among browsers and image viewers/editors is lacking. Code library supporting all MNG features is huge.</p>
<p>APNG on the other hand is just an extension of PNG and its implementation is not so complex. I&#8217;m going to load only the raw frames from files at first and see what will have to be done to support animating the frames next. Canvas class will have to be used here for alpha blending subsequent frames to previous ones. I&#8217;ll add option to turn the animating on/off just like it is available for animated GIF files.</p>
<p>More info about APNG: <a title="http://www.animatedpng.com" href="http://www.animatedpng.com">http://www.animatedpng.com</a> and <a title="https://wiki.mozilla.org/APNG_Specification" href="https://wiki.mozilla.org/APNG_Specification">https://wiki.mozilla.org/APNG_Specification</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/05/apng-support-for-imaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Homepage Ready</title>
		<link>http://galfar.vevb.net/wp/2009/05/new-homepage-ready/</link>
		<comments>http://galfar.vevb.net/wp/2009/05/new-homepage-ready/#comments</comments>
		<pubDate>Sat, 02 May 2009 11:52:03 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/05/new-homepage-ready/</guid>
		<description><![CDATA[I created new web site based on Wordpress at http://galfar.vevb.net/wp/ few months and I’ve been slowly transferring content there since then. It’s ready now so I’ll redirect http://galfar.vevb.net/ to the new site in a moment. Old one will still be available at http://galfar.vevb.net/cms/ but all the old content should be available here too.
Current theme is [...]]]></description>
			<content:encoded><![CDATA[<p>I created new web site based on Wordpress at <a title="http://galfar.vevb.net/wp/" href="http://galfar.vevb.net/wp/">http://galfar.vevb.net/wp/</a> few months and I’ve been slowly transferring content there since then. It’s ready now so I’ll redirect <a title="http://galfar.vevb.net/wp/" href="http://galfar.vevb.net/wp/">http://galfar.vevb.net/</a> to the new site in a moment. Old one will still be available at <a title="http://galfar.vevb.net/wp/" href="http://galfar.vevb.net/cms/">http://galfar.vevb.net/cms/</a> but all the old content should be available here too.</p>
<p>Current theme is just temporary, I’ll look for something more to my liking later (going away for a week in few hours) and probably do some modifications. I’ve tried quite a few themes already but there was always some glitch (no header margins, wrong image alignment, etc.).</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/05/new-homepage-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working in MODULA-2</title>
		<link>http://galfar.vevb.net/wp/2009/04/working-in-modula-2/</link>
		<comments>http://galfar.vevb.net/wp/2009/04/working-in-modula-2/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 10:36:37 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/04/working-in-modula-2/</guid>
		<description><![CDATA[I’ve been working in Modula-2 for last few weeks. It’s a considered a dead language now, one of Pascal’s descendants designed by Niclaus Wirth. I’ve been doing some updates to quite an old project, embedded system for military usage.&#160; I had to run Mac OS 7.5 emulator to get original 1989 compiler running. Modula-2 dialect [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been working in Modula-2 for last few weeks. It’s a considered a dead language now, one of Pascal’s descendants designed by Niclaus Wirth. I’ve been doing some updates to quite an old project, embedded system for military usage.&#160; I had to run Mac OS 7.5 emulator to get original 1989 compiler running. Modula-2 dialect understood by this compiler is quite strict – you cannot even mix cardinal and integer numbers without explicitly converting one of them. </p>
<p>First difference you may notice (compared to Pascal) is case sensitiveness of Modula-2, for instance all reserved words are upper cased. You don’t have to write so many begin-end statements though. Another C-like trait is importance of header files (definition modules) order during compiling – just change it a little bit in a large project and whole thing breaks down. </p>
<p align="left">More info about Modula-2 if you’re interested: <a href="http://www.modula2.org/">http://www.modula2.org/</a>.</p>
<p align="left"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Modula-2" border="0" alt="Modula-2" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/04/modula2.png" width="448" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/04/working-in-modula-2/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Imaging in Mac OS X</title>
		<link>http://galfar.vevb.net/wp/2009/02/imaging-in-mac-os-x/</link>
		<comments>http://galfar.vevb.net/wp/2009/02/imaging-in-mac-os-x/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 13:11:00 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/2009/02/imaging-in-mac-os-x/</guid>
		<description><![CDATA[I wasn’t sure if Vampyre Imaging Library works right in Mac OS X until few weeks ago. One poster in Imaging’s forum wrote a post about scrambled images produced by the library on Mac OS X. Fortunately, the problem was related only to Lazarus LCL support – all other functionality worked fine.
After not so straightforward [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn’t sure if <strong>Vampyre Imaging Library</strong> works right in <strong>Mac OS X</strong> until few weeks ago. One poster in Imaging’s forum wrote a <a href="http://galfar.vevb.net/imaging/smf/index.php/topic,91.0.html">post</a> about scrambled images produced by the library on Mac OS X. Fortunately, the problem was related only to Lazarus LCL support – all other functionality worked fine.</p>
<p>After not so straightforward installation of Mac OS X in VMWare I fixed the issue just by changing number “24” to “32” in the code (TRawImage.Description.Depth field, LCL raw image to TBitmap conversion). Apparently, Carbon created bitmap with 6 bits per color channel. Now I just need to check if 24-&gt;32 change doesn’t break anything when using other LCL widget sets (I’m sure there was a reason for 24bits since I vaguely remember 32bits were there few years ago) – so maybe conditional compilation will be needed here.</p>
<p>Another issue I noticed is that <strong>LCL Imager</strong> demo couldn’t load default image (Tigers.jpg) that is displayed when it is started without parameters. Demo uses relative path to the image but (from Demos/Bin to Demos/Data directory). Mac OS X application LCLImager.app is placed in Demos/Bin directory by Lazarus but it is not a simple single file. It’s a directory itself and actual demo executable is located somewhere inside. I’ve not really decided on solution yet. Maybe embed the image in the executable as resource?</p>
<p style="text-align: center;"><a href="http://galfar.vevb.net/wp/wp-content/uploads/2009/02/tigers-1-and-tigers-2.jpg" rel="lightbox[226]"><img class="size-medium wp-image-236 aligncenter" title="Tigers1 and Tigers2, see the difference?" src="http://galfar.vevb.net/wp/wp-content/uploads/2009/02/tigers-1-and-tigers-2-512x188.jpg" alt="See the difference?" width="512" height="188" /></a></p>
<p style="text-align: center;">See the difference?</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/02/imaging-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imaging 0.26.2 released!</title>
		<link>http://galfar.vevb.net/wp/2009/01/imaging-0262-released/</link>
		<comments>http://galfar.vevb.net/wp/2009/01/imaging-0262-released/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 02:14:47 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/wp/?p=134</guid>
		<description><![CDATA[My Vampyre Imaging Library was updated to version 0.26.2 few days ago. This was mostly fix/patch/update release with no significant new features.
I decided to remove Kylix support (CLX graphic classes, project files, build scripts, core library still compiles). It&#8217;s not working properly on many (all?) current Linux distros (so I can&#8217;t test) and it was [...]]]></description>
			<content:encoded><![CDATA[<p>My <strong>Vampyre Imaging Library</strong> was updated to version 0.26.2 few days ago. This was mostly fix/patch/update release with no significant new features.</p>
<p>I decided to remove Kylix support (CLX graphic classes, project files, build scripts, core library still compiles). It&#8217;s not working properly on many (all?) current Linux distros (so I can&#8217;t test) and it was abandoned by Borland/Codegear quite some time ago. It was nice to have DCC compiler in Linux and it also made Borland to make Delphi RTL crossplatform. There are rumors about crosscompiling features in upcoming Delphi releases (in 2010?)&#160; so maybe we&#8217;ll see DCC in Linux again.</p>
<p>Instead of Kylix project files there are new ones for Delphi 2009. Imaging itself didn&#8217;t require many fixes to compile and work with Delphi 2009,&#160; most of them were related to text-based file format loaders (XMP, PNM) and external libraries (JpegLib, ZLib).</p>
<p>More info and downloads at <a href="http://imaginglib.sourceforge.net">Imaging&#8217;s homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2009/01/imaging-0262-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some News</title>
		<link>http://galfar.vevb.net/wp/2008/09/some-news/</link>
		<comments>http://galfar.vevb.net/wp/2008/09/some-news/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 11:21:48 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/26-guid.html</guid>
		<description><![CDATA[Vampyre Imaging Library 0.26.0 was finally released few days ago. There are many canvas enhancements and support for 3Dc compressed formats. More info and downloads at project&#8217;s homepage: http://imaginglib.sourceforge.net.
I&#8217;m planning revamping this whole site. Maybe creating some sort of simple CMS myself or just some better way to handle the projects. I don&#8217;t enjoy coding [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Vampyre Imaging Library 0.26.0</strong> was finally released few days ago. There are many canvas enhancements and support for 3Dc compressed formats. More info and downloads at project&#8217;s homepage: <a href="http://imaginglib.sourceforge.net">http://imaginglib.sourceforge.net</a>.</p>
<p>I&#8217;m planning revamping this whole site. Maybe creating some sort of simple CMS myself or just some better way to handle the projects. I don&#8217;t enjoy coding in PHP but there&#8217;s not much choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2008/09/some-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imaging 0.24.2 Released</title>
		<link>http://galfar.vevb.net/wp/2007/12/imaging-0242-released/</link>
		<comments>http://galfar.vevb.net/wp/2007/12/imaging-0242-released/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 12:13:19 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/25-guid.html</guid>
		<description><![CDATA[New version of my Imaging library was released today. Check out the project homepage: http://imaginglib.sf.net
]]></description>
			<content:encoded><![CDATA[<p>New version of my Imaging library was released today. Check out the project homepage: <a href="http://imaginglib.sf.net">http://imaginglib.sf.net</a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/12/imaging-0242-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Update</title>
		<link>http://galfar.vevb.net/wp/2007/11/an-update/</link>
		<comments>http://galfar.vevb.net/wp/2007/11/an-update/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 11:49:26 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[General News]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/24-guid.html</guid>
		<description><![CDATA[There has been no news for quite some time. This will change! Or maybe not.
Imaging 0.24.2 patch will hopefully be released soon (waiting for Lazarus 0.9.24 since there is LCL change that breaks Imaging&#8217;s LCL support for older Lazaruses). More about new Imaging can be found at its homepage. I also plan to release OpenJPEG [...]]]></description>
			<content:encoded><![CDATA[<p>There has been no news for quite some time. This will change! Or maybe not.</p>
<p>Imaging 0.24.2 patch will hopefully be released soon (waiting for Lazarus 0.9.24 since there is LCL change that breaks Imaging&#8217;s LCL support for older Lazaruses). More about new Imaging can be found at its <a href="http://imaginglib.sf.net">homepage</a>. I also plan to release OpenJPEG (JPEG 2000 library) for Pascal independent on Imaging for those who just want JPEG 2000 for their programs.</p>
<p>I will (have to) start working on my Master&#8217;s thesis in very near future so you may expect some demos soon (terrain rendering stuff again).</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/11/an-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imaging 0.24.0 Released!</title>
		<link>http://galfar.vevb.net/wp/2007/06/imaging-0240-released/</link>
		<comments>http://galfar.vevb.net/wp/2007/06/imaging-0240-released/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 13:41:33 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Vampyre Imaging Library]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/23-guid.html</guid>
		<description><![CDATA[Version 0.24.0 of Imaging has been released!    Main news/changes in 0.24.0:

New image file format support: GIF (native), TIFF (libtiff), PSD (native). 
New image data format: BTC (block truncation coding). 
File format compatibility fixes (for BMP, JPEG, and DDS)     and platform/compiler support fixes (Win64, UNIX, FPC, &#8230;). 
Bug fixes [...]]]></description>
			<content:encoded><![CDATA[<p>Version <strong>0.24.0</strong> of <strong>Imaging</strong> has been released!    <br />Main news/changes in 0.24.0:</p>
<ul>
<li>New image file format support: <strong>GIF</strong> (native), <strong>TIFF</strong> (libtiff), <strong>PSD</strong> (native). </li>
<li>New image data format: <strong>BTC</strong> (block truncation coding). </li>
<li>File format compatibility fixes (for BMP, JPEG, and DDS)     <br />and platform/compiler support fixes (<strong>Win64</strong>, UNIX, FPC, &#8230;). </li>
<li>Bug fixes and some enhancements (buffered file IO, &#8230;). </li>
</ul>
<p>Visit <a href="http://imaginglib.sourceforge.net">Vampyre Imaging Library Homepage</a> for more news and downloads or <a href="http://galfar.vevb.net/imaging/smf">Imaging Forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/06/imaging-0240-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Earth Under Fire Slighty Updated</title>
		<link>http://galfar.vevb.net/wp/2007/06/earth-under-fire-slighty-updated/</link>
		<comments>http://galfar.vevb.net/wp/2007/06/earth-under-fire-slighty-updated/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 16:56:56 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Earth Under Fire]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/22-guid.html</guid>
		<description><![CDATA[There is a new beta of Earth Under Fire. Several bugs were fixed, libraries used by the game were updated to current versions, and the game now supports multisample antialiasing.
Find more at Earth Under Fire page.
]]></description>
			<content:encoded><![CDATA[<p>There is a new beta of Earth Under Fire. Several bugs were fixed, libraries used by the game were updated to current versions, and the game now supports multisample antialiasing.</p>
<p>Find more at <a href="http://galfar.vevb.net/euf">Earth Under Fire page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/06/earth-under-fire-slighty-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chaos Unleashed</title>
		<link>http://galfar.vevb.net/wp/2007/06/chaos-unleashed/</link>
		<comments>http://galfar.vevb.net/wp/2007/06/chaos-unleashed/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 12:05:59 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Chaos]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/21-guid.html</guid>
		<description><![CDATA[I&#8217;ve just created a new page in Projects section about my entry for PGD 2007 Compo named Domains Of Chaos.
Check it out here:
Domains Of Chaos Page

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just created a new page in <strong>Projects</strong> section about my entry for <a href="http://pascalgamedevelopment.com">PGD 2007 Compo</a> named <strong>Domains Of Chaos</strong>.</p>
<p>Check it out here:<br />
<a href="http://galfar.vevb.net/chaos">Domains Of Chaos Page</a></p>
<p><a href="http://galfar.vevb.net/wp/wp-content/uploads/2007/06/chaos01.png" rel="lightbox[82]"><img class="aligncenter size-thumbnail wp-image-116" title="Domains of Chaos" src="http://galfar.vevb.net/wp/wp-content/uploads/2007/06/chaos01-256x192.png" alt="Domains of Chaos" width="256" height="192" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/06/chaos-unleashed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UFO: Extraterrestrials Released</title>
		<link>http://galfar.vevb.net/wp/2007/05/ufo-extraterrestrials-released/</link>
		<comments>http://galfar.vevb.net/wp/2007/05/ufo-extraterrestrials-released/#comments</comments>
		<pubDate>Tue, 08 May 2007 00:08:10 +0000</pubDate>
		<dc:creator>Marek Mauder</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://galfar.vevb.net/cms/archives/18-guid.html</guid>
		<description><![CDATA[The game I have been working on for Chaos Concept was finally released. If you liked old XCOM games you may like this one as well. It has geoscape mode with base building, research, UFO interceptions, etc. and turn based tactical missions just like in XCOM.
UFO: Extraterrestrials homepage:   http://www.ufo-extraterrestrials.com.    UFO [...]]]></description>
			<content:encoded><![CDATA[<p>The game I have been working on for Chaos Concept was finally released. If you liked old XCOM games you may like this one as well. It has geoscape mode with base building, research, UFO interceptions, etc. and turn based tactical missions just like in XCOM.</p>
<p>UFO: Extraterrestrials homepage:   <br /><a href="http://www.ufo-extraterrestrials.com/">http://www.ufo-extraterrestrials.com</a>.    <br />UFO at Gamers Gate (digital download for EU and rest of the globe except North America): <a href="http://www.gamersgate.com/index.php?page=product&amp;what=view&amp;sku=DD-UFOET">Gamers Gate UFO page</a>.    <br />UFO at Matrix Games (digital download for North America): <a href="http://matrixgames.com/games/game.asp?gid=342">Matrix Games UFO page</a>.</p>
<p>Boxed version will be available in few weeks.   <br />Now working on first patch&#8230;    <br /><a href="http://galfar.vevb.net/wp/wp-content/uploads/2007/05/ufoet-3dbox-170x220.gif" rel="lightbox[81]"><img class="aligncenter size-full wp-image-114" title="UFO: ET" height="220" alt="UFO: ET" src="http://galfar.vevb.net/wp/wp-content/uploads/2007/05/ufoet-3dbox-170x220.gif" width="170" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://galfar.vevb.net/wp/2007/05/ufo-extraterrestrials-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
