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

This commit is contained in:
Ryan C. Gordon 2018-11-01 12:31:45 -04:00
parent 62494a2e27
commit 4659e73892
6 changed files with 9 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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