Skip to content
Snippets Groups Projects
Commit 0331c0f5 authored by Gontier Antonin's avatar Gontier Antonin :fox:
Browse files

Merge branch 'dev'

Reprise propre du git
parents 16efb9b7 61cc0c0f
No related branches found
No related tags found
No related merge requests found
/*
This file is part of Leela Zero.
Copyright (C) 2017 Gian-Carlo Pascutto
Leela Zero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Leela Zero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Leela Zero. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UTILS_H_DEFINED
#define UTILS_H_DEFINED
#include <atomic>
#include <limits>
#include "ThreadPool.h"
#include <vector>
#include <ale_interface.hpp>
#include <SDL.h>
extern Utils::ThreadPool thread_pool;
extern ALEInterface ALE;
namespace Utils {
template<class T>
void atomic_add(std::atomic<T> &f, T d) {
T old = f.load();
while (!f.compare_exchange_weak(old, old + d));
}
template<typename T>
T rotl(const T x, const int k) {
return (x << k) | (x >> (std::numeric_limits<T>::digits - k));
}
inline bool is7bit(int c) {
return c >= 0 && c <= 127;
}
size_t ceilMultiple(size_t a, size_t b);
inline int secam_to_range_index(int i);
void secam210x160_to_42x32(const std::vector<unsigned char>& screen,
std::vector<unsigned char>& screen42x32);
void init_ALE();
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment