File diff r15609:02b794721f9c → r15610:623a23fb6560
src/core/random_func.hpp
Show inline comments
 
@@ -62,22 +62,24 @@ extern Randomizer _interactive_random; /
 
/** Stores the state of all random number generators */
 
struct SavedRandomSeeds {
 
	Randomizer random;
 
	Randomizer interactive_random;
 
};
 

	
 
/** Saves the current seeds
 
/**
 
 * Saves the current seeds
 
 * @param storage Storage for saving
 
 */
 
static inline void SaveRandomSeeds(SavedRandomSeeds *storage)
 
{
 
	storage->random = _random;
 
	storage->interactive_random = _interactive_random;
 
}
 

	
 
/** Restores previously saved seeds
 
/**
 
 * Restores previously saved seeds
 
 * @param storage Storage where SaveRandomSeeds() stored th seeds
 
 */
 
static inline void RestoreRandomSeeds(const SavedRandomSeeds &storage)
 
{
 
	_random = storage.random;
 
	_interactive_random = storage.interactive_random;