1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Style: Harmonize header includes in modules

This applies our existing style guide, and adds a new rule to that style
guide for modular components such as platform ports and modules:

Includes from the platform port or module ("local" includes) should be listed
first in their own block using relative paths, before Godot's "core" includes
which use "absolute" (project folder relative) paths, and finally thirdparty
includes.

Includes in `#ifdef`s come after their relevant section, i.e. the overall
structure is:

- Local includes
  * Conditional local includes
- Core includes
  * Conditional core includes
- Thirdparty includes
  * Conditional thirdparty includes
This commit is contained in:
Rémi Verschelde
2023-06-13 16:56:21 +02:00
parent 7734146060
commit 25b2f1780a
217 changed files with 572 additions and 415 deletions

View File

@@ -29,14 +29,15 @@
/**************************************************************************/
#include "register_types.h"
#include "core/config/project_settings.h"
#include "webrtc_data_channel.h"
#include "webrtc_data_channel_extension.h"
#include "webrtc_multiplayer_peer.h"
#include "webrtc_peer_connection.h"
#include "webrtc_data_channel_extension.h"
#include "webrtc_peer_connection_extension.h"
#include "core/config/project_settings.h"
void initialize_webrtc_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;

View File

@@ -29,6 +29,7 @@
/**************************************************************************/
#include "webrtc_data_channel.h"
#include "core/config/project_settings.h"
void WebRTCDataChannel::_bind_methods() {

View File

@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifdef WEB_ENABLED
#include "webrtc_data_channel_js.h"
#include "emscripten.h"
#ifdef WEB_ENABLED
#include <emscripten.h>
extern "C" {
typedef void (*RTCChOnOpen)(void *p_obj);

View File

@@ -31,9 +31,10 @@
#ifndef WEBRTC_MULTIPLAYER_PEER_H
#define WEBRTC_MULTIPLAYER_PEER_H
#include "scene/main/multiplayer_peer.h"
#include "webrtc_peer_connection.h"
#include "scene/main/multiplayer_peer.h"
class WebRTCMultiplayerPeer : public MultiplayerPeer {
GDCLASS(WebRTCMultiplayerPeer, MultiplayerPeer);

View File

@@ -31,8 +31,9 @@
#ifndef WEBRTC_PEER_CONNECTION_H
#define WEBRTC_PEER_CONNECTION_H
#include "webrtc_data_channel.h"
#include "core/io/packet_peer.h"
#include "modules/webrtc/webrtc_data_channel.h"
class WebRTCPeerConnection : public RefCounted {
GDCLASS(WebRTCPeerConnection, RefCounted);

View File

@@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifdef WEB_ENABLED
#include "webrtc_peer_connection_js.h"
#ifdef WEB_ENABLED
#include "webrtc_data_channel_js.h"
#include "emscripten.h"
#include <emscripten.h>
void WebRTCPeerConnectionJS::_on_ice_candidate(void *p_obj, const char *p_mid_name, int p_mline_idx, const char *p_candidate) {
WebRTCPeerConnectionJS *peer = static_cast<WebRTCPeerConnectionJS *>(p_obj);