Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

Commit a844fa6

Browse files
Merge branch 'master' of https://github.com/MCHSL/extools
2 parents 31fe04d + 8b98ed5 commit a844fa6

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

README.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Most of development of [Lunar-Dreamland](https://github.com/goonstation/Lunar-Dr
88
Here are the modules currently available (not counting the core). Scroll to the bottom to see install instructions.
99

1010
#### TFFI
11-
Threaded FFI for BYOND. Automagically threads off all DLL calls and prevents them from locking up the game until they return. You may use a Promise datum, pass a callback or simply sleep until the call returns.
11+
Threaded FFI for BYOND. Automagically threads off all DLL calls and prevents them from locking up the game until they return. You may use a Promise datum, pass a callback (global or an object) or simply sleep until the call returns.
1212

1313
Calls the do_work function from sample.dll with 3 arguments. The proc sleeps until do_work returns.
1414
```
@@ -24,12 +24,20 @@ var/datum/promise/P = call_async("sample.dll", "do_work", "arg1")
2424
var/result = P.resolve()
2525
```
2626

27-
Calls do_work with 2 arguments. The callback is invoked with the result as the single argument. Execution resumes immediately.
27+
Calls do_work with 2 arguments. The callback, a global proc, is invoked with the result as the single argument. Execution resumes immediately.
2828
```
2929
/proc/print_result(result)
3030
world << result
3131
32-
call_cb("sample.dll", "do_work", /proc/print_result, "arg1", "arg2")
32+
call_cb("sample.dll", "do_work", GLOBAL_PROC, /proc/print_result, "arg1", "arg2")
33+
```
34+
35+
Calls do_work with 3 arguments. The callback is invoked on the target object, with the result as the single argument. Execution resumes immediately.
36+
```
37+
/mob/proc/tell_result(result)
38+
src << result
39+
40+
call_cb("sample.dll", "do_work", mob, /mob.proc/print_result, "arg1", "arg2", "arg3")
3341
```
3442

3543
## What will I be able to do with this?
@@ -42,10 +50,46 @@ These modules are planned to be included in the future.
4250
- Proxy objects: Forward variable reads and writes to C++.
4351
- Websockets: Send and receive data using the websocket protocol.
4452
- Lua: Allows writing lua scripts that replace builtin procs. Mostly for messing about.
53+
- Optimizer: Optimizes bytecode and inlines procs into each other to avoid call overhead.
4554

4655
## I want to use this!
4756
Download the DLL and .dm file from [Releases](https://github.com/MCHSL/extools/releases). Place the DLL next to your DMB and plop the .dm somewhere where you can easily tick it. Afterwards, add `extools_initialize()` to `world/New()` or equivalent. To load modules, call `<module>_initialize()`, for example `tffi_initialize()`. Module initialization functions must be called after `extools_initialize()`!
4857

58+
## How do I compile this?
59+
You need [CMake](https://cmake.org/download/), at least version 3.15.
60+
### Windows
61+
You need Visual Studio, preferably 2019. Be sure to include the "C++ CMake tools for Windows".
62+
Create a folder next to "byond-extools" called "build". Use this as the CMake "where to build your binaries" directory.
63+
You can use the CMake GUI. Ensure that you select **Win32**!
64+
65+
![](https://i.imgur.com/4Sg9ECc.gif)
66+
67+
If you choose to use CMake from the command line:
68+
```
69+
D:\Code\C++\extools\byond-extools\build> cmake -G "Visual Studio 16 2019" -A Win32 ..
70+
-- The C compiler identification is MSVC 19.23.28106.4
71+
-- The CXX compiler identification is MSVC 19.23.28106.4
72+
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe
73+
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe -- works
74+
-- Detecting C compiler ABI info
75+
-- Detecting C compiler ABI info - done
76+
-- Detecting C compile features
77+
-- Detecting C compile features - done
78+
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe
79+
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x86/cl.exe -- works
80+
-- Detecting CXX compiler ABI info
81+
-- Detecting CXX compiler ABI info - done
82+
-- Detecting CXX compile features
83+
-- Detecting CXX compile features - done
84+
-- Configuring done
85+
-- Generating done
86+
-- Build files have been written to: D:/Code/C++/extools/byond-extools/build
87+
D:\Code\C++\extools\byond-extools\build>
88+
```
89+
90+
## Linux
91+
You can just make the build directory and do `cmake ..` and then `make`.
92+
32-bit is automatically forced when compiling on Linux.
4993

5094
## Credits
5195
Thank you to people who contributed in one way or another to the overall effort.

0 commit comments

Comments
 (0)