]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
todo items went from 465 to 459 by finding items that was already done or duplicates
[xonotic/darkplaces.git] / gl_textures.c
index f2fac414d9669cfafa26a18034b2bab647f62f74..b4649e05df094efeb75d0914f29904f677c1eb0e 100644 (file)
@@ -874,6 +874,12 @@ static void R_Upload(gltexture_t *glt, const unsigned char *data, int fragx, int
                                                Image_MipReduce32(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1);
                                                prevbuffer = resizebuffer;
                                        }
+                                       else
+                                       {
+                                               if (width > 1) width >>= 1;
+                                               if (height > 1) height >>= 1;
+                                               if (depth > 1) depth >>= 1;
+                                       }
                                        qglTexImage1D(GL_TEXTURE_1D, mip++, glt->glinternalformat, width, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
                                }
                        }
@@ -889,6 +895,12 @@ static void R_Upload(gltexture_t *glt, const unsigned char *data, int fragx, int
                                                Image_MipReduce32(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1);
                                                prevbuffer = resizebuffer;
                                        }
+                                       else
+                                       {
+                                               if (width > 1) width >>= 1;
+                                               if (height > 1) height >>= 1;
+                                               if (depth > 1) depth >>= 1;
+                                       }
                                        qglTexImage2D(GL_TEXTURE_2D, mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
                                }
                        }
@@ -904,6 +916,12 @@ static void R_Upload(gltexture_t *glt, const unsigned char *data, int fragx, int
                                                Image_MipReduce32(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1);
                                                prevbuffer = resizebuffer;
                                        }
+                                       else
+                                       {
+                                               if (width > 1) width >>= 1;
+                                               if (height > 1) height >>= 1;
+                                               if (depth > 1) depth >>= 1;
+                                       }
                                        qglTexImage3D(GL_TEXTURE_3D, mip++, glt->glinternalformat, width, height, depth, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
                                }
                        }
@@ -941,6 +959,12 @@ static void R_Upload(gltexture_t *glt, const unsigned char *data, int fragx, int
                                                        Image_MipReduce32(prevbuffer, resizebuffer, &width, &height, &depth, 1, 1, 1);
                                                        prevbuffer = resizebuffer;
                                                }
+                                               else
+                                               {
+                                                       if (width > 1) width >>= 1;
+                                                       if (height > 1) height >>= 1;
+                                                       if (depth > 1) depth >>= 1;
+                                               }
                                                qglTexImage2D(cubemapside[i], mip++, glt->glinternalformat, width, height, 0, glt->glformat, GL_UNSIGNED_BYTE, prevbuffer);CHECKGLERROR
                                        }
                                }