Files
o3de/Code/Legacy/CryCommon/Random.h
T
Artur K 2a2847b15d Legacy code cleanup - part 3 (#3903)
* Legacy cleanup - part 3

Not much is left that can be easily removed,
so I think this will be last cleanup before the legacy functionality is replaced.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* fix windows build, remove a few more things, re-add one file

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove legacy RenderBus + more cleanups

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Remove MaterialOwnerBus.h

Clean-up in Cry_Matrix34/33

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
2021-09-07 12:14:16 -06:00

35 lines
877 B
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include "BaseTypes.h"
#include "LCGRandom.h"
namespace CryRandom_Internal
{
// Private access point to the global random number generator.
extern CRndGen g_random_generator;
}
inline uint32 cry_random_uint32()
{
return CryRandom_Internal::g_random_generator.GenerateUint32();
}
// Ranged function returns random value within the *inclusive* range
// between minValue and maxValue.
// Any orderings work correctly: minValue <= maxValue and
// minValue >= minValue.
template <class T>
inline T cry_random(const T minValue, const T maxValue)
{
return CryRandom_Internal::g_random_generator.GetRandom(minValue, maxValue);
}