}
else
{
- GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(mBuffer.size()));
+ GLTF_LOG( "GLTF: %s loaded, size = %d", binFile.c_str(), int(jsonBuffer.size()));
}
// Abort if errors
std::vector<unsigned char> buffer;
if( fin )
{
- fseek( fin, 0, SEEK_END );
+ if( fseek( fin, 0, SEEK_END ) )
+ {
+ return {};
+ }
auto size = ftell(fin);
- fseek( fin, 0, SEEK_SET );
+ if( fseek( fin, 0, SEEK_SET ) )
+ {
+ return {};
+ }
buffer.resize(unsigned(size));
auto result = fread( buffer.data(), 1, size_t(size), fin );
- if( result < 0 )
+ if( result != size_t(size) )
{
GLTF_LOG("LoadFile: Result: %d", int(result));
// return empty buffer
}
private:
+
Application& mApplication;
- Layer mLayer3D;
+ Layer mLayer3D{};
- std::vector<Actor> mActors;
- std::vector<CameraActor> mCameras;
- std::vector<std::unique_ptr<Model>> mModels;
- std::vector<TextureSet> mTextureSets;
+ std::vector<Actor> mActors {};
+ std::vector<CameraActor> mCameras {};
+ std::vector<std::unique_ptr<Model>> mModels {};
+ std::vector<TextureSet> mTextureSets {};
- Animation mAnimation;
- float mMockTime = 0.0f;
- float mKFactor = 0.0f;
- Property::Index mSunTimeUniformIndex;
- Property::Index mSunKFactorUniformIndex;
- PanGestureDetector mPanGestureDetector;
+ Animation mAnimation {};
+ float mMockTime { 0.0f };
+ float mKFactor { 0.0f };
+ Property::Index mSunTimeUniformIndex {};
+ Property::Index mSunKFactorUniformIndex {};
+ PanGestureDetector mPanGestureDetector {};
- Vector3 mCameraPos;
- Vector3 mLightDir;
- Timer mTickTimer;
+ Vector3 mCameraPos { Vector3::ZERO };
+ Vector3 mLightDir { Vector3::ZERO };
+ Timer mTickTimer {};
- CameraActor mCamera3D;
- CameraActor mReflectionCamera3D;
- Actor mCenterActor;
- Actor mCenterHorizActor;
+ CameraActor mCamera3D {};
+ CameraActor mReflectionCamera3D {};
+ Actor mCenterActor {};
+ Actor mCenterHorizActor {};
};
int DALI_EXPORT_API main( int argc, char **argv )