diff options
author | Kent Mein <mein@cs.umn.edu> | 2007-10-12 20:09:59 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2007-10-12 20:09:59 +0400 |
commit | 6fe98f19a95117633684b85073b4d90654e159fd (patch) | |
tree | 50d54508e6e4395442fb486d96cb7202a871ee5e /source/blender/imbuf/intern/dds/Stream.cpp | |
parent | 3697e0852467a29223a59d2ad6a31a00cfbde529 (diff) |
This is patch [#7483] imbuf support for uncompressed DDS images
provided by Amorilia
NVIDIA updated the dds stuff so we get a nice new patch.
Kent
Diffstat (limited to 'source/blender/imbuf/intern/dds/Stream.cpp')
-rw-r--r-- | source/blender/imbuf/intern/dds/Stream.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/dds/Stream.cpp b/source/blender/imbuf/intern/dds/Stream.cpp index a181ec74476..2340598b4fa 100644 --- a/source/blender/imbuf/intern/dds/Stream.cpp +++ b/source/blender/imbuf/intern/dds/Stream.cpp @@ -86,3 +86,14 @@ unsigned int mem_read(Stream & mem, unsigned char & i) return(1); } +unsigned int mem_read(Stream & mem, unsigned char *i, unsigned int cnt) +{ + if (mem.pos + cnt > mem.size) { + printf("DDS: trying to read beyond end of stream (corrupt file?)"); + return(0); + }; + memcpy(i, mem.mem + mem.pos, cnt); + mem.pos += cnt; + return(cnt); +} + |