+ return NULL; // all opaque
+ }
+}
+
+int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap)
+{
+ int texnum;
+ byte *data;
+ if (!(data = loadimagepixels (filename, complain, matchwidth, matchheight)))
+ return 0;
+ texnum = GL_LoadTexture (filename, image_width, image_height, data, mipmap, true, 4);
+ free(data);
+ return texnum;
+}
+
+int loadtextureimagemask (char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap)
+{
+ int texnum;
+ byte *data;
+ if (!(data = loadimagepixelsmask (filename, complain, matchwidth, matchheight)))
+ return 0;
+ texnum = GL_LoadTexture (filename, image_width, image_height, data, mipmap, true, 4);
+ free(data);
+ return texnum;
+}
+
+int image_masktexnum;
+int loadtextureimagewithmask (char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap)
+{
+ int texnum, count;
+ byte *data;
+ char *filename2;
+ image_masktexnum = 0;
+ if (!(data = loadimagepixels (filename, complain, matchwidth, matchheight)))
+ return 0;
+ texnum = GL_LoadTexture (filename, image_width, image_height, data, mipmap, true, 4);
+ count = image_makemask(data, data, image_width * image_height);
+ if (count)
+ {
+ filename2 = malloc(strlen(filename) + 6);
+ sprintf(filename2, "%s_mask", filename);
+ image_masktexnum = GL_LoadTexture (filename2, image_width, image_height, data, mipmap, true, 4);
+ free(filename2);