/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
mIndexInvertedMovementArea = mRenderer.RegisterUniqueProperty("uInvertedMovementArea", Vector2(1.f, 1.f) / movementArea);
mIndicesOffset.resize(9);
- int offset = movementArea.Length() / 10.f;
+ int offset = std::max(static_cast<int>(movementArea.Length() / 10.f), 1); // To avoid divide by zero issue.
- unsigned int seed = time(NULL);
+ uint32_t seed = static_cast<uint32_t>(time(NULL));
mIndicesOffset[0] = mRenderer.RegisterUniqueProperty("uOffset[0]", Vector2(0.f, 0.f));
mIndicesOffset[1] = mRenderer.RegisterUniqueProperty("uOffset[1]", Vector2(rand_r(&seed) % offset, rand_r(&seed) % offset));