]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.c
TEU uses teu.rc, not quake.rc
[xonotic/darkplaces.git] / image.c
diff --git a/image.c b/image.c
index 27fc794148762ed70fa2e4beeac839f3c76c0833..192cb568d9eded768e0ab86197fb6be4b9959d57 100644 (file)
--- a/image.c
+++ b/image.c
@@ -7,6 +7,44 @@
 int            image_width;
 int            image_height;
 
+void Image_CopyMux(qbyte *outpixels, const qbyte *inpixels, int width, int height, int flipx, int flipy, int flipdiagonal, int numincomponents, int numoutcomponents, int *inputcomponentindices)
+{
+       int index, c, x, y;
+       const qbyte *in, *inrow, *incolumn;
+       if (flipdiagonal)
+       {
+               for (y = 0;y < height;y++)
+               {
+                       incolumn = inpixels + (flipx ? width - 1 - y : y) * numincomponents;
+                       for (x = 0;x < width;x++)
+                       {
+                               in = incolumn + (flipy ? height - 1 - x : x) * width * numincomponents;
+                               for (c = 0;c < numoutcomponents;c++)
+                               {
+                                       index = inputcomponentindices[c];
+                                       *outpixels++ = (index & 0x80000000) ? (index - 0x8000000) : in[index];
+                               }
+                       }
+               }
+       }
+       else
+       {
+               for (y = 0;y < height;y++)
+               {
+                       inrow = inpixels + (flipy ? height - 1 - y : y) * width * numincomponents;
+                       for (x = 0;x < width;x++)
+                       {
+                               in = inrow + (flipx ? width - 1 - x : x) * numincomponents;
+                               for (c = 0;c < numoutcomponents;c++)
+                               {
+                                       index = inputcomponentindices[c];
+                                       *outpixels++ = (index & 0x80000000) ? (index - 0x8000000) : in[index];
+                               }
+                       }
+               }
+       }
+}
+
 void Image_GammaRemapRGB(const qbyte *in, qbyte *out, int pixels, const qbyte *gammar, const qbyte *gammag, const qbyte *gammab)
 {
        while (pixels--)