| 39 | } |
| 40 | |
| 41 | int Log2i(int x) |
| 42 | { |
| 43 | int n = 0; |
| 44 | while (x > 1) |
| 45 | { |
| 46 | x >>= 1; |
| 47 | ++n; |
| 48 | } |
| 49 | return n; |
| 50 | } |
| 51 | |
| 52 | // Read a whole file. Prefer the engine's FileServer when available (so PBO / |
| 53 | // search-path resolution works); fall back to std::ifstream in unit-test |