Say you've got a spritesheet containing 50 discrete images of varying sizes. Right now I create a companion text file for each sheet like this:
name1, x, y, w, h
name2, x, y, w, h
At the top of the game I turn that list into a name-keyed hash of rectangles. When sprites are born they dip into the hash (just once, they cache the rectangle) so the sprite knows which area of the sheet to use when it draws. So I have to hard-code certain sprites to use certain rectangle names. I kinda want the spritesheets to be user-definable later on, so I'm favoring some kind of external definition thing.
This works ok but feels a little "low-tech". Is there a time-tested way of doing this sort of thing, or is this pretty much it?