OSDN Git Service

[Qt][OpenGL] .
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 29 Jan 2020 18:35:56 +0000 (03:35 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 29 Jan 2020 18:35:56 +0000 (03:35 +0900)
source/src/qt/gui/gl4_5/qt_glutil_gl4_5.cpp
source/src/qt/gui/gles2/qt_glutil_gles_2.cpp

index d1ab756..652ce66 100644 (file)
@@ -829,9 +829,10 @@ void GLDraw_4_5::uploadMainTexture(QImage *p, bool use_chromakey, bool was_mappe
                                                                                                                                                  pixel_width *pixel_height * sizeof(scrntype_t),
                                                                                                                                                  GL_MAP_WRITE_BIT ));
                                        int hh = (pixel_height < p->height()) ? pixel_height : p->height();
+                                       int ww = (pixel_width < p->width()) ? pixel_width : p->width();
                                        if(pp != NULL) {
                                                for(int y = 0; y < hh; y++) {
-                                                       memcpy(&(pp[y * pixel_width]), p->scanLine(y), p->width() * sizeof(uint32_t));
+                                                       memcpy(&(pp[y * pixel_width]), p->scanLine(y), ww * sizeof(uint32_t));
                                                }
                                        }
                                        extfunc->glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
index 4796dcf..138e3ad 100644 (file)
@@ -1392,7 +1392,7 @@ void GLDraw_ES_2::do_set_texture_size(QImage *p, int w, int h)
                iw = (float)using_flags->get_real_screen_width();
                ih = (float)using_flags->get_real_screen_height();
        }
-       //printf("%dx%d -> %fx%f\n", w, h, iw, ih);
+       printf("%dx%d -> %fx%f\n", w, h, iw, ih);
        if(p_wid != NULL) {
                screen_texture_width = w;
                screen_texture_height = h;