From 1f4b55e98ecd7e6f96c7947d73b5e8a820b550fb Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 11 Jul 2003 17:50:32 +0000 Subject: [PATCH] Attempt to get these files back to a compilable state. --- simgear/screen/texture.cxx | 12 ++++++------ simgear/screen/texture.hxx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index 1e2d2cc0..b10707f9 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -340,26 +340,26 @@ SGTexture::set_pixel(GLuint x, GLuint y, sgVec3 &c) return; unsigned int pos = (x + y*texture_width)*3; - texture_data[pos] = c[0]; - texture_data[pos+1] = c[1]; - texture_data[pos+2] = c[2]; + texture_data[pos] = (unsigned char)(c[0] * 256); + texture_data[pos+1] = (unsigned char)(c[1] * 256); + texture_data[pos+2] = (unsigned char)(c[2] * 256); } -sgVec3 * +float * SGTexture::get_pixel(GLuint x, GLuint y) { static sgVec3 c; sgSetVec3(c, 0, 0, 0); if (!texture_data) - return; + return c; unsigned int pos = (x + y*texture_width)*3; sgSetVec3(c, texture_data[pos], texture_data[pos+1], texture_data[pos+2]); - return &c; + return c; } SGTexture::ImageRec * diff --git a/simgear/screen/texture.hxx b/simgear/screen/texture.hxx index 4a4a2f22..bb99b5c2 100644 --- a/simgear/screen/texture.hxx +++ b/simgear/screen/texture.hxx @@ -101,7 +101,7 @@ public: // texture pixel manipulation functions. void set_pixel(GLuint x, GLuint y, sgVec3 &c); - sgVec3 *get_pixel(GLuint x, GLuint y); + float *get_pixel(GLuint x, GLuint y); void bind(); inline void select(bool keep_data = false) { -- 2.39.5