Skip to content

Commit

Permalink
Style: Cleanups, added headers, renamed files
Browse files Browse the repository at this point in the history
Made sure files in core/ and tools/ have a proper Godot license header
when written by us. Also renamed aabb.{cpp,h} and object_type_db.{cpp,h}
to rect3.{cpp,h} and class_db.{cpp,h} respectively.

Also added a proper header to core/io/base64.{c,h} after clarifying
the licensing with the original author (public domain).
  • Loading branch information
akien-mga committed Jan 16, 2017
1 parent b400c69 commit 3890256
Show file tree
Hide file tree
Showing 168 changed files with 782 additions and 118 deletions.
1 change: 1 addition & 0 deletions core/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "array.h"

#include "vector.h"
#include "hashfuncs.h"
#include "variant.h"
Expand Down
5 changes: 3 additions & 2 deletions core/object_type_db.cpp → core/class_db.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* object_type_db.cpp */
/* class_db.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand All @@ -26,7 +26,8 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "object_type_db.h"
#include "class_db.h"

#include "os/mutex.h"

#ifdef NO_THREADS
Expand Down
9 changes: 5 additions & 4 deletions core/object_type_db.h → core/class_db.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* object_type_db.h */
/* class_db.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand All @@ -26,12 +26,13 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef OBJECT_TYPE_DB_H
#define OBJECT_TYPE_DB_H
#ifndef CLASS_DB_H
#define CLASS_DB_H

#include "object.h"
#include "method_bind.h"
#include "print_string.h"

/**
@author Juan Linietsky <[email protected]>
*/
Expand Down Expand Up @@ -537,4 +538,4 @@ class ClassDB {



#endif
#endif // CLASS_DB_H
1 change: 1 addition & 0 deletions core/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "color.h"

#include "math_funcs.h"
#include "print_string.h"
#include "map.h"
Expand Down
1 change: 1 addition & 0 deletions core/command_queue_mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "command_queue_mt.h"

#include "os/os.h"

void CommandQueueMT::lock() {
Expand Down
1 change: 1 addition & 0 deletions core/compressed_translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "compressed_translation.h"

#include "pair.h"
#include <string.h>

Expand Down
1 change: 1 addition & 0 deletions core/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "dictionary.h"

#include "safe_refcount.h"
#include "variant.h"

Expand Down
1 change: 1 addition & 0 deletions core/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "engine.h"

#include "version.h"

void Engine::set_iterations_per_second(int p_ips) {
Expand Down
1 change: 1 addition & 0 deletions core/error_macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "error_macros.h"

#include "os/os.h"


Expand Down
1 change: 1 addition & 0 deletions core/global_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "global_constants.h"

#include "variant.h"
#include "os/keyboard.h"
#include "object.h"
Expand Down
3 changes: 2 additions & 1 deletion core/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "globals.h"

#include "os/dir_access.h"
#include "os/file_access.h"

#include "os/keyboard.h"
#include "io/marshalls.h"
#include "bind/core_bind.h"
#include "os/os.h"
#include "io/file_access_pack.h"
#include "io/file_access_network.h"
#include "variant_parser.h"

GlobalConfig *GlobalConfig::singleton=NULL;

GlobalConfig *GlobalConfig::get_singleton() {
Expand Down
2 changes: 2 additions & 0 deletions core/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "image.h"

#include "hash_map.h"
#include "core/io/image_loader.h"
#include "core/os/copymem.h"
#include "hq2x.h"
#include "print_string.h"

#include <stdio.h>


Expand Down
1 change: 1 addition & 0 deletions core/input_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "input_map.h"

#include "globals.h"
#include "os/keyboard.h"

Expand Down
8 changes: 8 additions & 0 deletions core/io/base64.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* File: base64.c
* Description: Simple BASE64 conversion methods
* Author: Ari Edelkind
* License: Public Domain
* Website: http://episec.com/people/edelkind/c.html
*/

#include <string.h>

char b64string[] =
Expand Down
8 changes: 8 additions & 0 deletions core/io/base64.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* File: base64.h
* Description: Simple BASE64 conversion methods
* Author: Ari Edelkind
* License: Public Domain
* Website: http://episec.com/people/edelkind/c.html
*/

#ifndef BASE64_H
#define BASE64_H

Expand Down
28 changes: 28 additions & 0 deletions core/io/networked_multiplayer_peer.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
/*************************************************************************/
/* networked_multiplayer_peer.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "networked_multiplayer_peer.h"


Expand Down
28 changes: 28 additions & 0 deletions core/io/networked_multiplayer_peer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
/*************************************************************************/
/* networked_multiplayer_peer.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef NETWORKED_MULTIPLAYER_PEER_H
#define NETWORKED_MULTIPLAYER_PEER_H

Expand Down
2 changes: 1 addition & 1 deletion core/io/pck_packer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* pkc_packer.cpp */
/* pck_packer.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down
2 changes: 1 addition & 1 deletion core/math/a_star.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* a_star.cpp */
/* a_star.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down
2 changes: 1 addition & 1 deletion core/math/bsp_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define BSP_TREE_H

#include "plane.h"
#include "aabb.h"
#include "rect3.h"
#include "face3.h"
#include "vector.h"
#include "dvector.h"
Expand Down
2 changes: 1 addition & 1 deletion core/math/face3.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "vector3.h"
#include "plane.h"
#include "aabb.h"
#include "rect3.h"
#include "transform.h"

class Face3 {
Expand Down
2 changes: 1 addition & 1 deletion core/math/octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define OCTREE_H

#include "vector3.h"
#include "aabb.h"
#include "rect3.h"
#include "list.h"
#include "variant.h"
#include "map.h"
Expand Down
2 changes: 1 addition & 1 deletion core/math/quick_hull.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#ifndef QUICK_HULL_H
#define QUICK_HULL_H

#include "aabb.h"
#include "rect3.h"
#include "set.h"
#include "list.h"
#include "geometry.h"
Expand Down
4 changes: 2 additions & 2 deletions core/math/aabb.cpp → core/math/rect3.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* aabb.cpp */
/* rect3.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand All @@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "aabb.h"
#include "rect3.h"

#include "print_string.h"

Expand Down
2 changes: 1 addition & 1 deletion core/math/aabb.h → core/math/rect3.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************/
/* aabb.h */
/* rect3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
Expand Down
2 changes: 1 addition & 1 deletion core/math/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "matrix3.h"
#include "plane.h"
#include "aabb.h"
#include "rect3.h"
/**
@author Juan Linietsky <[email protected]>
*/
Expand Down
2 changes: 2 additions & 0 deletions core/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "message_queue.h"

#include "globals.h"
#include "script_language.h"

MessageQueue *MessageQueue::singleton=NULL;

MessageQueue *MessageQueue::get_singleton() {
Expand Down
3 changes: 2 additions & 1 deletion core/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "object.h"

#include "print_string.h"
#include "object_type_db.h"
#include "class_db.h"
#include "script_language.h"
#include "message_queue.h"
#include "core_string_names.h"
Expand Down
2 changes: 1 addition & 1 deletion core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,6 @@ friend void register_core_types();
};

//needed by macros
#include "object_type_db.h"
#include "class_db.h"

#endif
2 changes: 1 addition & 1 deletion core/packed_data_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "packed_data_container.h"

#include "io/marshalls.h"
#include "core_string_names.h"



Variant PackedDataContainer::getvar(const Variant& p_key, bool *r_valid) const {

bool err=false;
Expand Down
2 changes: 1 addition & 1 deletion core/path_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "path_db.h"
#include "print_string.h"

#include "print_string.h"

uint32_t NodePath::hash() const {

Expand Down
2 changes: 2 additions & 0 deletions core/path_remap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "path_remap.h"

#include "globals.h"
#include "os/os.h"
#include "translation.h"

PathRemap* PathRemap::singleton=NULL;

PathRemap* PathRemap::get_singleton() {
Expand Down
Loading

0 comments on commit 3890256

Please sign in to comment.