--- /dev/null
+\r
+/*\r
+=================\r
+=\r
+= VL_MungePic\r
+=\r
+=================\r
+*/\r
+\r
+void VL_MungePic (unsigned char far *source, unsigned width, unsigned height)\r
+{\r
+ unsigned x,y,plane,size,pwidth;\r
+ unsigned char far *temp, far *dest, far *srcline;\r
+\r
+ size = width*height;\r
+\r
+ if (width&3)\r
+ errout ("VL_MungePic: Not divisable by 4!\n");\r
+\r
+//\r
+// copy the pic to a temp buffer\r
+//\r
+ temp = (unsigned char far *)farmalloc (size);\r
+ if (!temp)\r
+ errout ("Non enough memory for munge buffer!\n");\r
+\r
+ _fmemcpy (temp,source,size);\r
+\r
+//\r
+// munge it back into the original buffer\r
+//\r
+ dest = source;\r
+ pwidth = width/4;\r
+\r
+ for (plane=0;plane<4;plane++)\r
+ {\r
+ srcline = temp;\r
+ for (y=0;y<height;y++)\r
+ {\r
+ for (x=0;x<pwidth;x++)\r
+ *dest++ = *(srcline+x*4+plane);\r
+ srcline+=width;\r
+ }\r
+ }\r
+\r
+ free (temp);\r
+}\r
+\r