- byte *saveskin;
- saveskin = Hunk_AllocName(width*height, va("%s skin", loadname));
- memcpy((saveskin, byte *)pskintype, width*height);
- temp = (int) saveskin - (int) mheader;
- skintexnum[0] = skin_normal ? -temp : 0;
- skintexnum[1] = skin_pants ? -temp : 0;
- skintexnum[2] = skin_shirt ? -temp : 0;
- skintexnum[3] = GL_SkinSplit((byte *)pskintype, skintemp, width, height, 0xC000, va("%s_glow", basename)); // glow
- skintexnum[4] = GL_SkinSplit((byte *)pskintype, skintemp, width, height, 0x3FFF, va("%s_body", basename)); // body (normal + pants + shirt, but not glow)
- }
- else
- {
- skintexnum[0] = 0;
- skintexnum[1] = 0;
- skintexnum[2] = 0;
- skintexnum[3] = GL_SkinSplit((byte *)pskintype, skintemp, width, height, 0xC000, va("%s_glow", basename)); // glow
- skintexnum[4] = GL_SkinSplit((byte *)pskintype, skintemp, width, height, 0x3FFF, va("%s_body", basename)); // body (normal + pants + shirt, but not glow)
- }
- }
-#else
- skintexnum[0] = loadtextureimage(va("%s_normal", basename), 0, 0, false, true);
- skintexnum[1] = 0;
- skintexnum[2] = 0;
- skintexnum[3] = loadtextureimage(va("%s_glow" , basename), 0, 0, false, true);
- skintexnum[4] = 0;
- if (skintexnum[0])
- {
- skintexnum[1] = loadtextureimage(va("%s_pants" , basename), 0, 0, false, true);
- skintexnum[2] = loadtextureimage(va("%s_shirt" , basename), 0, 0, false, true);
- }
- else
- {
- skintexnum[0] = loadtextureimage(basename, 0, 0, false, true);
- if (!skintexnum[0])
- {
- skintexnum[0] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FBD, va("&%s_normal", basename)); // normal (no special colors)
- skintexnum[1] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0040, va("&%s_pants", basename)); // pants
- skintexnum[2] = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0002, va("&%s_shirt", basename)); // shirt
- skintexnum[3] = GL_SkinSplit(skindata, skintemp, width, height, 0xC000, va("%s_glow", basename)); // glow
- skintexnum[4] = GL_SkinSplit(skindata, skintemp, width, height, 0x3FFF, va("%s_body", basename)); // body (normal + pants + shirt, but not glow)
+ skinframe->pants = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0040, va("%s_pants", basename), false); // pants
+ skinframe->shirt = GL_SkinSplitShirt(skindata, skintemp, width, height, 0x0002, va("%s_shirt", basename), false); // shirt
+ skinframe->glow = GL_SkinSplit (skindata, skintemp, width, height, 0xC000, va("%s_glow", basename), precache); // glow
+ if (skinframe->pants || skinframe->shirt)
+ {
+ skinframe->base = GL_SkinSplit (skindata, skintemp, width, height, 0x3FBD, va("%s_normal", basename), false); // normal (no special colors)
+ skinframe->merged = GL_SkinSplit (skindata, skintemp, width, height, 0x3FFF, va("%s_body", basename), precache); // body (normal + pants + shirt, but not glow)
+ }
+ else
+ skinframe->base = GL_SkinSplit (skindata, skintemp, width, height, 0x3FFF, va("%s_base", basename), precache); // no special colors
+ // quake model skins don't have alpha
+ skinframe->fog = NULL;