Skip to content

Commit cadffe1

Browse files
committed
Merge commit '339419240c1a143f9c3d08d4518d507c5d055fe1'
# Conflicts: # src/d_main.cpp # src/doomdef.h # src/playsim/p_acs.cpp
2 parents c6b9d2e + 3394192 commit cadffe1

File tree

173 files changed

+15687
-1956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+15687
-1956
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ if (HAVE_VULKAN)
328328
add_subdirectory( libraries/glslang/OGLCompilersDLL )
329329
endif()
330330

331+
add_subdirectory( libraries/discordrpc )
332+
set( DRPC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/discordrpc/include" )
333+
set( DRPC_LIBRARIES discord-rpc )
334+
set( DRPC_LIBRARY discord-rpc )
335+
331336
if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB )
332337
message( STATUS "Using system zlib, includes found at ${ZLIB_INCLUDE_DIR}" )
333338
else()
@@ -386,7 +391,6 @@ else()
386391
set( BZIP2_LIBRARY bz2 )
387392
endif()
388393

389-
390394
set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/lzma/C" )
391395

392396
if( NOT CMAKE_CROSSCOMPILING )

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## LZDoom is a classic style GZDoom fork with lower system requirements
66

7-
Copyright (c) 1998-2021 ZDoom + GZDoom teams, and contributors
7+
Copyright (c) 1998-2022 ZDoom + GZDoom teams, and contributors
88

99
Doom Source (c) 1997 id Software, Raven Software, and contributors
1010

libraries/discordrpc/.clang-format

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
AccessModifierOffset: -4
3+
AlignAfterOpenBracket: true
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlines: Left
7+
AlignOperands: false
8+
AlignTrailingComments: true
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: InlineOnly
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: false
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BreakBeforeBinaryOperators: None
21+
BreakBeforeBraces: Stroustrup
22+
BreakBeforeInheritanceComma: true
23+
BreakBeforeTernaryOperators: true
24+
BreakConstructorInitializers: BeforeComma
25+
BreakStringLiterals: true
26+
ColumnLimit: 100
27+
CommentPragmas: ''
28+
CompactNamespaces: false
29+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
30+
ConstructorInitializerIndentWidth: 2
31+
ContinuationIndentWidth: 2
32+
Cpp11BracedListStyle: true
33+
DerivePointerAlignment: false
34+
DisableFormat: false
35+
FixNamespaceComments: true
36+
ForEachMacros: []
37+
IndentCaseLabels: false
38+
IncludeCategories:
39+
- Regex: '^("|<)stdafx\.h(pp)?("|>)'
40+
Priority: -1
41+
- Regex: '^<(W|w)indows.h>'
42+
Priority: 1
43+
- Regex: '^<'
44+
Priority: 2
45+
- Regex: '.*'
46+
Priority: 3
47+
IncludeIsMainRegex: '(_test|_win|_linux|_mac|_ios|_osx|_null)?$'
48+
IndentCaseLabels: false
49+
IndentWidth: 4
50+
IndentWrappedFunctionNames: false
51+
KeepEmptyLinesAtTheStartOfBlocks: false
52+
MacroBlockBegin: ''
53+
MacroBlockEnd: ''
54+
MaxEmptyLinesToKeep: 1
55+
NamespaceIndentation: None
56+
PenaltyBreakAssignment: 0
57+
PenaltyBreakBeforeFirstCallParameter: 1
58+
PenaltyBreakComment: 300
59+
PenaltyBreakFirstLessLess: 120
60+
PenaltyBreakString: 1000
61+
PenaltyExcessCharacter: 1000000
62+
PenaltyReturnTypeOnItsOwnLine: 9999999
63+
PointerAlignment: Left
64+
ReflowComments: true
65+
SortIncludes: false
66+
SortUsingDeclarations: true
67+
SpaceAfterCStyleCast: false
68+
SpaceAfterTemplateKeyword: true
69+
SpaceBeforeAssignmentOperators: true
70+
SpaceBeforeParens: ControlStatements
71+
SpaceInEmptyParentheses: false
72+
SpacesBeforeTrailingComments: 1
73+
SpacesInAngles: false
74+
SpacesInCStyleCastParentheses: false
75+
SpacesInContainerLiterals: true
76+
SpacesInParentheses: false
77+
SpacesInSquareBrackets: false
78+
Standard: Cpp11
79+
TabWidth: 4
80+
UseTab: Never
81+
---
82+
Language: Cpp
83+
---
84+
Language: ObjC
85+
ObjCBlockIndentWidth: 4
86+
ObjCSpaceAfterProperty: true
87+
ObjCSpaceBeforeProtocolList: false
88+
---
89+
Language: Java
90+
BasedOnStyle: Google
91+
BreakAfterJavaFieldAnnotations: true
92+
...

