+ pixel32 *data = sf.pixelData();
+ pixel32 current;
+ float drx, dgx, dbx, dry, dgy, dby;
+ unsigned int r,g,b;
+ int w = sf.size().width(), h = sf.size().height();
+
+ for (int y = 0; y < h; ++y) {
+ drx = (float)(texture.secondary_color().red() - texture.color().red());
+ dry = drx/(float)h;
+ drx/= (float)w;
+
+ dgx = (float)(texture.secondary_color().green() - texture.color().green());
+ dgy = dgx/(float)h;
+ dgx/= (float)w;
+
+ dbx = (float)(texture.secondary_color().blue() - texture.color().blue());
+ dby = dbx/(float)h;
+ dbx/= (float)w;
+ for (int x = 0; x < w; ++x, ++data) {
+ r = texture.color().red() + ((int)(drx * x) + (int)(dry * y))/2;
+ g = texture.color().green() + ((int)(dgx * x) + (int)(dgy * y))/2;
+ b = texture.color().blue() + ((int)(dbx * x) + (int)(dby * y))/2;
+ current = (r << default_red_shift)
+ + (g << default_green_shift)
+ + (b << default_blue_shift);
+ *data = current;
+ }
+ }
+}
+
+void TrueRenderControl::crossDiagonalGradient(
+ Surface &sf, const RenderTexture &texture) const
+{
+ pixel32 *data = sf.pixelData();
+ pixel32 current;
+ float drx, dgx, dbx, dry, dgy, dby;
+ unsigned int r,g,b;
+ int w = sf.size().width(), h = sf.size().height();
+
+ for (int y = 0; y < h; ++y) {
+ drx = (float)(texture.secondary_color().red() - texture.color().red());
+ dry = drx/(float)h;
+ drx/= (float)w;
+
+ dgx = (float)(texture.secondary_color().green() - texture.color().green());
+ dgy = dgx/(float)h;
+ dgx/= (float)w;
+
+ dbx = (float)(texture.secondary_color().blue() - texture.color().blue());
+ dby = dbx/(float)h;
+ dbx/= (float)w;
+ for (int x = w; x > 0; --x, ++data) {
+ r = texture.color().red() + ((int)(drx * (x-1)) + (int)(dry * y))/2;
+ g = texture.color().green() + ((int)(dgx * (x-1)) + (int)(dgy * y))/2;
+ b = texture.color().blue() + ((int)(dbx * (x-1)) + (int)(dby * y))/2;
+ current = (r << default_red_shift)
+ + (g << default_green_shift)
+ + (b << default_blue_shift);
+ *data = current;
+ }
+ }
+}
+
+void TrueRenderControl::reduceDepth(Surface &sf, XImage *im) const
+{
+// since pixel32 is the largest possible pixel size, we can share the array