Tuesday, February 26, 2008

SVN r36/37: Settings

I added Settings, a singleton class that stores key/value pairs on a global basis. So far, I've added std::string and std::wstring values. Keys are always std::strings (or std::wstrings, thanks to the magic of overloading.)

I'm sorely disappointed in the STL. There's no standard way to tokenize std::strings! My meager improvisation is lacking, I'm sure, but it gets the job done. Console now has a slight idea of how to get and set values for keys.

TODO: Give Console some global functions, and also a nice 15pt monospace font.

~ C.

Sunday, February 24, 2008

SVN r35: The Runtime Directory

I've created a "runtime directory." What is a "runtime directory," you might ask? Good question. A runtime directory is a directory containing a relative directory structure which supplements a program. In our case, we need, at a minimum, the media/ folder to be present in our runtime directory.

Up until now, I've not worried about this concept; I've just let the scripts handle it automagically. However, when Derrick tried to run the Kdevelop project, it silently died, leaving cryptic comments in the logs. We eventually figured out that the problem was that media/ wasn't being found correctly due to a missing symlink. Well, symlinks are an ugly hack for getting a relative path right, so I decided to make a compile-time runtime directory.

This is harder than it sounds. I've altered the autoconf to guess `pwd` for the runtime dir, or to take it on the command line with "--with-runtime-dir":
./configure --with-runtime-dir=/home/simpson/os
Works excellently.

Now, of course, the story doesn't end there. Autoconf turns this setting into a command-line define (-DRUNTIME_DIR=\"/home/simpson/os\"), and then we have, in opensmash.cpp, a few lines that set up the working directory and path. Cool, right? Right?

Right?

TODO: Dunno, good question. Sleep?
~ C.

SVN r34: New libtool

So, Gentoo finally bumped the libtool version they ship with, so I updated the libtool config macro version in OpenSmash. I know that they shouldn't be in there, but Makefile.cvs bitches at me if I don't ship 'em, so whatever.

I also refactored to since there's no reliable way in autoconf to know whether or not /usr/include/irrlicht is being included, and after all headers might live in /usr/local/include/irrlicht, which autoconf can't detect and the maintainer would have to figure out case-by-case. (Guess who the autoconf maintainer is.) Anyway, Irrlicht itself is alright with this, so that's my story and I'm sticking to it.

Also, I cleaned joystickmanager.cpp. Whoever coated it with ^Ms, I'm pissed at you for doing it but proud that you worked on a Linux game from a Windows environment. Stickin' it to the man, indeed. (The sarcasm doth drip from mine lips.)

Bigger post to come in a few on r35.
~ C.

Thursday, February 21, 2008

SVN r32/r33: More Console

More Console flesh has been put in with these two reverts. I'm lumping them because r33 fixes a few files I forgot to add in r32.

The Console now is integrated into the menu and correctly renders pretty much everything. I'm going to upload a monospace 16pt font for it in a bit, along with some more plumbing code. There's not much else to say at this point.

~ C.

Tuesday, February 19, 2008

SVN r31: Goodbye, AL_EXT_vorbis

Okay. First, a little background. For our sound backend, we're using OpenAL, which is a threaded, cross-platform, cross-driver sound system with optional hardware acceleration and support for 3D effects. Pretty cool, huh?

OpenAL has an extension system similar to OpenGL, and one extension popular in Linux games is AL_EXT_vorbis, which adds Vorbis stream support to OpenAL. The mechanism is through a callback system which essentially takes care of decoding Vorbis streams for us.

Now, up until now, I've detected AL_EXT_vorbis, and I've been debating whether or not to use it. However, after digging into the code originally provided by Loki Games which implements AL_EXT_vorbis, and looking at the parts of Sound Manager which I retooled way back in r17, I decided that the space and time gains from using AL_EXT_vorbis were simply not worth it, so I removed the detection code.

Also, Sound Manager now exclusively uses the LOG_*() macros. While we're not grepping through the code to put them in, they should be fixed whenever possible, because between this:
StateManager::getSingleton()->getDevice()->getVideoDriver()->getLogger(str, irr::ELL_INFORMATION);
And this:
LOG_INFO(str);

Which would you rather have to read?

TODO: Wire up alutInit() to take argc and argv on Linux, without screwing up Win32 WinMain().

~ C.

SVN r30: Console

Hi, people. We're moving OpenSmash discussion to this blog so that all three of us can write about stuff.

So, this revision brings in the Console. As you might imagine, this is a Quake-style console that pulls down with a backtick/tilde key, and allows you to type commands into a debugging environment. This commit mostly just lays down the foundations, and shows an example implementation in the Menus.

Derrick is to blame/praise for this, as it was his idea.

TODO: Make console transparent. Make console respond to text. Make console stateful. Make console work. Make console pretty.

~ C.