]> git.mxchange.org Git - simgear.git/commitdiff
Attempt to get these files back to a compilable state.
authorcurt <curt>
Fri, 11 Jul 2003 17:50:32 +0000 (17:50 +0000)
committercurt <curt>
Fri, 11 Jul 2003 17:50:32 +0000 (17:50 +0000)
simgear/screen/texture.cxx
simgear/screen/texture.hxx

index 1e2d2cc01691067dd8347e35350f0cb736cc6680..b10707f93bb42b1d38862f268fb38666e6590509 100644 (file)
@@ -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 *
index 4a4a2f22a9a38b04f8f6f72caa54daf82491875c..bb99b5c2dec5932db576d465d997efb8f99bd03d 100644 (file)
@@ -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) {