1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Bring that Whole New World to the Old Continent too

Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -29,45 +29,41 @@
#include "camera_editor_plugin.h"
#include "spatial_editor_plugin.h"
void CameraEditor::_notification(int p_what) {
switch(p_what) {
switch (p_what) {
/* case NOTIFICATION_PROCESS: {
/* case NOTIFICATION_PROCESS: {
if (preview->is_pressed() && node)
node->call("make_current");
} break;*/
}
}
void CameraEditor::_node_removed(Node *p_node) {
if(p_node==node) {
node=NULL;
if (p_node == node) {
node = NULL;
SpatialEditor::get_singleton()->set_custom_camera(NULL);
hide();
}
}
void CameraEditor::_pressed() {
Node *sn = (node && preview->is_pressed())?node:NULL;
Node *sn = (node && preview->is_pressed()) ? node : NULL;
SpatialEditor::get_singleton()->set_custom_camera(sn);
}
void CameraEditor::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed);
ObjectTypeDB::bind_method(_MD("_pressed"), &CameraEditor::_pressed);
}
void CameraEditor::edit(Node *p_camera) {
node=p_camera;
node = p_camera;
if (!node) {
preview->set_pressed(false);
@@ -81,25 +77,22 @@ void CameraEditor::edit(Node *p_camera) {
}
}
CameraEditor::CameraEditor() {
preview = memnew( Button );
preview = memnew(Button);
add_child(preview);
preview->set_text(TTR("Preview"));
preview->set_toggle_mode(true);
preview->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
preview->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END);
preview->set_margin(MARGIN_LEFT,60);
preview->set_margin(MARGIN_RIGHT,0);
preview->set_margin(MARGIN_TOP,0);
preview->set_margin(MARGIN_BOTTOM,10);
preview->connect("pressed",this,"_pressed");
preview->set_anchor(MARGIN_LEFT, Control::ANCHOR_END);
preview->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
preview->set_margin(MARGIN_LEFT, 60);
preview->set_margin(MARGIN_RIGHT, 0);
preview->set_margin(MARGIN_TOP, 0);
preview->set_margin(MARGIN_BOTTOM, 10);
preview->connect("pressed", this, "_pressed");
}
void CameraEditorPlugin::edit(Object *p_object) {
SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>());
@@ -114,19 +107,18 @@ bool CameraEditorPlugin::handles(Object *p_object) const {
void CameraEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
// SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>());
// SpatialEditor::get_singleton()->set_can_preview(p_object->cast_to<Camera>());
} else {
SpatialEditor::get_singleton()->set_can_preview(NULL);
}
}
CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) {
editor=p_node;
/* camera_editor = memnew( CameraEditor );
editor = p_node;
/* camera_editor = memnew( CameraEditor );
editor->get_viewport()->add_child(camera_editor);
camera_editor->set_anchor(MARGIN_LEFT,Control::ANCHOR_END);
@@ -139,13 +131,7 @@ CameraEditorPlugin::CameraEditorPlugin(EditorNode *p_node) {
camera_editor->hide();
*/
}
CameraEditorPlugin::~CameraEditorPlugin()
{
CameraEditorPlugin::~CameraEditorPlugin() {
}