From ca5e29134a78be2b8177e3a12dc0d35cbff920a8 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Fri, 11 Aug 2006 23:52:26 +0000 Subject: [PATCH] small hack to make magic blocks work for the moment. Still not perfect. SVN-Revision: 4167 --- src/video/drawing_context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index e8887a645..dfd0f4e97 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -265,8 +265,8 @@ DrawingContext::get_light(DrawingRequest& request) for( int i = 0; i<3; i++) pixels[i] = 0.0f; //set to black - //TODO: not working as i thought. this only returns ambient_color. Why? - glReadPixels((GLint) request.pos.x, (GLint)request.pos.y, 1, 1, GL_RGB, GL_FLOAT, pixels); + //TODO: hacky. Make coordinate conversion more generic + glReadPixels((GLint) request.pos.x / 4, 600-(GLint)request.pos.y / 4, 1, 1, GL_RGB, GL_FLOAT, pixels); *(getlightrequest->color_ptr) = Color( pixels[0], pixels[1], pixels[2]); //printf("get_light %f/%f r%f g%f b%f\n", request.pos.x, request.pos.y, pixels[0], pixels[1], pixels[2]); -- 2.11.0