From 4659e73892959be3a2b15ef14b39529dcfefdee9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 1 Nov 2018 12:31:45 -0400 Subject: [PATCH] merge fallout: Patched to compile, fixed some compiler warnings, etc. --- src/render/SDL_render.c | 2 ++ src/render/direct3d/SDL_render_d3d.c | 2 +- src/render/metal/SDL_render_metal.m | 2 +- src/render/opengles2/SDL_render_gles2.c | 8 ++++---- src/video/windows/SDL_windowsevents.c | 1 - src/video/windows/SDL_windowsmouse.c | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 6af7d10c1..0c098a75b 100644 --- a/src/render/SDL_render.c +++ b/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; diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 9d000ccdd..04cfcef1f 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/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; } diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index d8f5b4328..10640c67e 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/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) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index fe2ce1ab8..43bee7a82 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/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; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 59c11bf22..77d2f7ffc 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/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; diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 3dc7e7975..b7def4278 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/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;