direct3d: Fixed more compiler warnings on Visual Studio 64-bit builds.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Jun 2019 02:31:57 -0400
changeset 128279600f26ce4be
parent 12826 bc7022754e83
child 12828 27d544cc7236
direct3d: Fixed more compiler warnings on Visual Studio 64-bit builds.
src/render/direct3d/SDL_render_d3d.c
     1.1 --- a/src/render/direct3d/SDL_render_d3d.c	Tue Jun 11 02:14:59 2019 -0400
     1.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Tue Jun 11 02:31:57 2019 -0400
     1.3 @@ -1216,7 +1216,7 @@
     1.4              IDirect3DVertexBuffer9_Release(vbo);
     1.5          }
     1.6  
     1.7 -        if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, vertsize, usage, fvf, D3DPOOL_DEFAULT, &vbo, NULL))) {
     1.8 +        if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, (UINT) vertsize, usage, fvf, D3DPOOL_DEFAULT, &vbo, NULL))) {
     1.9              vbo = NULL;
    1.10          }
    1.11          data->vertexBuffers[vboidx] = vbo;
    1.12 @@ -1225,7 +1225,7 @@
    1.13  
    1.14      if (vbo) {
    1.15          void *ptr;
    1.16 -        if (FAILED(IDirect3DVertexBuffer9_Lock(vbo, 0, vertsize, &ptr, D3DLOCK_DISCARD))) {
    1.17 +        if (FAILED(IDirect3DVertexBuffer9_Lock(vbo, 0, (UINT) vertsize, &ptr, D3DLOCK_DISCARD))) {
    1.18              vbo = NULL;  /* oh well, we'll do immediate mode drawing.  :(  */
    1.19          } else {
    1.20              SDL_memcpy(ptr, vertices, vertsize);
    1.21 @@ -1313,10 +1313,10 @@
    1.22                  const size_t first = cmd->data.draw.first;
    1.23                  SetDrawState(data, cmd);
    1.24                  if (vbo) {
    1.25 -                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, first / sizeof (Vertex), count);
    1.26 +                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT) (first / sizeof (Vertex)), (UINT) count);
    1.27                  } else {
    1.28                      const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
    1.29 -                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, verts, sizeof (Vertex));
    1.30 +                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, (UINT) count, verts, sizeof (Vertex));
    1.31                  }
    1.32                  break;
    1.33              }
    1.34 @@ -1333,12 +1333,12 @@
    1.35                  SetDrawState(data, cmd);
    1.36  
    1.37                  if (vbo) {
    1.38 -                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_LINESTRIP, first / sizeof (Vertex), count - 1);
    1.39 +                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_LINESTRIP, (UINT) (first / sizeof (Vertex)), (UINT) (count - 1));
    1.40                      if (close_endpoint) {
    1.41 -                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (first / sizeof (Vertex)) + (count - 1), 1);
    1.42 +                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT) ((first / sizeof (Vertex)) + (count - 1)), 1);
    1.43                      }
    1.44                  } else {
    1.45 -                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count - 1, verts, sizeof (Vertex));
    1.46 +                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, (UINT) (count - 1), verts, sizeof (Vertex));
    1.47                      if (close_endpoint) {
    1.48                          IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, &verts[count-1], sizeof (Vertex));
    1.49                      }
    1.50 @@ -1353,7 +1353,7 @@
    1.51                  if (vbo) {
    1.52                      size_t offset = 0;
    1.53                      for (i = 0; i < count; ++i, offset += 4) {
    1.54 -                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, (first / sizeof (Vertex)) + offset, 2);
    1.55 +                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, (UINT) ((first / sizeof (Vertex)) + offset), 2);
    1.56                      }
    1.57                  } else {
    1.58                      const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
    1.59 @@ -1371,7 +1371,7 @@
    1.60                  if (vbo) {
    1.61                      size_t offset = 0;
    1.62                      for (i = 0; i < count; ++i, offset += 4) {
    1.63 -                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, (first / sizeof (Vertex)) + offset, 2);
    1.64 +                        IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, (UINT) ((first / sizeof (Vertex)) + offset), 2);
    1.65                      }
    1.66                  } else {
    1.67                      const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
    1.68 @@ -1395,7 +1395,7 @@
    1.69                  IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&d3dmatrix);
    1.70  
    1.71                  if (vbo) {
    1.72 -                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, first / sizeof (Vertex), 2);
    1.73 +                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLEFAN, (UINT) (first / sizeof (Vertex)), 2);
    1.74                  } else {
    1.75                      IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2, verts, sizeof (Vertex));
    1.76                  }