Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1701)

Unified Diff: source/blender/imbuf/intern/dds/DirectDrawSurface.cpp

Issue 4961053: Blender Cucumber to Trunk Base URL: https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Patch Set: Fixes to crashing DDS mipmaps, leaking dyn lights, and some review comments. Created 12 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
===================================================================
--- source/blender/imbuf/intern/dds/DirectDrawSurface.cpp (revision 40024)
+++ source/blender/imbuf/intern/dds/DirectDrawSurface.cpp (working copy)
@@ -1018,6 +1018,10 @@
else return 1;
}
+uint DirectDrawSurface::fourCC() const
+{
+ return header.pf.fourcc;
+}
uint DirectDrawSurface::width() const
{
@@ -1133,6 +1137,29 @@
}
}
+// It was easier to copy this function from upstream than to resync.
+// This should be removed if a resync ever occurs.
+void* DirectDrawSurface::readData(uint &rsize)
+{
+ uint header_size = 128; // sizeof(DDSHeader);
+ if (header.hasDX10Header())
+ {
+ header_size += 20; // sizeof(DDSHeader10);
+ }
+
+ uint size = stream.size - header_size;
+ rsize = size;
+
+ unsigned char *data = new unsigned char[size];
+
+ stream.seek(header_size);
+ mem_read(stream, data, size);
+
+ // Maybe check if size == rsize? assert() isn't in this scope...
+
+ return data;
+}
+
void DirectDrawSurface::readLinearImage(Image * img)
{
@@ -1525,4 +1552,3 @@
printf("User Version: %u\n", header.reserved[8]);
}
}
-

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b