libraries/discordrpc/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build*/
2+
/.vscode/
3+
/thirdparty/
4+
.vs/
5+
.DS_Store

libraries/discordrpc/.travis.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
language: cpp
2+
3+
env:
4+
global:
5+
- CLANG_FORMAT_SUFFIX="-dummy" # don't use formatting on Travis, this is
6+
# needed not to use default 3.5 version
7+
# which is too old.
8+
9+
matrix:
10+
include:
11+
- os: linux
12+
env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
13+
addons:
14+
apt:
15+
sources:
16+
- ubuntu-toolchain-r-test
17+
packages:
18+
- g++-5
19+
- os: linux
20+
env: MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
21+
addons:
22+
apt:
23+
sources:
24+
- llvm-toolchain-trusty-4.0
25+
packages:
26+
- clang-4.0
27+
- os: linux
28+
env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
29+
addons:
30+
apt:
31+
sources:
32+
- llvm-toolchain-trusty-5.0
33+
packages:
34+
- clang-5.0
35+
- os: osx
36+
osx_image: xcode9
37+
38+
# prevent Travis from overwriting our CXX variables
39+
before_install:
40+
- eval "${MATRIX_EVAL}"
41+
- echo $CXX
42+
43+
script:
44+
- mkdir build
45+
- cd build
46+
- cmake -DCLANG_FORMAT_SUFFIX=$CLANG_FORMAT_SUFFIX -DWARNINGS_AS_ERRORS=On --config Release ..
47+
- cmake --build . -- -j2

