Text Formats Are Just Easier

Something I learned long ago is that text formats are just plain easier to work with. As a result, everything in ToeTag travels around as much as possible as chunks of text. It’s easy to decode and it’s easy to debug. Not sure what’s on the clipboard? Paste it into a text editor and look at it. Couldn’t be simpler!

I just added cut/copy/paste to WADEd today and, of course, it’s shuffling the textures around in text format. This is easier for Quake textures since a) they tend to be small and b) they use palettes. Palettes mean I can pass around palette indices (a byte) rather than full blown RGB values (3 integers). Sure you could do some fancy bit magic there and crush that RGB value into a single integer but it still wouldn’t easier to read than an index into a palette – so nyah!

As a quick demo, here’s a pic of a small texture selected in WADEd:

picture-12

And here’s how that same texture looks when I hit CMD+C to put it on the clipboard:

#TEXTURE#16 16 SLIPSIDE 1 1 1 97 97 98 98 98 98 98 98 97 97 1 1 1 1 96 99 100 101 102 102 102 102 102 102 101 100 99 96 1 1 98 100 249 250 251 251 251 251 251 251 250 249 100 98 1 1 97 99 248 249 250 251 251 251 251 250 249 248 99 97 1 1 1 97 98 100 101 102 102 102 102 101 100 98 97 1 1 1 1 96 96 97 98 98 99 99 98 98 97 96 96 1 1 1 1 97 98 99 100 101 101 101 101 100 99 98 97 1 1 1 97 99 248 249 250 251 251 251 251 250 249 248 99 97 1 1 97 99 248 249 249 250 251 251 250 249 249 248 99 97 1 1 1 97 98 99 100 101 101 101 101 100 99 98 97 1 1 1 1 96 96 96 97 97 98 98 97 97 96 96 96 1 1 1 1 97 97 98 98 98 99 99 99 98 98 97 97 1 1 1 96 98 76 248 248 248 249 249 248 248 248 76 98 96 1 1 96 97 76 76 76 248 248 248 248 76 76 76 97 96 1 1 1 97 97 97 98 98 98 98 98 98 97 97 97 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

See what I mean? If something wasn’t working properly, I’d be able to decipher this a lot quicker than I would any kind of binary format.

And now you can easily copy/paste textures around from WAD to WAD!

Leave a Reply