/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <memory.h>
#include <stdio.h>
#include <stdint.h>
+#include <dali/integration-api/debug.h>
+#include <dali/devel-api/adaptor-framework/file-stream.h>
namespace PbrDemo
{
bool LoadCubeMapFromKtxFile( const std::string& path, CubeData& cubedata )
{
- FILE* fp = fopen(path.c_str(),"rb");
-
+ Dali::FileStream fileStream( path, Dali::FileStream::READ | Dali::FileStream::BINARY );
+ FILE* fp = fileStream.GetFile();
if( NULL == fp )
{
return false;
int result = fread(&header,1,sizeof(KtxFileHeader),fp);
if( 0 == result )
{
- fclose( fp );
return false;
}
if( fseek(fp, imageSizeOffset, SEEK_END) )
{
- fclose( fp );
return false;
}
lSize = ftell(fp);
if( lSize == -1L )
{
- fclose( fp );
return false;
}
if( fseek(fp, imageSizeOffset, SEEK_SET) )
{
- fclose( fp );
return false;
}