Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong size of structure DDSURFACEDESC2 #3

Closed
GoogleCodeExporter opened this issue Apr 15, 2015 · 3 comments
Closed

Wrong size of structure DDSURFACEDESC2 #3

GoogleCodeExporter opened this issue Apr 15, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I noticed that in inc/dds_defs.h the sizeof structure DDSURFACEDESC2 is 124 
bytes, by calculating that with sizeof(). However, in my DDS tests, where I try 
to load a single DDS file, I see a DDS header length of 120 bytes, which does 
not match the above mentioned structure.

My loader works, if I calculate fileoffsets with 120 bytes, instead of the 
mentioned 124 bytes. Hence, the question is, is the definition of 
DDSURFACEDESC2 correct, or should it be instead 120 bytes?

A sample DDS attached in this issue, what I used for testing.

Original issue reported on code.google.com by jvatjusa...@gmail.com on 7 Aug 2012 at 11:24

Attachments:

@GoogleCodeExporter
Copy link
Author

The header consists of a DWORD identifier, followed by 124 bytes, or 128 bytes 
total, see this link for more info:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb943982(v=vs.85).aspx

Here's the header from your sample file:

        dwSize  124 unsigned int
        dwFlags 528391  unsigned int
        dwHeight    128 unsigned int
        dwWidth 128 unsigned int
        lPitch  8192    int
        dwLinearSize    8192    unsigned int

DDSURFACEDESC2 should be 124 bytes total.

Hope that helps,
-Rich

Original comment by richge...@gmail.com on 11 Aug 2012 at 8:09

@GoogleCodeExporter
Copy link
Author

Yes, that is right. I missed the single DWORD identifier, which makes the 
header in total 128 bytes. Now, this explains the offset I need to add to the 
data, to get the correct data out from the file. Thank you for pointing that 
out, and apologizes for the invalid issue :)

Original comment by jvatjusa...@gmail.com on 14 Aug 2012 at 11:49

@GoogleCodeExporter
Copy link
Author

Original comment by richge...@gmail.com on 17 Sep 2012 at 5:21

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant