diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-02 17:28:21 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-02 17:28:21 +0200 |
| commit | 5c4506a8c5ee1a82268146007619b09e980a7a57 (patch) | |
| tree | c21bb83bdf7c87b7c9f9693cd4fcd43212ae4be2 /ue2/imgsynth2/cpixelformat_bgr555.cpp | |
| parent | bcadfa267f976fe9f29afa50a635cbe3ea174e38 (diff) | |
| download | ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.gz ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.tar.bz2 ooprog-5c4506a8c5ee1a82268146007619b09e980a7a57.zip | |
add some assert() to make tutor happy
Diffstat (limited to 'ue2/imgsynth2/cpixelformat_bgr555.cpp')
| -rw-r--r-- | ue2/imgsynth2/cpixelformat_bgr555.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ue2/imgsynth2/cpixelformat_bgr555.cpp b/ue2/imgsynth2/cpixelformat_bgr555.cpp index 657c148..ba12cb5 100644 --- a/ue2/imgsynth2/cpixelformat_bgr555.cpp +++ b/ue2/imgsynth2/cpixelformat_bgr555.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <boost/numeric/conversion/cast.hpp> | 9 | #include <boost/numeric/conversion/cast.hpp> |
| 10 | #include <assert.h> | ||
| 10 | #include "cpixelformat_bgr555.h" | 11 | #include "cpixelformat_bgr555.h" |
| 11 | #include "cbitmap.h" | 12 | #include "cbitmap.h" |
| 12 | 13 | ||
| @@ -16,6 +17,7 @@ void CPixelFormat_BGR555::getPixel(RGBPIXEL& pixel, uint32_t x, uint32_t y) | |||
| 16 | { | 17 | { |
| 17 | if (m_bitmap->getPixelData() == NULL) | 18 | if (m_bitmap->getPixelData() == NULL) |
| 18 | throw PixelFormatError("No pixelbuffer allocated."); | 19 | throw PixelFormatError("No pixelbuffer allocated."); |
| 20 | assert(m_bitmap->getPixelDataSize() > 0); | ||
| 19 | 21 | ||
| 20 | /* if the y-coordinates are mirrored */ | 22 | /* if the y-coordinates are mirrored */ |
| 21 | if (m_bitmap->isMirrored()) | 23 | if (m_bitmap->isMirrored()) |
| @@ -39,6 +41,7 @@ void CPixelFormat_BGR555::setPixel(const RGBPIXEL& pixel, uint32_t x, uint32_t y | |||
| 39 | { | 41 | { |
| 40 | if (m_bitmap->getPixelData() == NULL) | 42 | if (m_bitmap->getPixelData() == NULL) |
| 41 | throw PixelFormatError("No pixelbuffer allocated."); | 43 | throw PixelFormatError("No pixelbuffer allocated."); |
| 44 | assert(m_bitmap->getPixelDataSize() > 0); | ||
| 42 | 45 | ||
| 43 | /* if the y-coordinates are mirrored */ | 46 | /* if the y-coordinates are mirrored */ |
| 44 | if (m_bitmap->isMirrored()) | 47 | if (m_bitmap->isMirrored()) |
