Hey Hey 16k
I had nearly forgotten about this song and video, only just got reminded about it when I started to hum it to myself.
16k for a letter, that is 64x64 for a 4 component texture. Given that they are usually luminance alpha, I reckon its more likely to be 64x128, given a font texture of 1024x2048.
That is one high resolution font pack. Clive Sinclair would be rolling in his grave...
Just completed Red Faction: Guerilla on Saturday. I'm quite disappointed by the guerilla part of it (its worse than accidentally picking someone up in Prototype), however the destruction is fun :).
C# – Mono on Mac OS X
I'm always up for trying new ways of not having to boot up VMWare Fusion, and when searching for C# code, I came by a blog about something using Mono. Mono is a cross platform solution for using .NET and it is open source, which means I can write, compile and execute C# in MacOSX.
I found its strangely easy to setup, though I have yet to get WinForms to work from the examples, I have got console apps working. And with the console app, I have been able to use XPath.
The only downside was it took an hour to download from their website, which is quite bad for only 50MB.
C# – XPath and Converting a Relative Path to Absolute
Today whilst doing some C# programming, I came by a path within a file that was relative to the path I was reading it from. Since my application wasn't in the same place, and I didn't want it to be be for it to be, I needed to convert it to an absolute path.
This is C#, it should be simple right?
Well apparently System.IO.Path.Combine() doesn't take into account "./" or "../" and just concatenates and added an additional forward slash if needed.
After a bit of searching, and many different examples (most of which just converted absolute to relative), I found what I needed. This method used System.IO.Path.GetFullPath() with System.IO.Path.Combine() (If I used the relative path on its own with GetFullPath() I just got the relative path from the current executable directory).
I made it into a single function I can call but I was surprised that there wasn't something already to do this considering what C# has impressed me with so far for thinking ahead.
//
//
using System.IO;
//
//
static string GetAbsoluteFromRelative( string inBasePath, string inRelativePath )
{
return Path.GetFullPath( Path.Combine( inBasePath, inRelativePath ) );
}
It hasn't tainted my image of C# though, I still adore it for its XML XPath node iterator library thing that has MySQL searching features.
I also found a spiffy thing I didn't know about XPath as well. If I have a set of data like so.
<FileList>
<Folder>
<File>MyFile</File>
</Folder>
<File>MyOtherFile</File>
</FileList>
I can iterate through all file nodes within file list with a double-slash before "File" within my node select call.
XPathNavigator nav;
// ...
XPathNodeIterator fileNodes = nav.Select("/FileList//File");
while( fileNodes.MoveNext() )
{
Console.WriteLine( fileNodes.Current.Value );
}
I still seem to have problems with namespaces in some XML documents though (ones without them seem to make searching a hassle).
Athena: Wiimote and Mac OS X
Since solving the problem of the rumbling on the XBox 360 pad, I've grown bored of it, and decided to branch out trying to get more controllers working in my engine.
So a few days ago I started with the Wiimote, I had planned to try to the PS3 controller but I didn't have one, so borrowing one of my housemates Wiimotes I set to work.
There is quite a lot of documentation on the Wiimote at the moment, whether it is the correct way to do things is questionable, since there are cases like "1? - it is set to 1 by the Wii" and "set this to 0x55 at memory address X and set to 0x00 at memory address Y to enable it".
I started with website called The Wiimote Project, but as their documentation grew scarce I found a better site (which it seemed to copy it all from anyways) called WiiBrew. The WiiBrew wiki is quite comprehensive and within a few minutes I already had the LEDs flashing.
I won't go into a lot of detail, I'll just show the basics that I've got to grips with from the documentation on WiiBrew - LEDs + Motor, Buttons, and Battery.
Connecting the Wiimote
Connecting the Wiimote to a Mac is far simpler than it is for XBox 360, for a start its a Bluetooth device that operates using the normal protocols and it doesn't require a key to activate. To connect, first turn on Bluetooth on your Mac, and then select "Set up Bluetooth Device...".
Follow on the onscreen instructions, and when it gets to the point where it is searching for nearby Bluetooth devices, press 1 + 2 to soft synchronize if the Wiimote isn't bound to another device, or the sync button to hard synchronize (unbinds the Wiimote from anything it remembers).
When it appears, select it and click the "Passkey Options..." button. Select the "Do not use a passkey with this device" option and then OK. Continue on and the device will be setup and connected. You can't actually tell since the LEDs are still blinking, but if you have done it correctly, the Bluetooth icon should be different, or the menu will have a disconnect option for the device just setup.







