src/video/win32/SDL_d3drender.c
changeset 1920 8a162bfdc838
parent 1918 092bd3a019c5
child 1921 f3399f779a1d
     1.1 --- a/src/video/win32/SDL_d3drender.c	Wed Jul 19 08:46:57 2006 +0000
     1.2 +++ b/src/video/win32/SDL_d3drender.c	Sat Jul 22 08:33:18 2006 +0000
     1.3 @@ -239,20 +239,18 @@
     1.4      D3DPRESENT_PARAMETERS pparams;
     1.5      IDirect3DSwapChain9 *chain;
     1.6  
     1.7 -    renderer = (SDL_Renderer *) SDL_malloc(sizeof(*renderer));
     1.8 +    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
     1.9      if (!renderer) {
    1.10          SDL_OutOfMemory();
    1.11          return NULL;
    1.12      }
    1.13 -    SDL_zerop(renderer);
    1.14  
    1.15 -    data = (D3D_RenderData *) SDL_malloc(sizeof(*data));
    1.16 +    data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data));
    1.17      if (!data) {
    1.18          D3D_DestroyRenderer(renderer);
    1.19          SDL_OutOfMemory();
    1.20          return NULL;
    1.21      }
    1.22 -    SDL_zerop(data);
    1.23  
    1.24      renderer->CreateTexture = D3D_CreateTexture;
    1.25      renderer->SetTexturePalette = D3D_SetTexturePalette;
    1.26 @@ -379,12 +377,11 @@
    1.27      D3DPOOL pool;
    1.28      HRESULT result;
    1.29  
    1.30 -    data = (D3D_TextureData *) SDL_malloc(sizeof(*data));
    1.31 +    data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data));
    1.32      if (!data) {
    1.33          SDL_OutOfMemory();
    1.34          return -1;
    1.35      }
    1.36 -    SDL_zerop(data);
    1.37  
    1.38      texture->driverdata = data;
    1.39