Compare commits
5 Commits
04d1969084
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 032b38833d | |||
| 78a2fc0b06 | |||
| 5e77586a8d | |||
| a8ca1edaef | |||
| 54a7662952 |
@@ -9,3 +9,5 @@ snapshots
|
|||||||
OUTPUT-Linux
|
OUTPUT-Linux
|
||||||
OUTPUT-w64
|
OUTPUT-w64
|
||||||
OUTPUT-w32
|
OUTPUT-w32
|
||||||
|
makeheaders/makeheaders.exe
|
||||||
|
makeheaders/makeheaders
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Compiling
|
||||||
|
### NOTICE: Clone the repository with `-recursive`, e.g `git clone ... -recursive`
|
||||||
|
## Compiling on Linux
|
||||||
|
1) Install tools.
|
||||||
|
### Debian-based distros:
|
||||||
|
#### Essential stuff:
|
||||||
|
```sh
|
||||||
|
sudo apt install build-essential cmake zip unzip make libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev
|
||||||
|
```
|
||||||
|
#### If you also want to compile for Windows:
|
||||||
|
```sh
|
||||||
|
sudo apt install g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-i686 gcc-mingw-w64-i686
|
||||||
|
```
|
||||||
|
|
||||||
|
### Arch-based distros:
|
||||||
|
#### Essential stuff:
|
||||||
|
```sh
|
||||||
|
sudo pacman -S --needed base-devel cmake zip unzip libxcursor libxinerama libxi libxrandr wayland-utils mesa glu libglvnd alsa-lib pulseaudio
|
||||||
|
```
|
||||||
|
#### If you also want to compile for Windows:
|
||||||
|
```sh
|
||||||
|
sudo pacman -S --needed mingw-w64-gcc
|
||||||
|
```
|
||||||
|
|
||||||
|
2) Run `compile.sh` to compile for Linux, 64-bit Windows & 32-bit Windows.
|
||||||
|
Run `compile_linux.sh` to compile for Linux only.
|
||||||
|
|
||||||
|
## Compiling on Windows
|
||||||
|
1) Install [CMake](https://cmake.org/download/), [Ninja](https://ninja-build.org/) and [MinGW](https://www.mingw-w64.org/).
|
||||||
|
Try them out in the terminal: `cmake -version`, `ninja --version`, `gcc -version`, `g++ -version`.
|
||||||
|
If some are missing, add them to PATH.
|
||||||
|
|
||||||
|
2) From the terminal, run `compile.ps1`.
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
cd makeheaders
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
./makeheaders/makeheaders.exe -h src/helpers/vars.hpp src/helpers/chunks.cpp src/helpers/debug.cpp src/helpers/entities.cpp src/helpers/input.cpp src/helpers/menu.cpp src/helpers/mesher.cpp src/helpers/networking.cpp src/helpers/utils.cpp src/helpers/inlines.hpp src/helpers/inventory.cpp src/helpers/locale.cpp src/helpers/recipes.cpp src/helpers/particles.cpp src/helpers/player.cpp src/helpers/multisound.cpp -v > tmp.hpp
|
||||||
|
Get-Content .\additions.hpp, .\tmp.hpp | Out-File .\src\helpers\common.hpp -Encoding UTF8
|
||||||
|
rm tmp.hpp
|
||||||
|
|
||||||
|
echo Building x86-64 Windows...
|
||||||
|
rm build
|
||||||
|
cmake -DCMAKE_TOOLCHAIN_FILE='toolchains/mingw-w64-native.cmake' . -DWIN32=ON -DWIN32=true -B build -G "Ninja"
|
||||||
|
cmake --build build
|
||||||
|
mkdir OUTPUT-w64
|
||||||
|
cp build/src/RCRAFT.exe OUTPUT-w64/CubeGame.exe
|
||||||
|
cp -r data/resources OUTPUT-w64
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#/usr/bin/bash
|
#/usr/bin/bash
|
||||||
|
|
||||||
|
cd makeheaders
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
|
||||||
sh compile_linux.sh
|
sh compile_linux.sh
|
||||||
sh compile_windows_64.sh
|
sh compile_windows_64.sh
|
||||||
sh compile_windows.sh
|
sh compile_windows.sh
|
||||||
+1
-3
@@ -7,9 +7,7 @@ rm tmp.hpp
|
|||||||
echo Building x86-64 Linux...
|
echo Building x86-64 Linux...
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -B build -DUNIX=ON -DUNIX=true -DCMAKE_BUILD_TYPE=Debug
|
cmake -B build -DUNIX=ON -DUNIX=true -DCMAKE_BUILD_TYPE=Debug
|
||||||
cd build
|
cmake --build build
|
||||||
make -j12
|
|
||||||
cd ..
|
|
||||||
mkdir OUTPUT-Linux
|
mkdir OUTPUT-Linux
|
||||||
cp build/src/RCRAFT OUTPUT-Linux/CubeGame
|
cp build/src/RCRAFT OUTPUT-Linux/CubeGame
|
||||||
cp -r data/resources OUTPUT-Linux
|
cp -r data/resources OUTPUT-Linux
|
||||||
+1
-3
@@ -7,9 +7,7 @@ rm tmp.hpp
|
|||||||
echo Building i686 Windows...
|
echo Building i686 Windows...
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w32.cmake -DWIN32=ON -DWIN32=true -B build
|
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w32.cmake -DWIN32=ON -DWIN32=true -B build
|
||||||
cd build
|
cmake --build build
|
||||||
make -j12
|
|
||||||
cd ..
|
|
||||||
mkdir OUTPUT-w32
|
mkdir OUTPUT-w32
|
||||||
cp build/src/RCRAFT.exe OUTPUT-w32/CubeGame.exe
|
cp build/src/RCRAFT.exe OUTPUT-w32/CubeGame.exe
|
||||||
cp -r data/resources OUTPUT-w32
|
cp -r data/resources OUTPUT-w32
|
||||||
@@ -7,9 +7,7 @@ rm tmp.hpp
|
|||||||
echo Building x86-64 Windows...
|
echo Building x86-64 Windows...
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w64.cmake -DWIN32=ON -DWIN32=true -B build
|
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w64.cmake -DWIN32=ON -DWIN32=true -B build
|
||||||
cd build
|
cmake --build build
|
||||||
make -j12
|
|
||||||
cd ..
|
|
||||||
mkdir OUTPUT-w64
|
mkdir OUTPUT-w64
|
||||||
cp build/src/RCRAFT.exe OUTPUT-w64/CubeGame.exe
|
cp build/src/RCRAFT.exe OUTPUT-w64/CubeGame.exe
|
||||||
cp -r data/resources OUTPUT-w64
|
cp -r data/resources OUTPUT-w64
|
||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
#ifdef WIN32 // FUCK WINDOWS
|
#ifdef WIN32 // FUCK WINDOWS
|
||||||
#include "external/fix_win32_compatibility.h"
|
#include "external/fix_win32_compatibility.h"
|
||||||
#undef PlaySound
|
#undef PlaySound
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -488,10 +488,10 @@ void DrawWorldSelect() {
|
|||||||
DrawBackground();
|
DrawBackground();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(std::filesystem::path path : worldList) {
|
for(std::filesystem::path path : worldList) {
|
||||||
if(Button(reinterpret_cast<const char*>(path.filename().u8string().c_str()), GetScreenWidth()/2-64, i*48+8, 128, 0)) {
|
if(Button(reinterpret_cast<const char*>(path.filename().string().c_str()), GetScreenWidth()/2-64, i*48+8, 128, 0)) {
|
||||||
online = false;
|
online = false;
|
||||||
SetTargetFPS(-1);
|
SetTargetFPS(-1);
|
||||||
_LoadWorld(reinterpret_cast<const char*>(path.u8string().c_str()));
|
_LoadWorld(reinterpret_cast<const char*>(path.string().c_str()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ ENetHost* StartServer() {
|
|||||||
/* Bind the server to port 1234. */
|
/* Bind the server to port 1234. */
|
||||||
address.port = PORT;
|
address.port = PORT;
|
||||||
|
|
||||||
server = enet_host_create(&address, 32, 1, 0);
|
server = enet_host_create(&address, 32, 1, 0, 0);
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
@@ -41,7 +41,8 @@ ENetHost* StartClient() {
|
|||||||
client = enet_host_create (NULL /* create a client host */,
|
client = enet_host_create (NULL /* create a client host */,
|
||||||
1 /* 1 channel*/,
|
1 /* 1 channel*/,
|
||||||
1 /* only allow 1 outgoing connection */,
|
1 /* only allow 1 outgoing connection */,
|
||||||
0 /* assume any amount of incoming bandwidth */);
|
0 /* assume any amount of incoming bandwidth */,
|
||||||
|
0);
|
||||||
|
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void LoadRecipes() {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Recipe _recipe;
|
Recipe _recipe;
|
||||||
const std::string path = dir_entry.path().u8string();
|
const std::string path = dir_entry.path().string();
|
||||||
std::cout << "loading " << path << std::endl;
|
std::cout << "loading " << path << std::endl;
|
||||||
YAML::Node recipe = YAML::LoadFile(path);
|
YAML::Node recipe = YAML::LoadFile(path);
|
||||||
_recipe.requiredStation = recipe["station"].as<std::string>();
|
_recipe.requiredStation = recipe["station"].as<std::string>();
|
||||||
|
|||||||
+1
-1
Submodule src/libraries/enet updated: 8b43b92591...5a9c537fd4
@@ -0,0 +1,14 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER g++)
|
||||||
|
set(CMAKE_RC_COMPILER windres)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ ${CMAKE_C_FLAGS}")
|
||||||
|
set(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++ ${CMAKE_CXX_FLAGS}")
|
||||||
Reference in New Issue
Block a user