libraries/discordrpc/CMakeLists.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required (VERSION 3.2.0)
2+
project (DiscordRPC)
3+
4+
include(GNUInstallDirs)
5+
6+
# format
7+
file(GLOB_RECURSE ALL_SOURCE_FILES
8+
include/*.h
9+
src/*.cpp src/*.h src/*.c
10+
)
11+
12+
# Set CLANG_FORMAT_SUFFIX if you are using custom clang-format, e.g. clang-format-5.0
13+
find_program(CLANG_FORMAT_CMD clang-format${CLANG_FORMAT_SUFFIX})
14+
15+
if (CLANG_FORMAT_CMD)
16+
add_custom_target(
17+
clangformat
18+
COMMAND ${CLANG_FORMAT_CMD}
19+
-i -style=file -fallback-style=none
20+
${ALL_SOURCE_FILES}
21+
DEPENDS
22+
${ALL_SOURCE_FILES}
23+
)
24+
endif(CLANG_FORMAT_CMD)
25+
26+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common/thirdparty)
27+
28+
# add subdirs
29+
30+
add_subdirectory(src)

libraries/discordrpc/LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright 2017 Discord, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

libraries/discordrpc/README.md

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Discord RPC
2+
3+
## Deprecation Notice
4+
5+
This library has been deprecated in favor of Discord's GameSDK. [Learn more here](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide)
6+
7+
---
8+
9+
This is a library for interfacing your game with a locally running Discord desktop client. It's known to work on Windows, macOS, and Linux. You can use the lib directly if you like, or use it as a guide to writing your own if it doesn't suit your game as is. PRs/feedback welcome if you have an improvement everyone might want, or can describe how this doesn't meet your needs.
10+
11+
Included here are some quick demos that implement the very minimal subset to show current status, and
12+
have callbacks for where a more complete game would do more things (joining, spectating, etc).
13+
14+
## Documentation
15+
16+
The most up to date documentation for Rich Presence can always be found on our [developer site](https://discordapp.com/developers/docs/rich-presence/how-to)! If you're interested in rolling your own native implementation of Rich Presence via IPC sockets instead of using our SDK—hey, you've got free time, right?—check out the ["Hard Mode" documentation](https://github.com/discordapp/discord-rpc/blob/master/documentation/hard-mode.md).
17+
18+
## Basic Usage
19+
20+
Zeroith, you should be set up to build things because you are a game developer, right?
21+
22+
First, head on over to the [Discord developers site](https://discordapp.com/developers/applications/me) and make yourself an app. Keep track of `Client ID` -- you'll need it here to pass to the init function.
23+
24+
### Unreal Engine 4 Setup
25+
26+
To use the Rich Presense plugin with Unreal Engine Projects:
27+
28+
1. Download the latest [release](https://github.com/discordapp/discord-rpc/releases) for each operating system you are targeting and the zipped source code
29+
2. In the source code zip, copy the UE plugin—`examples/unrealstatus/Plugins/discordrpc`—to your project's plugin directory
30+
3. At `[YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/`, create an `Include` folder and copy `discord_rpc.h` and `discord_register.h` to it from the zip
31+
4. Follow the steps below for each OS
32+
5. Build your UE4 project
33+
6. Launch the editor, and enable the Discord plugin.
34+
35+
#### Windows
36+
37+
- At `[YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/`, create a `Win64` folder
38+
- Copy `lib/discord-rpc.lib` and `bin/discord-rpc.dll` from `[RELEASE_ZIP]/win64-dynamic` to the `Win64` folder
39+
40+
#### Mac
41+
42+
- At `[YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/`, create a `Mac` folder
43+
- Copy `libdiscord-rpc.dylib` from `[RELEASE_ZIP]/osx-dynamic/lib` to the `Mac` folder
44+
45+
#### Linux
46+
47+
- At `[YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/`, create a `Linux` folder
48+
- Inside, create another folder `x86_64-unknown-linux-gnu`
49+
- Copy `libdiscord-rpc.so` from `[RELEASE_ZIP]/linux-dynamic/lib` to `Linux/x86_64-unknown-linux-gnu`
50+
51+
### Unity Setup
52+
53+
If you're a Unity developer looking to integrate Rich Presence into your game, follow this simple guide to get started towards success:
54+
55+
1. Download the DLLs for any platform that you need from [our releases](https://github.com/discordapp/discord-rpc/releases)
56+
2. In your Unity project, create a `Plugins` folder inside your `Assets` folder if you don't already have one
57+
3. Copy the file `DiscordRpc.cs` from [here](https://github.com/discordapp/discord-rpc/blob/master/examples/button-clicker/Assets/DiscordRpc.cs) into your `Assets` folder. This is basically your header file for the SDK
58+
59+
We've got our `Plugins` folder ready, so let's get platform-specific!
60+
61+
#### Windows
62+
63+
4. Create `x86` and `x86_64` folders inside `Assets/Plugins/`
64+
5. Copy `discord-rpc-win/win64-dynamic/bin/discord-rpc.dll` to `Assets/Plugins/x86_64/`
65+
6. Copy `discord-rpc-win/win32-dynamic/bin/discord-rpc.dll` to `Assets/Plugins/x86/`
66+
7. Click on both DLLs and make sure they are targetting the correct architectures in the Unity editor properties pane
67+
8. Done!
68+
69+
#### MacOS
70+
71+
4. Copy `discord-rpc-osx/osx-dynamic/lib/libdiscord-rpc.dylib` to `Assets/Plugins/`
72+
5. Rename `libdiscord-rpc.dylib` to `discord-rpc.bundle`
73+
6. Done!
74+
75+
#### Linux
76+
77+
4. Copy `discord-rpc-linux/linux-dynamic-lib/libdiscord-rpc.so` to `Assets/Plugins/`
78+
5. Done!
79+
80+
You're ready to roll! For code examples on how to interact with the SDK using the `DiscordRpc.cs` header file, check out [our example](https://github.com/discordapp/discord-rpc/blob/master/examples/button-clicker/Assets/DiscordController.cs)
81+
82+
### From package
83+
84+
Download a release package for your platform(s) -- they have subdirs with various prebuilt options, select the one you need add `/include` to your compile includes, `/lib` to your linker paths, and link with `discord-rpc`. For the dynamically linked builds, you'll need to ship the associated file along with your game.
85+
86+
### From repo
87+
88+
First-eth, you'll want `CMake`. There's a few different ways to install it on your system, and you should refer to [their website](https://cmake.org/install/). Many package managers provide ways of installing CMake as well.
89+
90+
To make sure it's installed correctly, type `cmake --version` into your flavor of terminal/cmd. If you get a response with a version number, you're good to go!
91+
92+
There's a [CMake](https://cmake.org/download/) file that should be able to generate the lib for you; Sometimes I use it like this:
93+
94+
```sh
95+
cd <path to discord-rpc>
96+
mkdir build
97+
cd build
98+
cmake .. -DCMAKE_INSTALL_PREFIX=<path to install discord-rpc to>
99+
cmake --build . --config Release --target install
100+
```
101+
102+
There is a wrapper build script `build.py` that runs `cmake` with a few different options.
103+
104+
Usually, I run `build.py` to get things started, then use the generated project files as I work on things. It does depend on `click` library, so do a quick `pip install click` to make sure you have it if you want to run `build.py`.
105+
106+
There are some CMake options you might care about:
107+
108+
| flag | default | does |
109+
| ---------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
110+
| `ENABLE_IO_THREAD` | `ON` | When enabled, we start up a thread to do io processing, if disabled you should call `Discord_UpdateConnection` yourself. |
111+
| `USE_STATIC_CRT` | `OFF` | (Windows) Enable to statically link the CRT, avoiding requiring users install the redistributable package. (The prebuilt binaries enable this option) |
112+
| [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/v3.7/variable/BUILD_SHARED_LIBS.html) | `OFF` | Build library as a DLL |
113+
| `WARNINGS_AS_ERRORS` | `OFF` | When enabled, compiles with `-Werror` (on \*nix platforms). |
114+
115+
## Continuous Builds
116+
117+
Why do we have three of these? Three times the fun!
118+
119+
| CI | badge |
120+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
121+
| TravisCI | [![Build status](https://travis-ci.org/discordapp/discord-rpc.svg?branch=master)](https://travis-ci.org/discordapp/discord-rpc) |
122+
| AppVeyor | [![Build status](https://ci.appveyor.com/api/projects/status/qvkoc0w1c4f4b8tj?svg=true)](https://ci.appveyor.com/project/crmarsh/discord-rpc) |
123+
| Buildkite (internal) | [![Build status](https://badge.buildkite.com/e103d79d247f6776605a15246352a04b8fd83d69211b836111.svg)](https://buildkite.com/discord/discord-rpc) |
124+
125+
## Sample: send-presence
126+
127+
This is a text adventure "game" that inits/deinits the connection to Discord, and sends a presence update on each command.
128+
129+
## Sample: button-clicker
130+
131+
This is a sample [Unity](https://unity3d.com/) project that wraps a DLL version of the library, and sends presence updates when you click on a button. Run `python build.py unity` in the root directory to build the correct library files and place them in their respective folders.
132+
133+
## Sample: unrealstatus
134+
135+
This is a sample [Unreal](https://www.unrealengine.com) project that wraps the DLL version of the library with an Unreal plugin, exposes a blueprint class for interacting with it, and uses that to make a very simple UI. Run `python build.py unreal` in the root directory to build the correct library files and place them in their respective folders.
136+
137+
## Wrappers and Implementations
138+
139+
Below is a table of unofficial, community-developed wrappers for and implementations of Rich Presence in various languages. If you would like to have yours added, please make a pull request adding your repository to the table. The repository should include:
140+
141+
- The code
142+
- A brief ReadMe of how to use it
143+
- A working example
144+
145+
###### Rich Presence Wrappers and Implementations
146+
147+
| Name | Language |
148+
| ------------------------------------------------------------------------- | --------------------------------- |
149+
| [Discord RPC C#](https://github.com/Lachee/discord-rpc-csharp) | C# |
150+
| [Discord RPC D](https://github.com/voidblaster/discord-rpc-d) | [D](https://dlang.org/) |
151+
| [discord-rpc.jar](https://github.com/Vatuu/discord-rpc 'Discord-RPC.jar') | Java |
152+
| [java-discord-rpc](https://github.com/MinnDevelopment/java-discord-rpc) | Java |
153+
| [Discord-IPC](https://github.com/jagrosh/DiscordIPC) | Java |
154+
| [Discord Rich Presence](https://npmjs.org/discord-rich-presence) | JavaScript |
155+
| [drpc4k](https://github.com/Bluexin/drpc4k) | [Kotlin](https://kotlinlang.org/) |
156+
| [lua-discordRPC](https://github.com/pfirsich/lua-discordRPC) | LuaJIT (FFI) |
157+
| [pypresence](https://github.com/qwertyquerty/pypresence) | [Python](https://python.org/) |
158+
| [SwordRPC](https://github.com/Azoy/SwordRPC) | [Swift](https://swift.org) |

0 commit comments

Comments
 (0)