From: Christoph Sommer Date: Fri, 11 Aug 2006 23:52:26 +0000 (+0000) Subject: small hack to make magic blocks work for the moment. Still not perfect. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ca5e29134a78be2b8177e3a12dc0d35cbff920a8;p=supertux.git small hack to make magic blocks work for the moment. Still not perfect. SVN-Revision: 4167 --- 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]);