Sunday, March 18, 2007

Platform Specific Graphics Issues

Today I did a little more work on the grid. I thought the lines looked too thick before so I changed them to single pixel thickness lines and implemented them using the line drawing functions of the SDL_gfx library. Previously they had been drawn as filled rectangles.

I also realised today that I had a problem with colours. The red and blue components of my RGB colours were being reversed. So where I was trying to draw grid lines in a darkish blue colour, they were coming out as orange. I did some investigation to no avail so I logged it as a bug and put together a quick workaround.

At the end of my dev day, I checked in my changes, did an update on my linux box and checked the build. Its a good job I did as I found two problems. Firstly I'd hard coded backward slashes in a pathname - must always use forward slashes to be platform-independent. That was an easy fix. The second issue was that the display was completely screwed up. I show the two screenshots below.

Linux:

Windows:
Note that on Linix, you can just about make out that the colours are reversed. Hmmm, I got some weirdness going on, I'm not looking forward to fixing this bug! Oh well, no time to fix it now, I've logged a showstopper bug for another day.

No comments: