SQCSimulator2023/SQCSim-common/define.h

56 lines
1022 B
C
Raw Normal View History

2023-09-18 15:56:17 -04:00
#ifndef DEFINE_H__
#define DEFINE_H__
#include <iostream>
2023-09-25 08:23:52 -04:00
#include <chrono>
2023-09-18 15:56:17 -04:00
2023-09-24 08:45:40 -04:00
#define SRV_PORT 1025
#define CLI_PORT 1026
2023-09-25 08:23:52 -04:00
#define CHUNK_SIZE_X 4
#define CHUNK_SIZE_Y 64
#define CHUNK_SIZE_Z 4
#define MAX_SELECTION_DISTANCE 5
#define SEED 12345
2023-09-25 17:17:17 -04:00
#define COUNTDOWN 300
2023-09-25 08:23:52 -04:00
2023-09-18 15:56:17 -04:00
#define WORLD_SIZE_X 64
#define WORLD_SIZE_Y 64
2023-09-25 08:23:52 -04:00
#define VIEW_DISTANCE 512
#define TEXTURE_SIZE 512
#define MAX_BULLETS 512
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
typedef uint8_t BlockType;
enum BLOCK_TYPE { BTYPE_AIR, BTYPE_DIRT, BTYPE_GRASS, BTYPE_METAL, BTYPE_ICE, BTYPE_LAST };
2023-09-25 16:30:03 -04:00
typedef uint64_t Timestamp;
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
#ifdef _WIN32
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
#pragma comment(lib,"wsock32.lib") // Pour pouvoir faire fonctionner le linker sans le vcxproject
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
#include <Windows.h>
#include <cstdio>
#include <ctime>
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
#define popen _popen
#define pclose _pclose
2023-09-18 15:56:17 -04:00
2023-09-25 08:23:52 -04:00
#else // Pas _WIN32
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#define SOCKET int
#define INVALID_SOCKET -1
#define closesocket close
#endif // _WIN32
2023-09-18 15:56:17 -04:00
#endif // DEFINE_H__