#1 2022-11-18 18:29:26

megademon
Member

What's the anatomy of the .mip file?

I'm writing an image converter in C# and I need some documentation on Quake's .mip images.

#2 2022-11-18 23:03:05

Spirit
Administrator

Re: What's the anatomy of the .mip file?

Maybe there is info on https://www.gamers.org/dEngine/quake/ ?
https://quakewiki.org/wiki/.mip is sadly missing any content so far.
http://openarena.ws/board/index.php?topic=1710.0 has source code in the zip that has mip code.

#3 2022-11-19 04:05:42

megademon
Member

Re: What's the anatomy of the .mip file?

Thanks. This changes everything. I planned to do .png to .mip first because that always bugged me. Add more formats as I go along. Then much later look into .wad and .bmp and maybe make it like Slade in a way. Add color translation because I think that is really neat.

#4 2022-12-02 17:39:06

Spoike
Guest

Re: What's the anatomy of the .mip file?

there is no .mip file format, only bsp/wad chunks.

qpic:
uint32 width, height;
byte imagedata[width*height];

miptex:
char name[16]; /*dupe of the wad's name,  hopefully*/
uint32 width, height;
uint32 offset[4]=
{ /*hacks assume this, so expect breakages if you vary from this*/
  40,
  40+width*height,
  40+width*height+width/2*height/2,
  40+width*height+width/2*height/2+width/4*height/4
};
byte mip0[width*height];
byte mip1[width/2*height/2];
byte mip2[width/4*height/4];
byte mip3[width/8*height/8];

all pixel data are 8bit indexes into the single palette.
note that conchars, palette, colormap, and pop.lmp lumps/files are headerless and thus neither qpics nor miptex lumps, even if the wad file implies otherwise.

Quick reply

Write your message and submit
Are you human or robot? If you have trouble, mail to spirit åt quaddicted døt c

Checking if this is requested by a real person and not an automated program.

Board footer