Browse Source

merge fallout: Patched to compile, fixed some compiler warnings, etc.

Ryan C. Gordon 6 years ago
parent
commit
4659e73892

+ 2 - 0
src/render/SDL_render.c

@@ -2858,6 +2858,7 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture,
         }
     }
 
+    SDL_zero(r);
     SDL_RenderGetViewport(renderer, &r);
     real_dstrect.x = 0.0f;
     real_dstrect.y = 0.0f;
@@ -2956,6 +2957,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture,
         real_dstrect = *dstrect;
     } else {
         SDL_Rect r;
+        SDL_zero(r);
         SDL_RenderGetViewport(renderer, &r);
         real_dstrect.x = 0.0f;
         real_dstrect.y = 0.0f;

+ 1 - 1
src/render/direct3d/SDL_render_d3d.c

@@ -1306,7 +1306,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti
                     IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, first / sizeof (Vertex), count);
                 } else {
                     const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
-                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, vertices, sizeof (Vertex));
+                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, verts, sizeof (Vertex));
                 }
                 break;
             }

+ 1 - 1
src/render/metal/SDL_render_metal.m

@@ -553,7 +553,7 @@ METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
         mtltexdesc.height = (texture->h + 1) / 2;
     }
 
-    if (yuv || nc12) {
+    if (yuv || nv12) {
         mtltexture_uv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
         if (mtltexture_uv == nil) {
 #if !__has_feature(objc_arc)

+ 4 - 4
src/render/opengles2/SDL_render_gles2.c

@@ -1297,11 +1297,11 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
                 if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
                     if (count > 2 && (verts[0] == verts[(count-1)*2]) && (verts[1] == verts[(count*2)-1])) {
                         /* GL_LINE_LOOP takes care of the final segment */
-                        data->glDrawArrays(GL_LINE_LOOP, 0, count - 1);
+                        data->glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) (count - 1));
                     } else {
-                        data->glDrawArrays(GL_LINE_STRIP, 0, count);
+                        data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) count);
                         /* We need to close the endpoint of the line */
-                        data->glDrawArrays(GL_POINTS, count - 1, 1);
+                        data->glDrawArrays(GL_POINTS, (GLsizei) (count - 1), 1);
                     }
                 }
                 break;
@@ -1312,7 +1312,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
                 size_t offset = 0;
                 if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
                     for (i = 0; i < count; ++i, offset += 4) {
-                        data->glDrawArrays(GL_TRIANGLE_STRIP, offset, 4);
+                        data->glDrawArrays(GL_TRIANGLE_STRIP, (GLsizei) offset, 4);
                     }
                 }
                 break;

+ 0 - 1
src/video/windows/SDL_windowsevents.c

@@ -962,7 +962,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         {
             UINT i;
             HDROP drop = (HDROP) wParam;
-            SDL_bool isstack;
             UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
             for (i = 0; i < count; ++i) {
                 SDL_bool isstack;

+ 1 - 1
src/video/windows/SDL_windowsmouse.c

@@ -113,7 +113,7 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
     bmh.bV4BlueMask  = 0x000000FF;
 
     maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h;
-    maskbits = SDL_small_alloc(Uint8,maskbitslen);
+    maskbits = SDL_small_alloc(Uint8, maskbitslen, &isstack);
     if (maskbits == NULL) {
         SDL_OutOfMemory();
         return NULL;