[dali_2.3.42] Merge branch 'devel/master'
[platform/core/uifw/dali-demo.git] / examples / rendering-basic-pbr / ktx-loader.cpp
index bdd45e9..11c4532 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -69,7 +69,7 @@ bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Dali::Pixel::Format& form
     }
     case 0x8C3A: // GL_R11F_G11F_B10F
     {
-      format = Dali::Pixel::RGB32F;
+      format = Dali::Pixel::R11G11B10F;
       break;
     }
     case 0x8D7C: // GL_RGBA8UI
@@ -94,7 +94,7 @@ bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Dali::Pixel::Format& form
 bool LoadCubeMapFromKtxFile(const std::string& path, CubeData& cubedata)
 {
   Dali::FileStream daliFileStream(path);
-  FILE* fp(daliFileStream.GetFile());
+  FILE*            fp(daliFileStream.GetFile());
   if(!fp)
   {
     return false;
@@ -108,7 +108,7 @@ bool LoadCubeMapFromKtxFile(const std::string& path, CubeData& cubedata)
   }
 
   // Skip the key-values:
-  if(fseek(fp, header.bytesOfKeyValueData, SEEK_CUR))
+  if(fseek(fp, (long int)(header.bytesOfKeyValueData), SEEK_CUR))
   {
     return false;
   }