Style: apply clang-format (3.9.1) to current source
This commit is contained in:
parent
b3a1821b46
commit
acb7107720
@ -81,8 +81,8 @@ Error AudioDriverWASAPI::init_device(bool reinit) {
|
|||||||
|
|
||||||
switch (wasapi_channels) {
|
switch (wasapi_channels) {
|
||||||
case 2: // Stereo
|
case 2: // Stereo
|
||||||
// case 6: // Surround 5.1
|
//case 6: // Surround 5.1
|
||||||
// case 8: // Surround 7.1
|
//case 8: // Surround 7.1
|
||||||
channels = wasapi_channels;
|
channels = wasapi_channels;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -307,12 +307,12 @@ void DependencyEditorOwners::_select_file(int p_idx) {
|
|||||||
void DependencyEditorOwners::_file_option(int p_option) {
|
void DependencyEditorOwners::_file_option(int p_option) {
|
||||||
|
|
||||||
switch (p_option) {
|
switch (p_option) {
|
||||||
case FILE_OPEN: {
|
case FILE_OPEN: {
|
||||||
int idx = owners->get_current();
|
int idx = owners->get_current();
|
||||||
if (idx < 0 || idx >= owners->get_item_count())
|
if (idx < 0 || idx >= owners->get_item_count())
|
||||||
break;
|
break;
|
||||||
_select_file(idx);
|
_select_file(idx);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,11 +461,10 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DependencyRemoveDialog::ok_pressed() {
|
void DependencyRemoveDialog::ok_pressed() {
|
||||||
|
|
||||||
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||||
for (Map<String, TreeItem *>::Element *E = files.front(); E; E = E->next()) {
|
for (Map<String, TreeItem *>::Element *E = files.front(); E; E = E->next()) {
|
||||||
if (da->dir_exists(E->key()))
|
if (da->dir_exists(E->key())) {
|
||||||
{
|
|
||||||
String path = OS::get_singleton()->get_resource_dir() + E->key().replace_first("res://", "/");
|
String path = OS::get_singleton()->get_resource_dir() + E->key().replace_first("res://", "/");
|
||||||
OS::get_singleton()->move_path_to_trash(path);
|
OS::get_singleton()->move_path_to_trash(path);
|
||||||
EditorFileSystem::get_singleton()->scan();
|
EditorFileSystem::get_singleton()->scan();
|
||||||
|
@ -80,10 +80,12 @@ class DependencyEditorOwners : public AcceptDialog {
|
|||||||
void _list_rmb_select(int p_item, const Vector2 &p_pos);
|
void _list_rmb_select(int p_item, const Vector2 &p_pos);
|
||||||
void _select_file(int p_idx);
|
void _select_file(int p_idx);
|
||||||
void _file_option(int p_option);
|
void _file_option(int p_option);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum FileMenu {
|
enum FileMenu {
|
||||||
FILE_OPEN
|
FILE_OPEN
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void show(const String &p_path);
|
void show(const String &p_path);
|
||||||
DependencyEditorOwners(EditorNode *p_editor);
|
DependencyEditorOwners(EditorNode *p_editor);
|
||||||
|
@ -288,7 +288,7 @@ class ScriptEditor : public VBoxContainer {
|
|||||||
|
|
||||||
void _script_selected(int p_idx);
|
void _script_selected(int p_idx);
|
||||||
|
|
||||||
void _script_rmb_selected(int p_idx, const Vector2 & p_pos);
|
void _script_rmb_selected(int p_idx, const Vector2 &p_pos);
|
||||||
|
|
||||||
void _find_scripts(Node *p_base, Node *p_current, Set<Ref<Script> > &used);
|
void _find_scripts(Node *p_base, Node *p_current, Set<Ref<Script> > &used);
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ private:
|
|||||||
|
|
||||||
PanelContainer *fps;
|
PanelContainer *fps;
|
||||||
Label *fps_label;
|
Label *fps_label;
|
||||||
|
|
||||||
struct _RayResult {
|
struct _RayResult {
|
||||||
|
|
||||||
Spatial *item;
|
Spatial *item;
|
||||||
|
@ -124,9 +124,9 @@ void ScriptCreateDialog::_create_new() {
|
|||||||
cname = class_name->get_text();
|
cname = class_name->get_text();
|
||||||
|
|
||||||
String text;
|
String text;
|
||||||
if (template_select==0) {
|
if (template_select == 0) {
|
||||||
text = ScriptServer::get_language(language_menu->get_selected())->get_template(cname, parent_name->get_text());
|
text = ScriptServer::get_language(language_menu->get_selected())->get_template(cname, parent_name->get_text());
|
||||||
} else if (template_select==1) {
|
} else if (template_select == 1) {
|
||||||
text = ScriptServer::get_language(language_menu->get_selected())->get_empty_template(cname, parent_name->get_text());
|
text = ScriptServer::get_language(language_menu->get_selected())->get_empty_template(cname, parent_name->get_text());
|
||||||
} else if (template_select == 2) {
|
} else if (template_select == 2) {
|
||||||
text = ScriptServer::get_language(language_menu->get_selected())->get_nocomment_template(cname, parent_name->get_text());
|
text = ScriptServer::get_language(language_menu->get_selected())->get_nocomment_template(cname, parent_name->get_text());
|
||||||
|
@ -45,33 +45,34 @@ void GDScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const {
|
|||||||
}
|
}
|
||||||
String GDScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const {
|
String GDScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const {
|
||||||
|
|
||||||
String _template = String() +
|
String _template =
|
||||||
"extends %BASE%\n\n" +
|
String() +
|
||||||
"# class member variables go here, for example:\n" +
|
"extends %BASE%\n\n" +
|
||||||
"# var a = 2\n" +
|
"# class member variables go here, for example:\n" +
|
||||||
"# var b = \"textvar\"\n\n" +
|
"# var a = 2\n" +
|
||||||
"func _ready():\n" +
|
"# var b = \"textvar\"\n\n" +
|
||||||
"\t# Called every time the node is added to the scene.\n" +
|
"func _ready():\n" +
|
||||||
"\t# Initialization here\n" +
|
"\t# Called every time the node is added to the scene.\n" +
|
||||||
"\tpass\n";
|
"\t# Initialization here\n" +
|
||||||
|
"\tpass\n";
|
||||||
|
|
||||||
return _template.replace("%BASE%", p_base_class_name);
|
return _template.replace("%BASE%", p_base_class_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
String GDScriptLanguage::get_empty_template(const String &p_class_name, const String &p_base_class_name) const {
|
String GDScriptLanguage::get_empty_template(const String &p_class_name, const String &p_base_class_name) const {
|
||||||
|
|
||||||
String _template = String() +
|
String _template = String() + "extends %BASE%\n\n";
|
||||||
"extends %BASE%\n\n";
|
|
||||||
|
|
||||||
return _template.replace("%BASE%", p_base_class_name);
|
return _template.replace("%BASE%", p_base_class_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
String GDScriptLanguage::get_nocomment_template(const String &p_class_name, const String &p_base_class_name) const {
|
String GDScriptLanguage::get_nocomment_template(const String &p_class_name, const String &p_base_class_name) const {
|
||||||
|
|
||||||
String _template = String() +
|
String _template =
|
||||||
"extends %BASE%\n\n" +
|
String() +
|
||||||
"func _ready():\n" +
|
"extends %BASE%\n\n" +
|
||||||
"\tpass\n";
|
"func _ready():\n" +
|
||||||
|
"\tpass\n";
|
||||||
|
|
||||||
return _template.replace("%BASE%", p_base_class_name);
|
return _template.replace("%BASE%", p_base_class_name);
|
||||||
}
|
}
|
||||||
|
@ -2137,10 +2137,9 @@ void GDParser::_parse_extends(ClassNode *p_class) {
|
|||||||
|
|
||||||
case GDTokenizer::TK_IDENTIFIER: {
|
case GDTokenizer::TK_IDENTIFIER: {
|
||||||
|
|
||||||
StringName identifier = tokenizer->get_token_identifier();
|
StringName identifier = tokenizer->get_token_identifier();
|
||||||
p_class->extends_class.push_back(identifier);
|
p_class->extends_class.push_back(identifier);
|
||||||
}
|
} break;
|
||||||
break;
|
|
||||||
|
|
||||||
case GDTokenizer::TK_PERIOD:
|
case GDTokenizer::TK_PERIOD:
|
||||||
break;
|
break;
|
||||||
|
@ -633,7 +633,6 @@ Error EditorExportPlatformOSX::export_project(const String &p_path, bool p_debug
|
|||||||
} else {
|
} else {
|
||||||
err = ERR_CANT_OPEN;
|
err = ERR_CANT_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ public:
|
|||||||
|
|
||||||
virtual void set_use_vsync(bool p_enable);
|
virtual void set_use_vsync(bool p_enable);
|
||||||
virtual bool is_vsync_enabled() const;
|
virtual bool is_vsync_enabled() const;
|
||||||
|
|
||||||
virtual Error move_path_to_trash(String p_dir);
|
virtual Error move_path_to_trash(String p_dir);
|
||||||
|
|
||||||
void disable_crash_handler();
|
void disable_crash_handler();
|
||||||
|
@ -537,9 +537,9 @@ void OS_X11::finalize() {
|
|||||||
spatial_sound_2d_server->finish();
|
spatial_sound_2d_server->finish();
|
||||||
memdelete(spatial_sound_2d_server);
|
memdelete(spatial_sound_2d_server);
|
||||||
|
|
||||||
//if (debugger_connection_console) {
|
//if (debugger_connection_console) {
|
||||||
// memdelete(debugger_connection_console);
|
// memdelete(debugger_connection_console);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#ifdef JOYDEV_ENABLED
|
#ifdef JOYDEV_ENABLED
|
||||||
memdelete(joystick);
|
memdelete(joystick);
|
||||||
@ -1384,8 +1384,8 @@ void OS_X11::process_xevents() {
|
|||||||
switch (event_data->evtype) {
|
switch (event_data->evtype) {
|
||||||
|
|
||||||
case XI_TouchBegin: // Fall-through
|
case XI_TouchBegin: // Fall-through
|
||||||
// Disabled hand-in-hand with the grabbing
|
// Disabled hand-in-hand with the grabbing
|
||||||
//XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch);
|
//XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch);
|
||||||
|
|
||||||
case XI_TouchEnd: {
|
case XI_TouchEnd: {
|
||||||
|
|
||||||
@ -1473,8 +1473,8 @@ void OS_X11::process_xevents() {
|
|||||||
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
|
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
|
||||||
}
|
}
|
||||||
#ifdef TOUCH_ENABLED
|
#ifdef TOUCH_ENABLED
|
||||||
// Grab touch devices to avoid OS gesture interference
|
// Grab touch devices to avoid OS gesture interference
|
||||||
/*for (int i = 0; i < touch.devices.size(); ++i) {
|
/*for (int i = 0; i < touch.devices.size(); ++i) {
|
||||||
XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask);
|
XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask);
|
||||||
}*/
|
}*/
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,7 +34,7 @@ void Navigation::_navmesh_link(int p_id) {
|
|||||||
ERR_FAIL_COND(!navmesh_map.has(p_id));
|
ERR_FAIL_COND(!navmesh_map.has(p_id));
|
||||||
NavMesh &nm = navmesh_map[p_id];
|
NavMesh &nm = navmesh_map[p_id];
|
||||||
ERR_FAIL_COND(nm.linked);
|
ERR_FAIL_COND(nm.linked);
|
||||||
|
|
||||||
DVector<Vector3> vertices = nm.navmesh->get_vertices();
|
DVector<Vector3> vertices = nm.navmesh->get_vertices();
|
||||||
int len = vertices.size();
|
int len = vertices.size();
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user