=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9: Use 4 spaces per indent level in get_image_info_from_dds().

Alexandre Julliard julliard at winehq.org
Mon Sep 24 16:04:28 CDT 2012


Module: wine
Branch: master
Commit: 8f00a63161f17ea6205b491205c6dcc26d4d3e20
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8f00a63161f17ea6205b491205c6dcc26d4d3e20

Author: Józef Kucia <joseph.kucia at gmail.com>
Date:   Mon Sep 24 13:46:37 2012 +0200

d3dx9: Use 4 spaces per indent level in get_image_info_from_dds().

---

 dlls/d3dx9_36/surface.c |  102 +++++++++++++++++++++++-----------------------
 1 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 4b9b056..3bf8cb1 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -337,58 +337,58 @@ static UINT calculate_dds_file_size(D3DFORMAT format, UINT width, UINT height, U
 */
 static HRESULT get_image_info_from_dds(const void *buffer, UINT length, D3DXIMAGE_INFO *info)
 {
-   UINT faces = 1;
-   UINT expected_length;
-   const struct dds_header *header = buffer;
-
-   if (length < sizeof(*header) || !info)
-       return D3DXERR_INVALIDDATA;
-
-   if (header->pixel_format.size != sizeof(header->pixel_format))
-       return D3DXERR_INVALIDDATA;
-
-   info->Width = header->width;
-   info->Height = header->height;
-   info->Depth = 1;
-   info->MipLevels = (header->flags & DDS_MIPMAPCOUNT) ?  header->miplevels : 1;
-
-   info->Format = dds_pixel_format_to_d3dformat(&header->pixel_format);
-   if (info->Format == D3DFMT_UNKNOWN)
-       return D3DXERR_INVALIDDATA;
-
-   TRACE("Pixel format is %#x\n", info->Format);
-
-   if (header->caps2 & DDS_CAPS2_VOLUME)
-   {
-       info->Depth = header->depth;
-       info->ResourceType = D3DRTYPE_VOLUMETEXTURE;
-   }
-   else if (header->caps2 & DDS_CAPS2_CUBEMAP)
-   {
-       DWORD face;
-       faces = 0;
-       for (face = DDS_CAPS2_CUBEMAP_POSITIVEX; face <= DDS_CAPS2_CUBEMAP_NEGATIVEZ; face <<= 1)
-       {
-           if (header->caps2 & face)
-               faces++;
-       }
-       info->ResourceType = D3DRTYPE_CUBETEXTURE;
-   }
-   else
-   {
-       info->ResourceType = D3DRTYPE_TEXTURE;
-   }
-
-   expected_length = calculate_dds_file_size(info->Format, info->Width, info->Height, info->Depth,
+    UINT faces = 1;
+    UINT expected_length;
+    const struct dds_header *header = buffer;
+
+    if (length < sizeof(*header) || !info)
+        return D3DXERR_INVALIDDATA;
+
+    if (header->pixel_format.size != sizeof(header->pixel_format))
+        return D3DXERR_INVALIDDATA;
+
+    info->Width = header->width;
+    info->Height = header->height;
+    info->Depth = 1;
+    info->MipLevels = (header->flags & DDS_MIPMAPCOUNT) ?  header->miplevels : 1;
+
+    info->Format = dds_pixel_format_to_d3dformat(&header->pixel_format);
+    if (info->Format == D3DFMT_UNKNOWN)
+        return D3DXERR_INVALIDDATA;
+
+    TRACE("Pixel format is %#x\n", info->Format);
+
+    if (header->caps2 & DDS_CAPS2_VOLUME)
+    {
+        info->Depth = header->depth;
+        info->ResourceType = D3DRTYPE_VOLUMETEXTURE;
+    }
+    else if (header->caps2 & DDS_CAPS2_CUBEMAP)
+    {
+        DWORD face;
+        faces = 0;
+        for (face = DDS_CAPS2_CUBEMAP_POSITIVEX; face <= DDS_CAPS2_CUBEMAP_NEGATIVEZ; face <<= 1)
+        {
+            if (header->caps2 & face)
+                faces++;
+        }
+        info->ResourceType = D3DRTYPE_CUBETEXTURE;
+    }
+    else
+    {
+        info->ResourceType = D3DRTYPE_TEXTURE;
+    }
+
+    expected_length = calculate_dds_file_size(info->Format, info->Width, info->Height, info->Depth,
         info->MipLevels, faces);
-   if (length < expected_length)
-   {
-       WARN("File is too short %u, expected at least %u bytes\n", length, expected_length);
-       return D3DXERR_INVALIDDATA;
-   }
-
-   info->ImageFileFormat = D3DXIFF_DDS;
-   return D3D_OK;
+    if (length < expected_length)
+    {
+        WARN("File is too short %u, expected at least %u bytes\n", length, expected_length);
+        return D3DXERR_INVALIDDATA;
+    }
+
+    info->ImageFileFormat = D3DXIFF_DDS;
+    return D3D_OK;
 }
 
 static HRESULT load_surface_from_dds(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette,




More information about the wine-cvs mailing list