diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-13 00:16:53 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-11-13 00:16:53 +0300 |
commit | bdfe7d89e2f1292644577972c716931b4ce3c6c3 (patch) | |
tree | d00eb50b749cb001e2b08272c91791e66740b05d /source/blender/imbuf/intern/dds/DirectDrawSurface.h | |
parent | 78a1c27c4a6abe0ed31ca93ad21910f3df04da56 (diff) | |
parent | 7e4db234cee71ead34ee81a12e27da4bd548eb4b (diff) |
Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416
Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
later added in trunk also, but reverted partially, specifically revision
16683. I have left out this reversion in the 2.5 branch since I think it is
needed there.
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
-W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
differently. Since this is changed so much, and I don't think those fixes
would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
initialized when running with -P. The code that initializes the screen there
I had to disable, that can't work in 2.5 anymore but left it commented as a
reminder.
Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.
Still to be done:
* Go over files and functions that were moved to a different location but could
still use changes that were done in trunk.
Diffstat (limited to 'source/blender/imbuf/intern/dds/DirectDrawSurface.h')
-rw-r--r-- | source/blender/imbuf/intern/dds/DirectDrawSurface.h | 115 |
1 files changed, 69 insertions, 46 deletions
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.h b/source/blender/imbuf/intern/dds/DirectDrawSurface.h index 76272717332..28fcc95fe83 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.h +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.h @@ -55,92 +55,114 @@ #ifndef _DDS_DIRECTDRAWSURFACE_H #define _DDS_DIRECTDRAWSURFACE_H +#include <Common.h> #include <Stream.h> #include <ColorBlock.h> #include <Image.h> -struct DDSPixelFormat { - unsigned int size; - unsigned int flags; - unsigned int fourcc; - unsigned int bitcount; - unsigned int rmask; - unsigned int gmask; - unsigned int bmask; - unsigned int amask; +struct DDSPixelFormat +{ + uint size; + uint flags; + uint fourcc; + uint bitcount; + uint rmask; + uint gmask; + uint bmask; + uint amask; +}; + +struct DDSCaps +{ + uint caps1; + uint caps2; + uint caps3; + uint caps4; }; -struct DDSCaps { - unsigned int caps1; - unsigned int caps2; - unsigned int caps3; - unsigned int caps4; +/// DDS file header for DX10. +struct DDSHeader10 +{ + uint dxgiFormat; + uint resourceDimension; + uint miscFlag; + uint arraySize; + uint reserved; }; /// DDS file header. -struct DDSHeader { - unsigned int fourcc; - unsigned int size; - unsigned int flags; - unsigned int height; - unsigned int width; - unsigned int pitch; - unsigned int depth; - unsigned int mipmapcount; - unsigned int reserved[11]; +struct DDSHeader +{ + uint fourcc; + uint size; + uint flags; + uint height; + uint width; + uint pitch; + uint depth; + uint mipmapcount; + uint reserved[11]; DDSPixelFormat pf; DDSCaps caps; - unsigned int notused; - + uint notused; + DDSHeader10 header10; + + // Helper methods. DDSHeader(); - void setWidth(unsigned int w); - void setHeight(unsigned int h); - void setDepth(unsigned int d); - void setMipmapCount(unsigned int count); + void setWidth(uint w); + void setHeight(uint h); + void setDepth(uint d); + void setMipmapCount(uint count); void setTexture2D(); void setTexture3D(); void setTextureCube(); - void setLinearSize(unsigned int size); - void setPitch(unsigned int pitch); - void setFourCC(unsigned char c0, unsigned char c1, unsigned char c2, unsigned char c3); - void setPixelFormat(unsigned int bitcount, unsigned int rmask, unsigned int gmask, unsigned int bmask, unsigned int amask); + void setLinearSize(uint size); + void setPitch(uint pitch); + void setFourCC(uint8 c0, uint8 c1, uint8 c2, uint8 c3); + void setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask, uint amask); + void setDX10Format(uint format); void setNormalFlag(bool b); - /* void swapBytes(); */ + bool hasDX10Header() const; }; /// DirectDraw Surface. (DDS) class DirectDrawSurface { public: - DirectDrawSurface(unsigned char *mem, unsigned int size); + DirectDrawSurface(unsigned char *mem, uint size); ~DirectDrawSurface(); bool isValid() const; bool isSupported() const; - unsigned int mipmapCount() const; - unsigned int width() const; - unsigned int height() const; - unsigned int depth() const; + uint mipmapCount() const; + uint width() const; + uint height() const; + uint depth() const; + bool isTexture1D() const; bool isTexture2D() const; bool isTexture3D() const; bool isTextureCube() const; - bool hasAlpha() const; /* false for DXT1, true for all others */ + + void setNormalFlag(bool b); + + bool hasAlpha() const; /* false for DXT1, true for all other DXTs */ - void mipmap(Image * img, unsigned int f, unsigned int m); + void mipmap(Image * img, uint f, uint m); + // void mipmap(FloatImage * img, uint f, uint m); void printInfo() const; private: - unsigned int blockSize() const; - unsigned int faceSize() const; - unsigned int mipmapSize(unsigned int m) const; + uint blockSize() const; + uint faceSize() const; + uint mipmapSize(uint m) const; - unsigned int offset(unsigned int f, unsigned int m); + uint offset(uint f, uint m); void readLinearImage(Image * img); void readBlockImage(Image * img); @@ -155,5 +177,6 @@ private: void mem_read(Stream & mem, DDSPixelFormat & pf); void mem_read(Stream & mem, DDSCaps & caps); void mem_read(Stream & mem, DDSHeader & header); +void mem_read(Stream & mem, DDSHeader10 & header); #endif // _DDS_DIRECTDRAWSURFACE_H |