BTW, how do we do fonts? Do we lay out a sort of grid featuring all the glyphs, load it into VRAM, and the emulator will pick out the correct letters based on coordinates?
Almost. At the moment, the fonts are actually converted TrueType fonts. I have a generator program that generates a texture font from a TrueType font. It doesn't necessarily lay the glyphs out in a grid though - it packs them together quite tightly and tries to make the smallest sized texture. It also stores a load more information, so it can correctly do variable width fonts, for example. The generator is pretty dumb though - it draws antialiased fonts directly from the TTF, without modification, and that's all it can do.
If you wanted to do something like the font you have in the mockups (which looks pretty good, so that'd probably be a good idea), I'd have to write a program to generate a font from bitmaps (or more likely, from 32-bit PNG images) and a description of the font metrics (position of each glyph relative to origin, glyph width, line spacing - the rest I can work out from there). I need to write one of those anyway, because the same font format is being used for another project.
Hm - you mean we have screen shots on the disc, which the emulator then uses to create a back cover template? Wouldn't it be a better idea to provide extra downloadable packs featuring collections of premade Front and Back covers (with all of the screenshots and box stuff in one image), and also provide a template of some sorts so users could make their own? That has the benefit of allowing the original box art to be used too.
The idea is that it uses any information you've got to try to construct a box cover. If you have the original cover, it will simply use that with no modifications. If you don't have a back / side cover, it'll use a generic one based on the templates. It'll stick the game's logo on the side of the box, but if you don't have one it'll just write the name of the game on there. It'll put some screenshots on the back of the box, and maybe some text, and some icons for things like supported peripherals. If you don't have any screenshots, it'll just use a completely generic back cover.
Same goes for the front cover. If you don't have one, it'll attempt to reconstruct one. If you have an image of the game's logo, it'll put that on the front. Otherwise, it'll just write the name of the game in a normal font. If you have some images, it'll use one of those for the main box art. If you don't, it'll try to use the title screen. If you don't have that, it'll just use some generic artwork.
Here's the current test app. It's only displays full box scans at the moment (I'm still working out how to do the compositor), but it works quite well. Real box scans seem to look a little nicer than the templates, for some reason. Might just be that I did a lousy job of resizing them.
http://files.frashii.com/~sp00nz/Doom/f ... oxtest.zip
You have to run it from a command prompt. Pull up a command prompt, CD to the directory where you unzipped it, and type this:
It works with PNGs and JPEGs (and probably anything supported by SDL_image, but those work fine), and it automatically resizes the texture to a valid size by padding it. Any size image should theoretically work, and it'll be stretched to the correct aspect ratio. Just make sure it's like the included samples - the cover fills the entire image.
One thing I'm not sure of though. Currently, the box isn't square. I drew the front, back, and left hand side as a standard box using the box art texture. The right hand side is slightly indented (approximately 0.5cm, relative to the rest of the box), and isn't flat either. It's a sort of an indented triangle shape, something like:
Code: Select all
Anyway, it's a bit hard to notice, but it seems to work alright. It'd be better if I had a better texture to put on it (see end.png). The one I drew is just a couple of gradients, and looks terrible.
The lighting is also a bit of a lousy hack. I could have used full OpenGL lighting, but I didn't - I just did it the same way I'd probably do it on the DC. The light is coming slightly from the left, and there's a little bit of ambient light (not much, but enough that the box never goes completely black). It does use correct calculations, so it's an entirely correct lousy hack, and it should be more than adequate.