WinRT: removed some now-unnecessary file loading code
authorDavid Ludwig <dludwig@pobox.com>
Sun, 03 Feb 2013 18:56:52 -0500
changeset 8408bf75cfadbf4a
parent 8407 2dc7432abaf9
child 8409 fd48120bd35f
WinRT: removed some now-unnecessary file loading code
src/video/windowsrt/DirectXHelper.h
     1.1 --- a/src/video/windowsrt/DirectXHelper.h	Sun Feb 03 18:56:11 2013 -0500
     1.2 +++ b/src/video/windowsrt/DirectXHelper.h	Sun Feb 03 18:56:52 2013 -0500
     1.3 @@ -14,28 +14,4 @@
     1.4              throw Platform::Exception::CreateException(hr);
     1.5          }
     1.6      }
     1.7 -
     1.8 -    // Function that reads from a binary file asynchronously.
     1.9 -    inline Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ filename)
    1.10 -    {
    1.11 -        using namespace Windows::Storage;
    1.12 -        using namespace Concurrency;
    1.13 -        
    1.14 -        auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
    1.15 -        
    1.16 -        return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file) 
    1.17 -        {
    1.18 -            return file->OpenReadAsync();
    1.19 -        }).then([] (Streams::IRandomAccessStreamWithContentType^ stream)
    1.20 -        {
    1.21 -            unsigned int bufferSize = static_cast<unsigned int>(stream->Size);
    1.22 -            auto fileBuffer = ref new Streams::Buffer(bufferSize);
    1.23 -            return stream->ReadAsync(fileBuffer, bufferSize, Streams::InputStreamOptions::None);
    1.24 -        }).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^ 
    1.25 -        {
    1.26 -            auto fileData = ref new Platform::Array<byte>(fileBuffer->Length);
    1.27 -            Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData);
    1.28 -            return fileData;
    1.29 -        });
    1.30 -    }
    1.31  }