diff --git a/Demos/OpenGL/RenderTexture.h b/Demos/OpenGL/RenderTexture.h index f252b453b..88fdc8250 100644 --- a/Demos/OpenGL/RenderTexture.h +++ b/Demos/OpenGL/RenderTexture.h @@ -46,10 +46,10 @@ public: inline void addPixel(int x,int y,const btVector4& rgba) { unsigned char* pixel = &m_buffer[ (x+y*m_width) * 4]; - pixel[0] = (unsigned char)btMin(255.f,((float)pixel[0] + 255.f*rgba.getX())); - pixel[1] = (unsigned char)btMin(255.f,((float)pixel[1] + 255.f*rgba.getY())); - pixel[2] = (unsigned char)btMin(255.f,((float)pixel[2] + 255.f*rgba.getZ())); -// pixel[3] = (unsigned char)btMin(255.f,((float)pixel[3] + 255.f*rgba.getW())); + pixel[0] = (unsigned char)btMin(btScalar(255.f),((btScalar)pixel[0] + btScalar(255.f)*rgba.getX())); + pixel[1] = (unsigned char)btMin(btScalar(255.f),((btScalar)pixel[1] + btScalar(255.f)*rgba.getY())); + pixel[2] = (unsigned char)btMin(btScalar(255.f),((btScalar)pixel[2] + btScalar(255.f)*rgba.getZ())); +// pixel[3] = (unsigned char)btMin(btScalar(255.f),((btScalar)pixel[3] + btScalar(255.f)*rgba.getW())); } inline btVector4 getPixel(int x,int y)