summaryrefslogtreecommitdiffstats
path: root/src/common/image.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 11:26:59 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-09-30 11:26:59 +0200
commit85d253b094555b969dccffe7d34345b0969c59df (patch)
treede9fec3fa82dbe49c225ef4118e1c53726cab7e1 /src/common/image.cpp
parent8ea4736a46f1a468ee214528ba539e1f505b8273 (diff)
downloadcolobot-85d253b094555b969dccffe7d34345b0969c59df.tar.gz
colobot-85d253b094555b969dccffe7d34345b0969c59df.tar.bz2
colobot-85d253b094555b969dccffe7d34345b0969c59df.zip
Fixed bugs in texture coloring
Diffstat (limited to 'src/common/image.cpp')
-rw-r--r--src/common/image.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/image.cpp b/src/common/image.cpp
index f78ea94..adb8ce7 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -200,8 +200,8 @@ Math::IntPoint CImage::GetSize() const
Gfx::IntColor CImage::GetPixelInt(Math::IntPoint pixel)
{
assert(m_data != nullptr);
- assert(pixel.x >= 0 || pixel.x <= m_data->surface->w);
- assert(pixel.y >= 0 || pixel.y <= m_data->surface->h);
+ assert(pixel.x >= 0 && pixel.x < m_data->surface->w);
+ assert(pixel.y >= 0 && pixel.y < m_data->surface->h);
int bpp = m_data->surface->format->BytesPerPixel;
int index = pixel.y * m_data->surface->pitch + pixel.x * bpp;
@@ -260,8 +260,8 @@ Gfx::Color CImage::GetPixel(Math::IntPoint pixel)
void CImage::SetPixelInt(Math::IntPoint pixel, Gfx::IntColor color)
{
assert(m_data != nullptr);
- assert(pixel.x >= 0 || pixel.x <= m_data->surface->w);
- assert(pixel.y >= 0 || pixel.y <= m_data->surface->h);
+ assert(pixel.x >= 0 && pixel.x < m_data->surface->w);
+ assert(pixel.y >= 0 && pixel.y < m_data->surface->h);
int bpp = m_data->surface->format->BytesPerPixel;
int index = pixel.y * m_data->surface->pitch + pixel.x * bpp;