Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
| Show First 20 Lines • Show All 1,388 Lines • ▼ Show 20 Lines | uint DirectDrawSurface::mipmapSize(uint mipmap) const | ||||
| { | { | ||||
| // @@ How are 3D textures aligned? | // @@ How are 3D textures aligned? | ||||
| w = (w + 3) / 4; | w = (w + 3) / 4; | ||||
| h = (h + 3) / 4; | h = (h + 3) / 4; | ||||
| return blockSize() * w * h; | return blockSize() * w * h; | ||||
| } | } | ||||
| else if (header.pf.flags & DDPF_RGB || (header.pf.flags & DDPF_LUMINANCE)) | else if (header.pf.flags & DDPF_RGB || (header.pf.flags & DDPF_LUMINANCE)) | ||||
| { | { | ||||
| uint pitch = computePitch(w, header.pf.bitcount, 8); // Asuming 8 bit alignment, which is the same D3DX expects. | uint pitch = computePitch(w, header.pf.bitcount, 8); // Assuming 8 bit alignment, which is the same D3DX expects. | ||||
| return pitch * h * d; | return pitch * h * d; | ||||
| } | } | ||||
| else { | else { | ||||
| printf("DDS: mipmap format not supported\n"); | printf("DDS: mipmap format not supported\n"); | ||||
| return(0); | return(0); | ||||
| }; | }; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||