equal
deleted
inserted
replaced
1 /* $Id$ */ |
1 /* $Id$ */ |
2 |
2 |
3 /** @file random_func.cpp */ |
3 /** @file random_func.cpp */ |
4 |
4 |
5 #include "../stdafx.h" |
5 #include "../stdafx.h" |
6 #include "../macros.h" |
|
7 #include "../variables.h" |
|
8 #include "random_func.hpp" |
6 #include "random_func.hpp" |
|
7 #include "bitmath_func.hpp" |
|
8 |
|
9 uint32 _random_seeds[2][2]; |
9 |
10 |
10 uint32 InteractiveRandom() |
11 uint32 InteractiveRandom() |
11 { |
12 { |
12 const uint32 s = _random_seeds[1][0]; |
13 const uint32 s = _random_seeds[1][0]; |
13 const uint32 t = _random_seeds[1][1]; |
14 const uint32 t = _random_seeds[1][1]; |
123 _random_seeds[1][0] = seed * 0x1234567; |
124 _random_seeds[1][0] = seed * 0x1234567; |
124 _random_seeds[1][1] = _random_seeds[1][0]; |
125 _random_seeds[1][1] = _random_seeds[1][0]; |
125 } |
126 } |
126 |
127 |
127 #ifdef RANDOM_DEBUG |
128 #ifdef RANDOM_DEBUG |
128 #include "network/network_data.h" |
129 #include "../network/network_data.h" |
129 uint32 DoRandom(int line, const char *file) |
130 uint32 DoRandom(int line, const char *file) |
130 { |
131 { |
131 if (_networking && (DEREF_CLIENT(0)->status != STATUS_INACTIVE || !_network_server)) |
132 if (_networking && (DEREF_CLIENT(0)->status != STATUS_INACTIVE || !_network_server)) |
132 printf("Random [%d/%d] %s:%d\n",_frame_counter, (byte)_current_player, file, line); |
133 printf("Random [%d/%d] %s:%d\n",_frame_counter, (byte)_current_player, file, line); |
133 #else /* RANDOM_DEBUG */ |
134 #else /* RANDOM_DEBUG */ |