<?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>DevBlog &#187; Vista</title>
	<atom:link href="http://simonowen.com/blog/category/vista/feed/" rel="self" type="application/rss+xml" />
	<link>http://simonowen.com/blog</link>
	<description>stuff and nonsense</description>
	<lastBuildDate>Thu, 19 Jan 2012 17:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Vista icon update</title>
		<link>http://simonowen.com/blog/2006/12/17/vista-icon-update/</link>
		<comments>http://simonowen.com/blog/2006/12/17/vista-icon-update/#comments</comments>
		<pubDate>Sun, 17 Dec 2006 03:11:45 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[SimCoupe]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://blog.simonowen.com/2006/12/17/vista-icon-update/</guid>
		<description><![CDATA[Vista includes support for 32-bit colour icons up to 256&#215;256 pixels in size &#8211; something Mac OS X has enjoyed for a while. They&#8217;re designed for high-DPI displays so they look too big on normal 96 dpi displays, but they do scale well to give quality smaller icons for normal use. The Mac version of [...]]]></description>
			<content:encoded><![CDATA[<p>Vista includes support for 32-bit colour icons up to 256&#215;256 pixels in size &#8211; something Mac OS X has enjoyed for a while.  They&#8217;re designed for high-DPI displays so they look too big on normal 96 dpi displays, but they do scale well to give quality smaller icons for normal use.</p>
<p>The Mac version of SimCoupe started with the 48&#215;48 Windows XP icon scaled up to 256&#215;256, which looked very out of place along side the 3D icons used by other applications.  I wanted a decent new icon for the SimCoupe 1.0 release but didn&#8217;t have the artistic talent to draw my own.  Rendering a 3D version seemed the way to go, so I downloaded the free <a href="http://www.blender.org/">Blender</a> package and got started.</p>
<p>Creating the basic robot shape wasn&#8217;t too difficult, with simple hemispheres for the head, body and feet.  The eyes and aerial were bezier curves pulled into shape and then filled.  I was lucky enough to find a hand model in an animation tutorial, which saved me a lot of work creating my own.</p>
<p>The neck, arms and legs were created using the <a href="http://www.blender.org/documentation/htmlI/x3040.html">screw</a> tool.  However, the arm segments were straight and needed to hang out from the body and round to the hands.  Getting them to curve took weeks of experimentation, but was eventually solved using armatures.  Inserting bones into the arms meant I could bend them to the shape I wanted in pose mode, with inverse kinematics (IK) doing all the work.  It&#8217;s not perfect, with a few kinks visible if you look closely, but it&#8217;s good enough!</p>
<p>To ensure the robot was symmetrical I built only the left half, with the right half created by cloning and mirroring it.  The images below show the left half as wireframe and filled, and the completed robot in wireframe mode. (click for full size):</p>
<p><a class="imagelink" href="http://174.120.254.194/~simon/blog/wp-content/uploads/2006/12/vista_mirroricon2.png" title="Half Robot Wireframe"><img id="image19" src="http://blog.simonowen.com/wp-content/uploads/2006/12/vista_mirroricon2.thumbnail.png" alt="Half Robot Wireframe" /></a> <a class="imagelink" href="http://174.120.254.194/~simon/blog/wp-content/uploads/2006/12/vista_mirroricon.png" title="Half Robot Solid"><img id="image20" src="http://blog.simonowen.com/wp-content/uploads/2006/12/vista_mirroricon.thumbnail.png" alt="Half Robot Solid" /></a> <a class="imagelink" href="http://174.120.254.194/~simon/blog/wp-content/uploads/2006/12/sam_wireframe.png" title="Wireframe Robot"><img id="image22" src="http://blog.simonowen.com/wp-content/uploads/2006/12/sam_wireframe.thumbnail.png" alt="Wireframe Robot" /></a></p>
<p>The final step was lighting, and I found another tutorial to help with that.  I used standard positions to evenly light the scene, knowing they could easily be changed later to fit any user interface guidelines for icon lighting.  The render took only a couple of seconds, and was saved out as a PNG image, preserving transparency where needed.  </p>
<p>Here&#8217;s the final 256&#215;256 image:</p>
<p><img id="image21" src="http://174.120.254.194/~simon/blog/wp-content/uploads/2006/12/sam_256x256.png" alt="256x256 Render" /></p>
<p>At this point I created the Mac icon, importing directly from the PNG render to create the .icns file.  For the Vista version I needed to merge the new icon into the existing SimCoupe icon file, so the OS could choose which one to use.  XP wouldn&#8217;t recognise the new format and fall back to using the original smaller versions, which was perfect.</p>
<p>Rather surprisingly Vista uses the PNG format to store the new icon images in the file, and for a 256&#215;256 32-bit image that meant a huge space saving compared to the old format.  This downside was that none of the existing tools would recognise the new icon format, and that included the resource compiler used to build the SimCoupe executable! A 3rd party tool (<a href="http://www.rw-designer.com/compile-vista-icon">ReplaceVistaIcon</a>) came to the rescue, allowing the new icon to be injected into the executable after the build.</p>
<p>Here&#8217;s how the new icon compares to the original 48&#215;48 XP icon, using Vista&#8217;s large-icon view (click for full size):</p>
<p><a class="imagelink" href="http://174.120.254.194/~simon/blog/wp-content/uploads/2006/12/vista_largeicon.png" title="SimCoupe Vista Icon"><img id="image16" src="http://blog.simonowen.com/wp-content/uploads/2006/12/vista_largeicon.thumbnail.png" alt="SimCoupe Vista Icon" /></a></p>
<p>Vista doesn&#8217;t use the new icon for everything though, falling back on the old icon in some situations (including the task list).  Hopefully that&#8217;s something I can improve as I learn more.</p>
]]></content:encoded>
			<wfw:commentRss>http://simonowen.com/blog/2006/12/17/vista-icon-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vista tweaks</title>
		<link>http://simonowen.com/blog/2006/12/16/vista-tweaks/</link>
		<comments>http://simonowen.com/blog/2006/12/16/vista-tweaks/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 00:12:53 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[SimCoupe]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.simonowen.com/2006/12/16/vista-tweaks/</guid>
		<description><![CDATA[I&#8217;ve had my eye on Vista since the beta versions were released earlier this year. So far only the SimCoupe 1.0 release in July has included Vista-specific changes. These were: Avoiding touching the primary display surface SimCoupe uses a video overlay surface for the SAM display by default, which gives the best performance on old [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my eye on Vista since the beta versions were released earlier this year.  So far only the SimCoupe 1.0 release in July has included Vista-specific changes.  These were:</p>
<ol>
<li><strong>Avoiding touching the primary display surface</strong>
<p>SimCoupe uses a video overlay surface for the SAM display by default, which gives the best performance on old video cards.  For this I must determine a colour-key value where overlay pixels should show through to the display, like green-screen special effects used on TV.  This meant locking the primary surface to peek a pixel value, and that&#8217;s something Vista wasn&#8217;t happy with me doing.</p>
<p>In previous versions of Windows the primary display surface was what you saw on your screen, and where most objects were drawn directly.  Vista&#8217;s Aero interface uses off-screen compositing for its fancy scaling and transparency effects.  The visible display is managed by the compositing engine and is off-limits to direct manipulation.  Any attempts to do so disables the Desktop Window Manager (DWM), returning the display to a compatibility mode.  As part of this it also rather unhelpfully reports: &#8220;<em>This program is not compatible with Windows</em>&#8220;!</p>
<p>Video card overlays don&#8217;t really fit into the new composite world anyway.  They <em>can</em> be scaled, but they can&#8217;t be rotated or skewed, and don&#8217;t support transparency.  The DWM can&#8217;t make any use of them, so there&#8217;s little point in us trying to use them &#8211; problem solved!</p>
<p>SimCoupe no longer attempts to create a video overlay on Vista, and to avoid any confusion I also grey the setting in the options used to toggle it on and off.</li>
<li><strong>Avoid querying the capabilities of the primary display surface</strong>
<p>This is related to the first issue, but shouldn&#8217;t have been a problem at all.  I found that simply querying the capabilities of the primary surface (using <em>GetSurfaceDesc()</em>) was enough to disable the DWM.</p>
<p>This was confirmed to be a Windows bug in beta 1, scheduled to be fixed in beta 2.  In the meantime I changed my code to work around it, using the required capabilities from the back surface instead.</li>
<li><strong>Double-checking the main window is the correct size</strong>
<p>The partial scanlines on the boot screen were showing a banding effect, which happens if the main window is resized to non-multiple of the natural display size.  Further investigation showed the main window size (as set using <em>AdjustWindowRect()</em>) was slightly too small.</p>
<p>This was yet another Windows bug, and not one I found documented anywhere!  The size calculations didn&#8217;t seem to be including all the extra window decoration and the larger Vista borders were throwing it out.  This just required a second size adjustment in SimCoupe if the first one was found to be wrong.  This problem affected other programs that required an exact display size, which was mainly other emulators.</li>
</ol>
<p>These changes were the bare minimum needed to run the program correctly under Vista.  True Vista support will require additional changes, almost all related to the tightened security model.  More about those in a future update.</p>
]]></content:encoded>
			<wfw:commentRss>http://simonowen.com/blog/2006/12/16/vista-tweaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: simonowen.com @ 2012-02-04 03:10:21 -->
