From 96b33211e0936c88bfa3ad057d6920c97ddf8227 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 3 Feb 2013 18:56:52 -0500 Subject: [PATCH] WinRT: removed some now-unnecessary file loading code --- src/video/windowsrt/DirectXHelper.h | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/video/windowsrt/DirectXHelper.h b/src/video/windowsrt/DirectXHelper.h index cc8078b42..fc6e820f8 100644 --- a/src/video/windowsrt/DirectXHelper.h +++ b/src/video/windowsrt/DirectXHelper.h @@ -14,28 +14,4 @@ namespace DX throw Platform::Exception::CreateException(hr); } } - - // Function that reads from a binary file asynchronously. - inline Concurrency::task^> ReadDataAsync(Platform::String^ filename) - { - using namespace Windows::Storage; - using namespace Concurrency; - - auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation; - - return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file) - { - return file->OpenReadAsync(); - }).then([] (Streams::IRandomAccessStreamWithContentType^ stream) - { - unsigned int bufferSize = static_cast(stream->Size); - auto fileBuffer = ref new Streams::Buffer(bufferSize); - return stream->ReadAsync(fileBuffer, bufferSize, Streams::InputStreamOptions::None); - }).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array^ - { - auto fileData = ref new Platform::Array(fileBuffer->Length); - Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData); - return fileData; - }); - } }