Fixes on FreeBSD
This commit is contained in:
parent
39122a6e51
commit
97e4fdaf58
@ -187,6 +187,18 @@ to reduce used disk space via not downloading entire git history.
|
||||
11. Generate build files using `cmake ..`. You may want to add additional arguments to CMake, see *`CMakeLists.txt` documentation* section.
|
||||
12. Build project using `make -j$(nproc)`.
|
||||
|
||||
### FreeBSD
|
||||
1. Install required tools (you can use Ninja instead of GNU Make if you like): `sudo pkg install cmake gmake` or `sudo pkg install cmake ninja`.
|
||||
2. Clone repository with following command: `git clone http://git.cubesoftware.xyz:20524/PolyGun/PolyGun.git`. You can add `--depth=1` argument
|
||||
to reduce used disk space via not downloading entire git history.
|
||||
3. Install required libraries. Libraries may vary depending on what build configuration you will use. This tutorial assumes full build.
|
||||
`sudo pkg install xorg-minimal glm openal vorbis png freetype`. `ogg` and `zlib` will be installed automatically because they
|
||||
are dependencies of `vorbis` and `png`
|
||||
4. Make build directory using `mkdir build`.
|
||||
5. Enter build directory using `cd build`.
|
||||
6. Generate build files using `cmake ..` or `cmake .. -G Ninja` if you are using Ninja build system. You may want to add additional arguments to CMake, see *`CMakeLists.txt` documentation* section.
|
||||
7. Build project using `gmake -j$(nproc)` or `ninja` depending on your selected build system.
|
||||
|
||||
### SerenityOS
|
||||
This documentation assumes full build (client and server).
|
||||
1. Install following ports: `gcc` (alternatively `clang`), `cmake`, `glm`, `libopenal`, `libvorbis`, `libpng`, `freetype`, `git`.
|
||||
|
@ -24,6 +24,8 @@ SOFTWARE.
|
||||
|
||||
#include "common/math/rect3d.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace polygun::math;
|
||||
|
||||
Rect3D::Rect3D(const glm::vec3& pos, const glm::vec3& size) :
|
||||
|
@ -35,6 +35,9 @@ using namespace polygun::network;
|
||||
#elif defined(_WIN32)
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#if defined(__unix__)
|
||||
#define INVALID_SOCK 1
|
||||
@ -83,7 +86,7 @@ void TCPSocket::connect(const std::string& ip, unsigned short port) {
|
||||
}
|
||||
|
||||
bool TCPSocket::send(const char* data, unsigned size) const {
|
||||
#if defined(_WIN32) || defined(__serenityos__)
|
||||
#if defined(_WIN32) || defined(__serenityos__) || defined(__FreeBSD__)
|
||||
const int flags = 0;
|
||||
#elif defined(__unix__)
|
||||
const int flags = MSG_CONFIRM;
|
||||
|
@ -100,7 +100,7 @@ void UDPSocket::bind(unsigned short port) {
|
||||
}
|
||||
|
||||
bool UDPSocket::send(const NetworkPacket& packet, const NetworkEndpoint& target) const {
|
||||
#if defined(_WIN32) || defined(__serenityos__)
|
||||
#if defined(_WIN32) || defined(__serenityos__) || defined(__FreeBSD__)
|
||||
const int flags = 0;
|
||||
#elif defined(__unix__)
|
||||
const int flags = MSG_CONFIRM;
|
||||
|
@ -104,7 +104,7 @@ namespace polygun::world {
|
||||
default:
|
||||
LOG_ERROR("Unknown chunk compression mode, assuming none");
|
||||
case ChunkCompressionMode::CHUNK_COMPRESSION_MODE_NONE:
|
||||
for(uint16_t i = 0; i<data_size/2 && i<sizeof(m_chunk_data); i++)
|
||||
for(uint16_t i = 0; i<data_size/2; i++)
|
||||
m_chunk_data[i] = utils::bytes_to_uint16(&data[i*2]);
|
||||
break;
|
||||
case ChunkCompressionMode::CHUNK_COMPRESSION_MODE_HUFFMAN: {
|
||||
|
@ -45,8 +45,8 @@ LocalPlayer::LocalPlayer(unsigned uuid, const glm::vec3& initial_pos, std::uniqu
|
||||
|
||||
void LocalPlayer::update(float delta) {
|
||||
Player::update(delta);
|
||||
m_rot+=m_camera_controller->get_offset().x;
|
||||
m_pitch+=m_camera_controller->get_offset().y;
|
||||
m_rot+=m_camera_controller->get_offset().x*m_mouse_sensitivity;
|
||||
m_pitch+=m_camera_controller->get_offset().y*m_mouse_sensitivity;
|
||||
m_rot = m_rot<0?359:m_rot;
|
||||
m_rot = m_rot>359?0:m_rot;
|
||||
m_pitch = std::max(std::min(m_pitch, 89.0f), -89.0f);
|
||||
|
@ -32,6 +32,9 @@ SOFTWARE.
|
||||
#if defined(__unix__)
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include "common/math/rect3d.hpp"
|
||||
#include "common/logger.hpp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user