/*---------------------------------------------------------------------------* Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ // ------------------------------------------------------- // DDS.h // // Declares functions for DDS Reader. // ------------------------------------------------------- #ifndef DDS_H #define DDS_H #include "TexConvert.h" namespace DDSReader { #define PAD_BYTE(width, bpp) (((bpp) * (width) + 7) / 8) #define PAD_WORD(width, bpp) ((((bpp) * (width) + 15) / 16) * 2) #define PAD_WORD_SIZE(size) ((size + 1) & (~0x1)) #define PAD_DWORD(width, bpp) ((((bpp) * (width) + 31) / 32) * 4) #define PAD_DWORD_SIZE(size) ((size + 3) & (~0x3)) // Required for 64bit compatability typedef struct _DDSD2 { u32 dwSize; // size of the DDSURFACEDESC structure u32 dwFlags; // determines what fields are valid u32 dwHeight; // height of surface to be created u32 dwWidth; // width of input surface union { LONG lPitch; // distance to start of next line (return value only) u32 dwLinearSize; // Formless late-allocated optimized surface size } DUMMYUNIONNAMEN(1); union { u32 dwBackBufferCount; // number of back buffers requested u32 dwDepth; // the depth if this is a volume texture } DUMMYUNIONNAMEN(5); union { u32 dwMipMapCount; // number of mip-map levels requestde // dwZBufferBitDepth removed, use ddpfPixelFormat one instead u32 dwRefreshRate; // refresh rate (used when display mode is described) u32 dwSrcVBHandle; // The source used in VB::Optimize } DUMMYUNIONNAMEN(2); u32 dwAlphaBitDepth; // depth of alpha buffer requested u32 dwReserved; // reserved void* POINTER_32 lpSurface; // pointer to the associated surface memory union { DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use u32 dwEmptyFaceColor; // Physical color for empty cubemap faces } DUMMYUNIONNAMEN(3); DDCOLORKEY ddckCKDestBlt; // color key for destination blt use DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use DDCOLORKEY ddckCKSrcBlt; // color key for source blt use union { DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface u32 dwFVF; // vertex format description of vertex buffers } DUMMYUNIONNAMEN(4); DDSCAPS2 ddsCaps; // direct draw surface capabilities u32 dwTextureStage; // stage in multitexture cascade } DDSD2; } //namespace DDSReader #endif //#ifndef DDS_H