src/video/windowsrt/DirectXHelper.h
changeset 8384 bc7a52629e1e
parent 8322 839cd578a474
child 8397 8cd319461894
     1.1 --- a/src/video/windowsrt/DirectXHelper.h	Tue Jan 08 22:50:29 2013 -0500
     1.2 +++ b/src/video/windowsrt/DirectXHelper.h	Tue Jan 08 23:11:22 2013 -0500
     1.3 @@ -6,31 +6,31 @@
     1.4  
     1.5  namespace DX
     1.6  {
     1.7 -	inline void ThrowIfFailed(HRESULT hr)
     1.8 -	{
     1.9 -		if (FAILED(hr))
    1.10 -		{
    1.11 -			// Set a breakpoint on this line to catch Win32 API errors.
    1.12 -			throw Platform::Exception::CreateException(hr);
    1.13 -		}
    1.14 -	}
    1.15 +    inline void ThrowIfFailed(HRESULT hr)
    1.16 +    {
    1.17 +        if (FAILED(hr))
    1.18 +        {
    1.19 +            // Set a breakpoint on this line to catch Win32 API errors.
    1.20 +            throw Platform::Exception::CreateException(hr);
    1.21 +        }
    1.22 +    }
    1.23  
    1.24 -	// Function that reads from a binary file asynchronously.
    1.25 -	inline Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ filename)
    1.26 -	{
    1.27 -		using namespace Windows::Storage;
    1.28 -		using namespace Concurrency;
    1.29 -		
    1.30 -		auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
    1.31 -		
    1.32 -		return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file) 
    1.33 -		{
    1.34 -			return FileIO::ReadBufferAsync(file);
    1.35 -		}).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^ 
    1.36 -		{
    1.37 -			auto fileData = ref new Platform::Array<byte>(fileBuffer->Length);
    1.38 -			Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData);
    1.39 -			return fileData;
    1.40 -		});
    1.41 -	}
    1.42 +    // Function that reads from a binary file asynchronously.
    1.43 +    inline Concurrency::task<Platform::Array<byte>^> ReadDataAsync(Platform::String^ filename)
    1.44 +    {
    1.45 +        using namespace Windows::Storage;
    1.46 +        using namespace Concurrency;
    1.47 +        
    1.48 +        auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
    1.49 +        
    1.50 +        return create_task(folder->GetFileAsync(filename)).then([] (StorageFile^ file) 
    1.51 +        {
    1.52 +            return FileIO::ReadBufferAsync(file);
    1.53 +        }).then([] (Streams::IBuffer^ fileBuffer) -> Platform::Array<byte>^ 
    1.54 +        {
    1.55 +            auto fileData = ref new Platform::Array<byte>(fileBuffer->Length);
    1.56 +            Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(fileData);
    1.57 +            return fileData;
    1.58 +        });
    1.59 +    }
    1.60  }