void R_InitSky(int map) { Sky1Texture = P_GetMapSky1Texture(map); Sky2Texture = P_GetMapSky2Texture(map); Sky1ScrollDelta = P_GetMapSky1ScrollDelta(map); Sky2ScrollDelta = P_GetMapSky2ScrollDelta(map); Sky1ColumnOffset = 0; Sky2ColumnOffset = 0; DoubleSky = P_GetMapDoubleSky(map); }
// // Sky code // void P_InitSky(int map) { Sky1Texture = P_GetMapSky1Texture(map); Sky2Texture = P_GetMapSky2Texture(map); Sky1ScrollDelta = P_GetMapSky1ScrollDelta(map); Sky2ScrollDelta = P_GetMapSky2ScrollDelta(map); Sky1ColumnOffset = 0; Sky2ColumnOffset = 0; DoubleSky = P_GetMapDoubleSky(map); // First disable all sky layers. Rend_SkyParams(DD_SKY, DD_DISABLE, 0); // Sky2 is layer zero and Sky1 is layer one. Rend_SkyParams(0, DD_OFFSET, 0); Rend_SkyParams(1, DD_OFFSET, 0); if(DoubleSky) { Rend_SkyParams(0, DD_ENABLE, 0); Rend_SkyParams(0, DD_MASK, DD_NO); Rend_SkyParams(0, DD_TEXTURE, Sky2Texture); Rend_SkyParams(1, DD_ENABLE, 0); Rend_SkyParams(1, DD_MASK, DD_YES); Rend_SkyParams(1, DD_TEXTURE, Sky1Texture); } else { Rend_SkyParams(0, DD_ENABLE, 0); Rend_SkyParams(0, DD_MASK, DD_NO); Rend_SkyParams(0, DD_TEXTURE, Sky1Texture); Rend_SkyParams(1, DD_DISABLE, 0); Rend_SkyParams(1, DD_MASK, DD_NO); Rend_SkyParams(1, DD_TEXTURE, Sky2Texture); } }
void R_InitSkyMap(void) { int map = (gameepisode - 1) * 10 + gamemap; skyflatnum = R_FlatNumForName(SKYFLATNAME); skytexture = P_GetMapSky1Texture(map); if (!skytexture) { if (gamemode == commercial) { if (gamemap < 12) skytexture = R_TextureNumForName("SKY1"); else if (gamemap < 21) skytexture = R_TextureNumForName("SKY2"); else skytexture = R_TextureNumForName("SKY3"); } else { switch (gameepisode) { default: case 1: skytexture = R_TextureNumForName("SKY1"); break; case 2: skytexture = R_TextureNumForName("SKY2"); break; case 3: skytexture = R_TextureNumForName("SKY3"); break; case 4: skytexture = R_TextureNumForName("SKY4"); break; case 5: skytexture = R_TextureNumForName(R_CheckTextureNumForName("SKY5_ZD") != -1 ? "SKY5_ZD" : "SKY5"); break; } } } skyscrolldelta = P_GetMapSky1ScrollDelta(map); if ((canmouselook = ((mouselook || keyboardmouselook || mousemouselook != -1 || autotilt) && !nomouselook))) { int skyheight = textureheight[skytexture] >> FRACBITS; if (skyheight >= 128 && skyheight < 200) skytexturemid = -54 * FRACUNIT * skyheight / SKYSTRETCH_HEIGHT; else if (skyheight > 200) skytexturemid = (200 - skyheight) * FRACUNIT * skyheight / SKYSTRETCH_HEIGHT; else skytexturemid = 0; skyiscale = (fixed_t)(((uint64_t)FRACUNIT * SCREENWIDTH * 200) / ((uint64_t)viewwidth * SCREENHEIGHT)) * skyheight / SKYSTRETCH_HEIGHT; }