Tidy up readme, add TCC WIP compile instructions

This commit is contained in:
UnknownShadow200 2021-07-24 13:51:30 +10:00
parent 5aaefd4510
commit 907ddd90cd
2 changed files with 27 additions and 13 deletions

View File

@ -36,7 +36,7 @@ If you're on Windows, you should first try using the MESA software renderer from
Otherwise, you will have to [compile the game yourself](#using-visual-studio-command-line). Don't forget to add `-DCC_BUILD_GL11` to the compilation command line so that the compiled game supports OpenGL 1.1. Otherwise, you will have to [compile the game yourself](#using-visual-studio-command-line). Don't forget to add `-DCC_BUILD_GL11` to the compilation command line so that the compiled game supports OpenGL 1.1.
### Compiling - Windows ## Compiling - Windows
##### Using Visual Studio ##### Using Visual Studio
Open ClassiCube.sln *(File -> Open -> Project/Solution)* and compile it *(Build -> Build Solution)*. Open ClassiCube.sln *(File -> Open -> Project/Solution)* and compile it *(Build -> Build Solution)*.
@ -62,7 +62,16 @@ I am assuming you used the installer from http://www.mingw.org/
3. Navigate to directory with game's source code 3. Navigate to directory with game's source code
4. Enter `gcc *.c -o ClassiCube.exe -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -ld3d9` 4. Enter `gcc *.c -o ClassiCube.exe -mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -ld3d9`
### Compiling - Linux ##### Using TCC
I am assuming you used `tcc-0.9.27-win64-bin.zip` from https://bellard.org/tcc/
1. Extract the .zip file
2. In `ExtMath.C`, change `fabsf` to `fabs` and `sqrtf` to `sqrtf`
3. In TCC's `include/math.h`, remove the inline definition for `fabs` at around line 217
4. In TCC's `lib/kernel32.def`, add missing `RtlCaptureContext`
5. Add missing include files from `winapi-full-for-0.9.27.zip` as required
6. ???
## Compiling - Linux
##### Using gcc/clang ##### Using gcc/clang
@ -79,7 +88,7 @@ Although the regular linux compiliation flags will work fine, to take full advan
```gcc *.c -o ClassiCube -DCC_BUILD_RPI -lm -lpthread -lX11 -lEGL -lGLESv2 -ldl``` ```gcc *.c -o ClassiCube -DCC_BUILD_RPI -lm -lpthread -lX11 -lEGL -lGLESv2 -ldl```
### Compiling - macOS ## Compiling - macOS
##### Using gcc/clang (32 bit) ##### Using gcc/clang (32 bit)
@ -89,7 +98,7 @@ Although the regular linux compiliation flags will work fine, to take full advan
```cc *.c interop_cocoa.m -o ClassiCube -framework Cocoa -framework OpenGL -framework IOKit -lobjc``` ```cc *.c interop_cocoa.m -o ClassiCube -framework Cocoa -framework OpenGL -framework IOKit -lobjc```
### Compiling - other desktop OSes ## Compiling - other desktop OSes
#### FreeBSD #### FreeBSD
@ -123,7 +132,7 @@ Install libsdl2_devel, openal_devel, and libexecinfo_devel package if needed.
NOTE: You have to change entry->d_type == DT_DIR to Directory_Exists(&path) (TODO do this automatically) NOTE: You have to change entry->d_type == DT_DIR to Directory_Exists(&path) (TODO do this automatically)
### Compiling - other ## Compiling - other
#### Web #### Web
@ -146,16 +155,16 @@ iOS version is unfinished because of lack of access to suitable devices for me t
You'll have to write the necessary code. You should read portability.md in doc folder. You'll have to write the necessary code. You should read portability.md in doc folder.
### Known compilation errors ## Documentation
[Fixes for compilation errors when using musl or old glibc for C standard library](doc/compile-fixes.md#common-compilation-errors)
### Documentation
Functions and variables in .h files are mostly documented. Functions and variables in .h files are mostly documented.
Further information (e.g. style) for the game's source code can be found in the doc and misc folders. Further information (e.g. style) for the game's source code can be found in the doc and misc folders.
#### Known compilation errors
[Fixes for compilation errors when using musl or old glibc for C standard library](doc/compile-fixes.md#common-compilation-errors)
#### Tips #### Tips
* Press escape (after joining a world) or pause to switch to the pause menu. * Press escape (after joining a world) or pause to switch to the pause menu.
* Pause menu -> Options -> Controls lists all of the key combinations used by the client. * Pause menu -> Options -> Controls lists all of the key combinations used by the client.
@ -174,4 +183,4 @@ Further information (e.g. style) for the game's source code can be found in the
* [GCC](https://gcc.gnu.org/) - Compiles client for linux * [GCC](https://gcc.gnu.org/) - Compiles client for linux
* [MinGW-w64](http://mingw-w64.org/doku.php) - Compiles client for windows * [MinGW-w64](http://mingw-w64.org/doku.php) - Compiles client for windows
* [Clang](https://clang.llvm.org/) - Compiles client for macOS * [Clang](https://clang.llvm.org/) - Compiles client for macOS
* [Emscripten](https://emscripten.org/) - Compiles client for web * [Emscripten](https://emscripten.org/) - Compiles client for web

View File

@ -19,12 +19,17 @@
#include <windows.h> #include <windows.h>
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <wincrypt.h>
/* === BEGIN shellapi.h === */ /* === BEGIN shellapi.h === */
#define SHELLAPI DECLSPEC_IMPORT #define SHELLAPI DECLSPEC_IMPORT
SHELLAPI HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); SHELLAPI HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR operation, LPCWSTR file, LPCWSTR parameters, LPCWSTR directory, INT showCmd);
/* === END shellapi.h === */ /* === END shellapi.h === */
/* === BEGIN wincrypt.h === */
typedef struct _CRYPTOAPI_BLOB {
DWORD cbData;
BYTE* pbData;
} DATA_BLOB;
/* === END wincrypt.h === */
static HANDLE heap; static HANDLE heap;
const cc_result ReturnCode_FileShareViolation = ERROR_SHARING_VIOLATION; const cc_result ReturnCode_FileShareViolation = ERROR_SHARING_VIOLATION;