Merge pull request #25821 from akien-mga/sync-class-and-filenames
Ensure classes match their header filename
This commit is contained in:
commit
55ca2a7c88
|
@ -1,195 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* allocators.h */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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 ALLOCATORS_H
|
|
||||||
#define ALLOCATORS_H
|
|
||||||
|
|
||||||
#include "core/os/memory.h"
|
|
||||||
|
|
||||||
template <int PREALLOC_COUNT = 64, int MAX_HANDS = 8>
|
|
||||||
class BalloonAllocator {
|
|
||||||
|
|
||||||
enum {
|
|
||||||
|
|
||||||
USED_FLAG = (1 << 30),
|
|
||||||
USED_MASK = USED_FLAG - 1
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Balloon {
|
|
||||||
|
|
||||||
Balloon *next;
|
|
||||||
Balloon *prev;
|
|
||||||
uint32_t hand;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Hand {
|
|
||||||
|
|
||||||
int used;
|
|
||||||
int allocated;
|
|
||||||
Balloon *first;
|
|
||||||
Balloon *last;
|
|
||||||
};
|
|
||||||
|
|
||||||
Hand hands[MAX_HANDS];
|
|
||||||
|
|
||||||
public:
|
|
||||||
void *alloc(size_t p_size) {
|
|
||||||
|
|
||||||
size_t max = (1 << MAX_HANDS);
|
|
||||||
ERR_FAIL_COND_V(p_size > max, NULL);
|
|
||||||
|
|
||||||
unsigned int hand = 0;
|
|
||||||
|
|
||||||
while (p_size > (size_t)(1 << hand))
|
|
||||||
++hand;
|
|
||||||
|
|
||||||
Hand &h = hands[hand];
|
|
||||||
|
|
||||||
if (h.used == h.allocated) {
|
|
||||||
|
|
||||||
for (int i = 0; i < PREALLOC_COUNT; i++) {
|
|
||||||
|
|
||||||
Balloon *b = (Balloon *)memalloc(sizeof(Balloon) + (1 << hand));
|
|
||||||
b->hand = hand;
|
|
||||||
if (h.last) {
|
|
||||||
|
|
||||||
b->prev = h.last;
|
|
||||||
h.last->next = b;
|
|
||||||
h.last = b;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
b->prev = NULL;
|
|
||||||
h.last = b;
|
|
||||||
h.first = b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h.last->next = NULL;
|
|
||||||
h.allocated += PREALLOC_COUNT;
|
|
||||||
}
|
|
||||||
|
|
||||||
Balloon *pick = h.last;
|
|
||||||
|
|
||||||
ERR_FAIL_COND_V((pick->hand & USED_FLAG), NULL);
|
|
||||||
|
|
||||||
// remove last
|
|
||||||
h.last = h.last->prev;
|
|
||||||
h.last->next = NULL;
|
|
||||||
|
|
||||||
pick->next = h.first;
|
|
||||||
h.first->prev = pick;
|
|
||||||
pick->prev = NULL;
|
|
||||||
h.first = pick;
|
|
||||||
h.used++;
|
|
||||||
pick->hand |= USED_FLAG;
|
|
||||||
|
|
||||||
return (void *)(pick + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void free(void *p_ptr) {
|
|
||||||
|
|
||||||
Balloon *b = (Balloon *)p_ptr;
|
|
||||||
b -= 1;
|
|
||||||
|
|
||||||
ERR_FAIL_COND(!(b->hand & USED_FLAG));
|
|
||||||
|
|
||||||
b->hand = b->hand & USED_MASK; // not used
|
|
||||||
int hand = b->hand;
|
|
||||||
|
|
||||||
Hand &h = hands[hand];
|
|
||||||
|
|
||||||
if (b == h.first)
|
|
||||||
h.first = b->next;
|
|
||||||
|
|
||||||
if (b->prev)
|
|
||||||
b->prev->next = b->next;
|
|
||||||
if (b->next)
|
|
||||||
b->next->prev = b->prev;
|
|
||||||
|
|
||||||
if (h.last != b) {
|
|
||||||
h.last->next = b;
|
|
||||||
b->prev = h.last;
|
|
||||||
b->next = NULL;
|
|
||||||
h.last = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
h.used--;
|
|
||||||
|
|
||||||
if (h.used <= (h.allocated - (PREALLOC_COUNT * 2))) { // this is done to ensure no alloc/free is done constantly
|
|
||||||
|
|
||||||
for (int i = 0; i < PREALLOC_COUNT; i++) {
|
|
||||||
ERR_CONTINUE(h.last->hand & USED_FLAG);
|
|
||||||
|
|
||||||
Balloon *new_last = h.last->prev;
|
|
||||||
if (new_last)
|
|
||||||
new_last->next = NULL;
|
|
||||||
memfree(h.last);
|
|
||||||
h.last = new_last;
|
|
||||||
}
|
|
||||||
h.allocated -= PREALLOC_COUNT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BalloonAllocator() {
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_HANDS; i++) {
|
|
||||||
|
|
||||||
hands[i].allocated = 0;
|
|
||||||
hands[i].used = 0;
|
|
||||||
hands[i].first = NULL;
|
|
||||||
hands[i].last = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear() {
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_HANDS; i++) {
|
|
||||||
|
|
||||||
while (hands[i].first) {
|
|
||||||
|
|
||||||
Balloon *b = hands[i].first;
|
|
||||||
hands[i].first = b->next;
|
|
||||||
memfree(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
hands[i].allocated = 0;
|
|
||||||
hands[i].used = 0;
|
|
||||||
hands[i].first = NULL;
|
|
||||||
hands[i].last = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~BalloonAllocator() {
|
|
||||||
|
|
||||||
clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // ALLOCATORS_H
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef CORE_STRING_NAMES_H
|
#ifndef CORE_STRING_NAMES_H
|
||||||
#define CORE_STRING_NAMES_H
|
#define CORE_STRING_NAMES_H
|
||||||
|
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
|
|
||||||
class CoreStringNames {
|
class CoreStringNames {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef GLOBAL_CONSTANTS_H
|
#ifndef GLOBAL_CONSTANTS_H
|
||||||
#define GLOBAL_CONSTANTS_H
|
#define GLOBAL_CONSTANTS_H
|
||||||
|
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
|
|
||||||
class GlobalConstants {
|
class GlobalConstants {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "core/math/math_defs.h"
|
#include "core/math/math_defs.h"
|
||||||
#include "core/math/math_funcs.h"
|
#include "core/math/math_funcs.h"
|
||||||
#include "core/node_path.h"
|
#include "core/node_path.h"
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/typedefs.h"
|
#include "core/typedefs.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define IMAGE_H
|
#define IMAGE_H
|
||||||
|
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "core/resource.h"
|
#include "core/resource.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
#ifndef FILE_ACCESS_BUFFERED_H
|
#ifndef FILE_ACCESS_BUFFERED_H
|
||||||
#define FILE_ACCESS_BUFFERED_H
|
#define FILE_ACCESS_BUFFERED_H
|
||||||
|
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
|
||||||
class FileAccessBuffered : public FileAccess {
|
class FileAccessBuffered : public FileAccess {
|
||||||
|
|
|
@ -54,7 +54,7 @@ class FileAccessBufferedFA : public FileAccessBuffered {
|
||||||
cache.offset = p_offset;
|
cache.offset = p_offset;
|
||||||
cache.buffer.resize(p_size);
|
cache.buffer.resize(p_size);
|
||||||
|
|
||||||
// on dvector
|
// on PoolVector
|
||||||
//PoolVector<uint8_t>::Write write = cache.buffer.write();
|
//PoolVector<uint8_t>::Write write = cache.buffer.write();
|
||||||
//f.get_buffer(write.ptrw(), p_size);
|
//f.get_buffer(write.ptrw(), p_size);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* resource_import.cpp */
|
/* resource_importer.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "resource_import.h"
|
#include "resource_importer.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/variant_parser.h"
|
#include "core/variant_parser.h"
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* resource_import.h */
|
/* resource_importer.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef RESOURCE_IMPORT_H
|
#ifndef RESOURCE_IMPORTER_H
|
||||||
#define RESOURCE_IMPORT_H
|
#define RESOURCE_IMPORTER_H
|
||||||
|
|
||||||
#include "core/io/resource_loader.h"
|
#include "core/io/resource_loader.h"
|
||||||
|
|
||||||
|
@ -110,4 +110,4 @@ public:
|
||||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL) = 0;
|
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RESOURCE_IMPORT_H
|
#endif // RESOURCE_IMPORTER_H
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "resource_loader.h"
|
#include "resource_loader.h"
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/path_remap.h"
|
#include "core/path_remap.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define GLOBALS_LIST_H
|
#define GLOBALS_LIST_H
|
||||||
|
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
#include "core/sort.h"
|
#include "core/sort_array.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic Templatized Linked List Implementation.
|
* Generic Templatized Linked List Implementation.
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
#ifndef BSP_TREE_H
|
#ifndef BSP_TREE_H
|
||||||
#define BSP_TREE_H
|
#define BSP_TREE_H
|
||||||
|
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/math/aabb.h"
|
#include "core/math/aabb.h"
|
||||||
#include "core/math/face3.h"
|
#include "core/math/face3.h"
|
||||||
#include "core/math/plane.h"
|
#include "core/math/plane.h"
|
||||||
#include "core/method_ptrcall.h"
|
#include "core/method_ptrcall.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,12 +31,12 @@
|
||||||
#ifndef GEOMETRY_H
|
#ifndef GEOMETRY_H
|
||||||
#define GEOMETRY_H
|
#define GEOMETRY_H
|
||||||
|
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/math/face3.h"
|
#include "core/math/face3.h"
|
||||||
#include "core/math/rect2.h"
|
#include "core/math/rect2.h"
|
||||||
#include "core/math/triangulate.h"
|
#include "core/math/triangulate.h"
|
||||||
#include "core/math/vector3.h"
|
#include "core/math/vector3.h"
|
||||||
#include "core/object.h"
|
#include "core/object.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "triangle_mesh.h"
|
#include "triangle_mesh.h"
|
||||||
|
|
||||||
#include "core/sort.h"
|
#include "core/sort_array.h"
|
||||||
|
|
||||||
int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &max_depth, int &max_alloc) {
|
int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &max_depth, int &max_alloc) {
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef NODE_PATH_H
|
#ifndef NODE_PATH_H
|
||||||
#define NODE_PATH_H
|
#define NODE_PATH_H
|
||||||
|
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* shell.cpp */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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 "shell.h"
|
|
||||||
|
|
||||||
Shell *Shell::singleton = NULL;
|
|
||||||
|
|
||||||
Shell *Shell::get_singleton() {
|
|
||||||
|
|
||||||
return singleton;
|
|
||||||
}
|
|
||||||
|
|
||||||
Shell::~Shell() {
|
|
||||||
}
|
|
||||||
|
|
||||||
Shell::Shell() {
|
|
||||||
|
|
||||||
singleton = this;
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* shell.h */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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 SHELL_H
|
|
||||||
#define SHELL_H
|
|
||||||
|
|
||||||
#include "core/typedefs.h"
|
|
||||||
#include "core/ustring.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
@author Juan Linietsky <reduzio@gmail.com>
|
|
||||||
*/
|
|
||||||
class Shell {
|
|
||||||
|
|
||||||
static Shell *singleton;
|
|
||||||
|
|
||||||
public:
|
|
||||||
static Shell *get_singleton();
|
|
||||||
virtual void execute(String p_path) = 0;
|
|
||||||
|
|
||||||
Shell();
|
|
||||||
virtual ~Shell();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* dvector.cpp */
|
/* pool_vector.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "dvector.h"
|
#include "pool_vector.h"
|
||||||
|
|
||||||
Mutex *dvector_lock = NULL;
|
Mutex *pool_vector_lock = NULL;
|
||||||
|
|
||||||
PoolAllocator *MemoryPool::memory_pool = NULL;
|
PoolAllocator *MemoryPool::memory_pool = NULL;
|
||||||
uint8_t *MemoryPool::pool_memory = NULL;
|
uint8_t *MemoryPool::pool_memory = NULL;
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* dvector.h */
|
/* pool_vector.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef DVECTOR_H
|
#ifndef POOL_VECTOR_H
|
||||||
#define DVECTOR_H
|
#define POOL_VECTOR_H
|
||||||
|
|
||||||
#include "core/os/copymem.h"
|
#include "core/os/copymem.h"
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
|
@ -188,19 +188,19 @@ class PoolVector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _reference(const PoolVector &p_dvector) {
|
void _reference(const PoolVector &p_pool_vector) {
|
||||||
|
|
||||||
if (alloc == p_dvector.alloc)
|
if (alloc == p_pool_vector.alloc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_unreference();
|
_unreference();
|
||||||
|
|
||||||
if (!p_dvector.alloc) {
|
if (!p_pool_vector.alloc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_dvector.alloc->refcount.ref()) {
|
if (p_pool_vector.alloc->refcount.ref()) {
|
||||||
alloc = p_dvector.alloc;
|
alloc = p_pool_vector.alloc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,11 +460,11 @@ public:
|
||||||
|
|
||||||
void invert();
|
void invert();
|
||||||
|
|
||||||
void operator=(const PoolVector &p_dvector) { _reference(p_dvector); }
|
void operator=(const PoolVector &p_pool_vector) { _reference(p_pool_vector); }
|
||||||
PoolVector() { alloc = NULL; }
|
PoolVector() { alloc = NULL; }
|
||||||
PoolVector(const PoolVector &p_dvector) {
|
PoolVector(const PoolVector &p_pool_vector) {
|
||||||
alloc = NULL;
|
alloc = NULL;
|
||||||
_reference(p_dvector);
|
_reference(p_pool_vector);
|
||||||
}
|
}
|
||||||
~PoolVector() { _unreference(); }
|
~PoolVector() { _unreference(); }
|
||||||
};
|
};
|
||||||
|
@ -640,4 +640,4 @@ void PoolVector<T>::invert() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // POOL_VECTOR_H
|
|
@ -47,7 +47,7 @@
|
||||||
#include "core/io/packet_peer_udp.h"
|
#include "core/io/packet_peer_udp.h"
|
||||||
#include "core/io/pck_packer.h"
|
#include "core/io/pck_packer.h"
|
||||||
#include "core/io/resource_format_binary.h"
|
#include "core/io/resource_format_binary.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
#include "core/io/stream_peer_ssl.h"
|
#include "core/io/stream_peer_ssl.h"
|
||||||
#include "core/io/tcp_server.h"
|
#include "core/io/tcp_server.h"
|
||||||
#include "core/io/translation_loader_po.h"
|
#include "core/io/translation_loader_po.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* sort.h */
|
/* sort_array.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef SORT_H
|
#ifndef SORT_ARRAY_H
|
||||||
#define SORT_H
|
#define SORT_ARRAY_H
|
||||||
|
|
||||||
#include "core/typedefs.h"
|
#include "core/typedefs.h"
|
||||||
|
|
||||||
|
@ -327,4 +327,4 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // SORT_ARRAY_H
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* string_db.cpp */
|
/* string_name.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "string_db.h"
|
#include "string_name.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* string_db.h */
|
/* string_name.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef STRING_DB_H
|
#ifndef STRING_NAME_H
|
||||||
#define STRING_DB_H
|
#define STRING_NAME_H
|
||||||
|
|
||||||
#include "core/os/mutex.h"
|
#include "core/os/mutex.h"
|
||||||
#include "core/safe_refcount.h"
|
#include "core/safe_refcount.h"
|
||||||
|
@ -169,4 +169,4 @@ public:
|
||||||
|
|
||||||
StringName _scs_create(const char *p_chr);
|
StringName _scs_create(const char *p_chr);
|
||||||
|
|
||||||
#endif
|
#endif // STRING_NAME_H
|
|
@ -38,7 +38,6 @@
|
||||||
#include "core/array.h"
|
#include "core/array.h"
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
#include "core/dictionary.h"
|
#include "core/dictionary.h"
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/io/ip_address.h"
|
#include "core/io/ip_address.h"
|
||||||
#include "core/math/aabb.h"
|
#include "core/math/aabb.h"
|
||||||
#include "core/math/basis.h"
|
#include "core/math/basis.h"
|
||||||
|
@ -49,6 +48,7 @@
|
||||||
#include "core/math/transform_2d.h"
|
#include "core/math/transform_2d.h"
|
||||||
#include "core/math/vector3.h"
|
#include "core/math/vector3.h"
|
||||||
#include "core/node_path.h"
|
#include "core/node_path.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "core/ref_ptr.h"
|
#include "core/ref_ptr.h"
|
||||||
#include "core/rid.h"
|
#include "core/rid.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
|
|
@ -1,438 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* variant_construct_string.cpp */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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 "variant.h"
|
|
||||||
|
|
||||||
class VariantConstruct {
|
|
||||||
|
|
||||||
enum TokenType {
|
|
||||||
TK_CURLY_BRACKET_OPEN,
|
|
||||||
TK_CURLY_BRACKET_CLOSE,
|
|
||||||
TK_BRACKET_OPEN,
|
|
||||||
TK_BRACKET_CLOSE,
|
|
||||||
TK_IDENTIFIER,
|
|
||||||
TK_STRING,
|
|
||||||
TK_NUMBER,
|
|
||||||
TK_COLON,
|
|
||||||
TK_COMMA,
|
|
||||||
TK_EOF,
|
|
||||||
TK_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Expecting {
|
|
||||||
|
|
||||||
EXPECT_OBJECT,
|
|
||||||
EXPECT_OBJECT_KEY,
|
|
||||||
EXPECT_COLON,
|
|
||||||
EXPECT_OBJECT_VALUE,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Token {
|
|
||||||
|
|
||||||
TokenType type;
|
|
||||||
Variant value;
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *tk_name[TK_MAX];
|
|
||||||
|
|
||||||
static String _print_var(const Variant &p_var);
|
|
||||||
|
|
||||||
static Error _get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str);
|
|
||||||
static Error _parse_value(Variant &value, Token &token, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
|
|
||||||
static Error _parse_array(Array &array, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
|
|
||||||
static Error _parse_dict(Dictionary &dict, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static Error parse(const String &p_string, Variant &r_ret, String &r_err_str, int &r_err_line, Variant::ObjectConstruct *p_construct, void *p_ud);
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *VariantConstruct::tk_name[TK_MAX] = {
|
|
||||||
"'{'",
|
|
||||||
"'}'",
|
|
||||||
"'['",
|
|
||||||
"']'",
|
|
||||||
"identifier",
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"':'",
|
|
||||||
"','",
|
|
||||||
"EOF",
|
|
||||||
};
|
|
||||||
|
|
||||||
Error VariantConstruct::_get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str) {
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
switch (p_str[index]) {
|
|
||||||
|
|
||||||
case '\n': {
|
|
||||||
|
|
||||||
line++;
|
|
||||||
index++;
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
case 0: {
|
|
||||||
r_token.type = TK_EOF;
|
|
||||||
return OK;
|
|
||||||
} break;
|
|
||||||
case '{': {
|
|
||||||
|
|
||||||
r_token.type = TK_CURLY_BRACKET_OPEN;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case '}': {
|
|
||||||
|
|
||||||
r_token.type = TK_CURLY_BRACKET_CLOSE;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case '[': {
|
|
||||||
|
|
||||||
r_token.type = TK_BRACKET_OPEN;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case ']': {
|
|
||||||
|
|
||||||
r_token.type = TK_BRACKET_CLOSE;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case ':': {
|
|
||||||
|
|
||||||
r_token.type = TK_COLON;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case ',': {
|
|
||||||
|
|
||||||
r_token.type = TK_COMMA;
|
|
||||||
index++;
|
|
||||||
return OK;
|
|
||||||
};
|
|
||||||
case '"': {
|
|
||||||
|
|
||||||
index++;
|
|
||||||
String str;
|
|
||||||
while (true) {
|
|
||||||
if (p_str[index] == 0) {
|
|
||||||
r_err_str = "Unterminated String";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
} else if (p_str[index] == '"') {
|
|
||||||
index++;
|
|
||||||
break;
|
|
||||||
} else if (p_str[index] == '\\') {
|
|
||||||
//escaped characters...
|
|
||||||
index++;
|
|
||||||
CharType next = p_str[index];
|
|
||||||
if (next == 0) {
|
|
||||||
r_err_str = "Unterminated String";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
CharType res = 0;
|
|
||||||
|
|
||||||
switch (next) {
|
|
||||||
|
|
||||||
case 'b': res = 8; break;
|
|
||||||
case 't': res = 9; break;
|
|
||||||
case 'n': res = 10; break;
|
|
||||||
case 'f': res = 12; break;
|
|
||||||
case 'r': res = 13; break;
|
|
||||||
case '\"': res = '\"'; break;
|
|
||||||
case '\\': res = '\\'; break;
|
|
||||||
case '/': res = '/'; break;
|
|
||||||
case 'u': {
|
|
||||||
//hexnumbarh - oct is deprecated
|
|
||||||
|
|
||||||
for (int j = 0; j < 4; j++) {
|
|
||||||
CharType c = p_str[index + j + 1];
|
|
||||||
if (c == 0) {
|
|
||||||
r_err_str = "Unterminated String";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) {
|
|
||||||
|
|
||||||
r_err_str = "Malformed hex constant in string";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
CharType v;
|
|
||||||
if (c >= '0' && c <= '9') {
|
|
||||||
v = c - '0';
|
|
||||||
} else if (c >= 'a' && c <= 'f') {
|
|
||||||
v = c - 'a';
|
|
||||||
v += 10;
|
|
||||||
} else if (c >= 'A' && c <= 'F') {
|
|
||||||
v = c - 'A';
|
|
||||||
v += 10;
|
|
||||||
} else {
|
|
||||||
ERR_PRINT("BUG");
|
|
||||||
v = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
res <<= 4;
|
|
||||||
res |= v;
|
|
||||||
}
|
|
||||||
index += 4; //will add at the end anyway
|
|
||||||
|
|
||||||
} break;
|
|
||||||
default: {
|
|
||||||
|
|
||||||
r_err_str = "Invalid escape sequence";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
} break;
|
|
||||||
}
|
|
||||||
|
|
||||||
str += res;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (p_str[index] == '\n')
|
|
||||||
line++;
|
|
||||||
str += p_str[index];
|
|
||||||
}
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
r_token.type = TK_STRING;
|
|
||||||
r_token.value = str;
|
|
||||||
return OK;
|
|
||||||
|
|
||||||
} break;
|
|
||||||
default: {
|
|
||||||
|
|
||||||
if (p_str[index] <= 32) {
|
|
||||||
index++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) {
|
|
||||||
//a number
|
|
||||||
const CharType *rptr;
|
|
||||||
double number = String::to_double(&p_str[index], &rptr);
|
|
||||||
index += (rptr - &p_str[index]);
|
|
||||||
r_token.type = TK_NUMBER;
|
|
||||||
r_token.value = number;
|
|
||||||
return OK;
|
|
||||||
|
|
||||||
} else if ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
|
|
||||||
|
|
||||||
String id;
|
|
||||||
|
|
||||||
while ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
|
|
||||||
|
|
||||||
id += p_str[index];
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
r_token.type = TK_IDENTIFIER;
|
|
||||||
r_token.value = id;
|
|
||||||
return OK;
|
|
||||||
} else {
|
|
||||||
r_err_str = "Unexpected character.";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
Error VariantConstruct::_parse_value(Variant &value, Token &token, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud) {
|
|
||||||
|
|
||||||
if (token.type == TK_CURLY_BRACKET_OPEN) {
|
|
||||||
|
|
||||||
Dictionary d;
|
|
||||||
Error err = _parse_dict(d, p_str, index, p_len, line, r_err_str, p_construct, p_ud);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
value = d;
|
|
||||||
return OK;
|
|
||||||
} else if (token.type == TK_BRACKET_OPEN) {
|
|
||||||
|
|
||||||
Array a;
|
|
||||||
Error err = _parse_array(a, p_str, index, p_len, line, r_err_str, p_construct, p_ud);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
value = a;
|
|
||||||
return OK;
|
|
||||||
|
|
||||||
} else if (token.type == TK_IDENTIFIER) {
|
|
||||||
|
|
||||||
String id = token.value;
|
|
||||||
if (id == "true")
|
|
||||||
value = true;
|
|
||||||
else if (id == "false")
|
|
||||||
value = false;
|
|
||||||
else if (id == "null")
|
|
||||||
value = Variant();
|
|
||||||
else {
|
|
||||||
r_err_str = "Expected 'true','false' or 'null', got '" + id + "'.";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
return OK;
|
|
||||||
|
|
||||||
} else if (token.type == TK_NUMBER) {
|
|
||||||
|
|
||||||
value = token.value;
|
|
||||||
return OK;
|
|
||||||
} else if (token.type == TK_STRING) {
|
|
||||||
|
|
||||||
value = token.value;
|
|
||||||
return OK;
|
|
||||||
} else {
|
|
||||||
r_err_str = "Expected value, got " + String(tk_name[token.type]) + ".";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
Error VariantConstruct::_parse_array(Array &array, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud) {
|
|
||||||
|
|
||||||
Token token;
|
|
||||||
bool need_comma = false;
|
|
||||||
|
|
||||||
while (index < p_len) {
|
|
||||||
|
|
||||||
Error err = _get_token(p_str, index, p_len, token, line, r_err_str);
|
|
||||||
if (err != OK)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
if (token.type == TK_BRACKET_CLOSE) {
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_comma) {
|
|
||||||
|
|
||||||
if (token.type != TK_COMMA) {
|
|
||||||
|
|
||||||
r_err_str = "Expected ','";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
} else {
|
|
||||||
need_comma = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variant v;
|
|
||||||
err = _parse_value(v, token, p_str, index, p_len, line, r_err_str, p_construct, p_ud);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
array.push_back(v);
|
|
||||||
need_comma = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
Error VariantConstruct::_parse_dict(Dictionary &dict, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str, Variant::ObjectConstruct *p_construct, void *p_ud) {
|
|
||||||
|
|
||||||
bool at_key = true;
|
|
||||||
Variant key;
|
|
||||||
Token token;
|
|
||||||
bool need_comma = false;
|
|
||||||
|
|
||||||
while (index < p_len) {
|
|
||||||
|
|
||||||
if (at_key) {
|
|
||||||
|
|
||||||
Error err = _get_token(p_str, index, p_len, token, line, r_err_str);
|
|
||||||
if (err != OK)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
if (token.type == TK_CURLY_BRACKET_CLOSE) {
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_comma) {
|
|
||||||
|
|
||||||
if (token.type != TK_COMMA) {
|
|
||||||
|
|
||||||
r_err_str = "Expected '}' or ','";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
} else {
|
|
||||||
need_comma = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
err = _parse_value(key, token, p_str, index, p_len, line, r_err_str, p_construct, p_ud);
|
|
||||||
|
|
||||||
if (err != OK)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
err = _get_token(p_str, index, p_len, token, line, r_err_str);
|
|
||||||
|
|
||||||
if (err != OK)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
if (token.type != TK_COLON) {
|
|
||||||
|
|
||||||
r_err_str = "Expected ':'";
|
|
||||||
return ERR_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
at_key = false;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Error err = _get_token(p_str, index, p_len, token, line, r_err_str);
|
|
||||||
if (err != OK)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
Variant v;
|
|
||||||
err = _parse_value(v, token, p_str, index, p_len, line, r_err_str, p_construct, p_ud);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
dict[key] = v;
|
|
||||||
need_comma = true;
|
|
||||||
at_key = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
Error VariantConstruct::parse(const String &p_string, Variant &r_ret, String &r_err_str, int &r_err_line, Variant::ObjectConstruct *p_construct, void *p_ud) {
|
|
||||||
|
|
||||||
const CharType *str = p_string.ptr();
|
|
||||||
int idx = 0;
|
|
||||||
int len = p_string.length();
|
|
||||||
Token token;
|
|
||||||
r_err_line = 0;
|
|
||||||
String aux_key;
|
|
||||||
|
|
||||||
Error err = _get_token(str, idx, len, token, r_err_line, r_err_str);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return _parse_value(r_ret, token, str, idx, len, r_err_line, r_err_str, p_construct, p_ud);
|
|
||||||
}
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "core/cowdata.h"
|
#include "core/cowdata.h"
|
||||||
#include "core/error_macros.h"
|
#include "core/error_macros.h"
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
#include "core/sort.h"
|
#include "core/sort_array.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class VectorWriteProxy {
|
class VectorWriteProxy {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* alsa_midi.cpp */
|
/* midi_driver_alsamidi.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#ifdef ALSAMIDI_ENABLED
|
#ifdef ALSAMIDI_ENABLED
|
||||||
|
|
||||||
#include "alsa_midi.h"
|
#include "midi_driver_alsamidi.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
||||||
|
@ -199,4 +199,4 @@ MIDIDriverALSAMidi::~MIDIDriverALSAMidi() {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // ALSAMIDI_ENABLED
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* alsa_midi.h */
|
/* midi_driver_alsamidi.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
#ifdef ALSAMIDI_ENABLED
|
#ifdef ALSAMIDI_ENABLED
|
||||||
|
|
||||||
#ifndef ALSA_MIDI_H
|
#ifndef MIDI_DRIVER_ALSAMIDI_H
|
||||||
#define ALSA_MIDI_H
|
#define MIDI_DRIVER_ALSAMIDI_H
|
||||||
|
|
||||||
#include "core/os/midi_driver.h"
|
#include "core/os/midi_driver.h"
|
||||||
#include "core/os/mutex.h"
|
#include "core/os/mutex.h"
|
||||||
|
@ -65,5 +65,5 @@ public:
|
||||||
virtual ~MIDIDriverALSAMidi();
|
virtual ~MIDIDriverALSAMidi();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // MIDI_DRIVER_ALSAMIDI_H
|
||||||
#endif
|
#endif // ALSAMIDI_ENABLED
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* core_midi.cpp */
|
/* midi_driver_coremidi.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#ifdef COREMIDI_ENABLED
|
#ifdef COREMIDI_ENABLED
|
||||||
|
|
||||||
#include "core_midi.h"
|
#include "midi_driver_coremidi.h"
|
||||||
|
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
||||||
|
|
||||||
|
@ -120,4 +120,4 @@ MIDIDriverCoreMidi::~MIDIDriverCoreMidi() {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // COREMIDI_ENABLED
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* core_midi.h */
|
/* midi_driver_coremidi.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
#ifdef COREMIDI_ENABLED
|
#ifdef COREMIDI_ENABLED
|
||||||
|
|
||||||
#ifndef CORE_MIDI_H
|
#ifndef MIDI_DRIVER_COREMIDI_H
|
||||||
#define CORE_MIDI_H
|
#define MIDI_DRIVER_COREMIDI_H
|
||||||
|
|
||||||
#include "core/os/midi_driver.h"
|
#include "core/os/midi_driver.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
|
@ -58,5 +58,5 @@ public:
|
||||||
virtual ~MIDIDriverCoreMidi();
|
virtual ~MIDIDriverCoreMidi();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // MIDI_DRIVER_COREMIDI_H
|
||||||
#endif
|
#endif // COREMIDI_ENABLED
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef RASTERIZERSTORAGEGLES2_H
|
#ifndef RASTERIZERSTORAGEGLES2_H
|
||||||
#define RASTERIZERSTORAGEGLES2_H
|
#define RASTERIZERSTORAGEGLES2_H
|
||||||
|
|
||||||
#include "core/dvector.h"
|
#include "core/pool_vector.h"
|
||||||
#include "core/self_list.h"
|
#include "core/self_list.h"
|
||||||
#include "servers/visual/rasterizer.h"
|
#include "servers/visual/rasterizer.h"
|
||||||
#include "servers/visual/shader_language.h"
|
#include "servers/visual/shader_language.h"
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* shell_windows.cpp */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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. */
|
|
||||||
/*************************************************************************/
|
|
||||||
|
|
||||||
#ifdef WINDOWS_ENABLED
|
|
||||||
|
|
||||||
#ifdef UWP_ENABLED
|
|
||||||
|
|
||||||
// Use Launcher class on windows 8
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
//
|
|
||||||
// C++ Implementation: shell_windows
|
|
||||||
//
|
|
||||||
// Description:
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2008
|
|
||||||
//
|
|
||||||
// Copyright: See COPYING file that comes with this distribution
|
|
||||||
//
|
|
||||||
//
|
|
||||||
#include "shell_windows.h"
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
void ShellWindows::execute(String p_path) {
|
|
||||||
|
|
||||||
ShellExecuteW(NULL, L"open", p_path.c_str(), NULL, NULL, SW_SHOWNORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ShellWindows::ShellWindows() {
|
|
||||||
}
|
|
||||||
|
|
||||||
ShellWindows::~ShellWindows() {
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*************************************************************************/
|
|
||||||
/* shell_windows.h */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* This file is part of: */
|
|
||||||
/* GODOT ENGINE */
|
|
||||||
/* https://godotengine.org */
|
|
||||||
/*************************************************************************/
|
|
||||||
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
|
|
||||||
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
|
|
||||||
/* */
|
|
||||||
/* 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 SHELL_WINDOWS_H
|
|
||||||
#define SHELL_WINDOWS_H
|
|
||||||
|
|
||||||
#include "core/os/shell.h"
|
|
||||||
|
|
||||||
#ifdef WINDOWS_ENABLED
|
|
||||||
|
|
||||||
/**
|
|
||||||
@author Juan Linietsky <reduzio@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ShellWindows : public Shell {
|
|
||||||
public:
|
|
||||||
virtual void execute(String p_path);
|
|
||||||
|
|
||||||
ShellWindows();
|
|
||||||
|
|
||||||
~ShellWindows();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* win_midi.cpp */
|
/* midi_driver_winmidi.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#ifdef WINMIDI_ENABLED
|
#ifdef WINMIDI_ENABLED
|
||||||
|
|
||||||
#include "win_midi.h"
|
#include "midi_driver_winmidi.h"
|
||||||
|
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
||||||
|
|
||||||
|
@ -104,4 +104,4 @@ MIDIDriverWinMidi::~MIDIDriverWinMidi() {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // WINMIDI_ENABLED
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* win_midi.h */
|
/* midi_driver_winmidi.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
#ifdef WINMIDI_ENABLED
|
#ifdef WINMIDI_ENABLED
|
||||||
|
|
||||||
#ifndef WIN_MIDI_H
|
#ifndef MIDI_DRIVER_WINMIDI_H
|
||||||
#define WIN_MIDI_H
|
#define MIDI_DRIVER_WINMIDI_H
|
||||||
|
|
||||||
#include "core/os/midi_driver.h"
|
#include "core/os/midi_driver.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
|
@ -57,5 +57,5 @@ public:
|
||||||
virtual ~MIDIDriverWinMidi();
|
virtual ~MIDIDriverWinMidi();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // MIDI_DRIVER_WINMIDI_H
|
||||||
#endif
|
#endif // WINMIDI_ENABLED
|
|
@ -42,7 +42,7 @@
|
||||||
#include "editor/plugins/script_editor_plugin.h"
|
#include "editor/plugins/script_editor_plugin.h"
|
||||||
#include "editor_node.h"
|
#include "editor_node.h"
|
||||||
#include "editor_settings.h"
|
#include "editor_settings.h"
|
||||||
#include "scene/resources/scene_format_text.h"
|
#include "scene/resources/resource_format_text.h"
|
||||||
#include "thirdparty/misc/md5.h"
|
#include "thirdparty/misc/md5.h"
|
||||||
|
|
||||||
static int _get_pad(int p_alignment, int p_n) {
|
static int _get_pad(int p_alignment, int p_n) {
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "editor_file_system.h"
|
#include "editor_file_system.h"
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
#include "core/io/resource_loader.h"
|
#include "core/io/resource_loader.h"
|
||||||
#include "core/io/resource_saver.h"
|
#include "core/io/resource_saver.h"
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef EDITOR_IMPORT_PLUGIN_H
|
#ifndef EDITOR_IMPORT_PLUGIN_H
|
||||||
#define EDITOR_IMPORT_PLUGIN_H
|
#define EDITOR_IMPORT_PLUGIN_H
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class EditorImportPlugin : public ResourceImporter {
|
class EditorImportPlugin : public ResourceImporter {
|
||||||
GDCLASS(EditorImportPlugin, Reference)
|
GDCLASS(EditorImportPlugin, Reference)
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "core/io/image_loader.h"
|
#include "core/io/image_loader.h"
|
||||||
#include "editor/editor_file_system.h"
|
#include "editor/editor_file_system.h"
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "scene/resources/bit_mask.h"
|
#include "scene/resources/bit_map.h"
|
||||||
#include "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
|
|
||||||
String ResourceImporterBitMap::get_importer_name() const {
|
String ResourceImporterBitMap::get_importer_name() const {
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define RESOURCE_IMPORTER_BITMASK_H
|
#define RESOURCE_IMPORTER_BITMASK_H
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class StreamBitMap;
|
class StreamBitMap;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef RESOURCEIMPORTERCSVTRANSLATION_H
|
#ifndef RESOURCEIMPORTERCSVTRANSLATION_H
|
||||||
#define RESOURCEIMPORTERCSVTRANSLATION_H
|
#define RESOURCEIMPORTERCSVTRANSLATION_H
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class ResourceImporterCSVTranslation : public ResourceImporter {
|
class ResourceImporterCSVTranslation : public ResourceImporter {
|
||||||
GDCLASS(ResourceImporterCSVTranslation, ResourceImporter)
|
GDCLASS(ResourceImporterCSVTranslation, ResourceImporter)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define RESOURCE_IMPORTER_IMAGE_H
|
#define RESOURCE_IMPORTER_IMAGE_H
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class ResourceImporterImage : public ResourceImporter {
|
class ResourceImporterImage : public ResourceImporter {
|
||||||
GDCLASS(ResourceImporterImage, ResourceImporter)
|
GDCLASS(ResourceImporterImage, ResourceImporter)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define RESOURCE_IMPORTER_LAYERED_TEXTURE_H
|
#define RESOURCE_IMPORTER_LAYERED_TEXTURE_H
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class StreamTexture;
|
class StreamTexture;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
#include "scene/resources/box_shape.h"
|
#include "scene/resources/box_shape.h"
|
||||||
#include "scene/resources/plane_shape.h"
|
#include "scene/resources/plane_shape.h"
|
||||||
#include "scene/resources/ray_shape.h"
|
#include "scene/resources/ray_shape.h"
|
||||||
#include "scene/resources/scene_format_text.h"
|
#include "scene/resources/resource_format_text.h"
|
||||||
#include "scene/resources/sphere_shape.h"
|
#include "scene/resources/sphere_shape.h"
|
||||||
|
|
||||||
uint32_t EditorSceneImporter::get_import_flags() const {
|
uint32_t EditorSceneImporter::get_import_flags() const {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef RESOURCEIMPORTERSCENE_H
|
#ifndef RESOURCEIMPORTERSCENE_H
|
||||||
#define RESOURCEIMPORTERSCENE_H
|
#define RESOURCEIMPORTERSCENE_H
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
#include "scene/resources/animation.h"
|
#include "scene/resources/animation.h"
|
||||||
#include "scene/resources/mesh.h"
|
#include "scene/resources/mesh.h"
|
||||||
#include "scene/resources/shape.h"
|
#include "scene/resources/shape.h"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define RESOURCEIMPORTTEXTURE_H
|
#define RESOURCEIMPORTTEXTURE_H
|
||||||
|
|
||||||
#include "core/image.h"
|
#include "core/image.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class StreamTexture;
|
class StreamTexture;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef RESOURCEIMPORTWAV_H
|
#ifndef RESOURCEIMPORTWAV_H
|
||||||
#define RESOURCEIMPORTWAV_H
|
#define RESOURCEIMPORTWAV_H
|
||||||
|
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class ResourceImporterWAV : public ResourceImporter {
|
class ResourceImporterWAV : public ResourceImporter {
|
||||||
GDCLASS(ResourceImporterWAV, ResourceImporter)
|
GDCLASS(ResourceImporterWAV, ResourceImporter)
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define IMPORTDOCK_H
|
#define IMPORTDOCK_H
|
||||||
|
|
||||||
#include "core/io/config_file.h"
|
#include "core/io/config_file.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
#include "editor/editor_file_system.h"
|
#include "editor/editor_file_system.h"
|
||||||
#include "editor/editor_inspector.h"
|
#include "editor/editor_inspector.h"
|
||||||
#include "scene/gui/box_container.h"
|
#include "scene/gui/box_container.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_plugin.h"
|
#include "editor/editor_plugin.h"
|
||||||
#include "scene/audio/audio_player.h"
|
#include "scene/audio/audio_stream_player.h"
|
||||||
#include "scene/gui/color_rect.h"
|
#include "scene/gui/color_rect.h"
|
||||||
#include "scene/resources/texture.h"
|
#include "scene/resources/texture.h"
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,9 @@
|
||||||
#include "scene/2d/light_2d.h"
|
#include "scene/2d/light_2d.h"
|
||||||
#include "scene/2d/particles_2d.h"
|
#include "scene/2d/particles_2d.h"
|
||||||
#include "scene/2d/polygon_2d.h"
|
#include "scene/2d/polygon_2d.h"
|
||||||
#include "scene/2d/screen_button.h"
|
|
||||||
#include "scene/2d/skeleton_2d.h"
|
#include "scene/2d/skeleton_2d.h"
|
||||||
#include "scene/2d/sprite.h"
|
#include "scene/2d/sprite.h"
|
||||||
|
#include "scene/2d/touch_screen_button.h"
|
||||||
#include "scene/gui/grid_container.h"
|
#include "scene/gui/grid_container.h"
|
||||||
#include "scene/gui/nine_patch_rect.h"
|
#include "scene/gui/nine_patch_rect.h"
|
||||||
#include "scene/main/canvas_layer.h"
|
#include "scene/main/canvas_layer.h"
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
#include "scene/resources/circle_shape_2d.h"
|
#include "scene/resources/circle_shape_2d.h"
|
||||||
#include "scene/resources/concave_polygon_shape_2d.h"
|
#include "scene/resources/concave_polygon_shape_2d.h"
|
||||||
#include "scene/resources/convex_polygon_shape_2d.h"
|
#include "scene/resources/convex_polygon_shape_2d.h"
|
||||||
|
#include "scene/resources/line_shape_2d.h"
|
||||||
#include "scene/resources/rectangle_shape_2d.h"
|
#include "scene/resources/rectangle_shape_2d.h"
|
||||||
#include "scene/resources/segment_shape_2d.h"
|
#include "scene/resources/segment_shape_2d.h"
|
||||||
#include "scene/resources/shape_line_2d.h"
|
|
||||||
|
|
||||||
Variant CollisionShape2DEditor::get_handle_value(int idx) const {
|
Variant CollisionShape2DEditor::get_handle_value(int idx) const {
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_scale.h"
|
#include "editor/editor_scale.h"
|
||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
#include "scene/resources/bit_mask.h"
|
#include "scene/resources/bit_map.h"
|
||||||
#include "scene/resources/dynamic_font.h"
|
#include "scene/resources/dynamic_font.h"
|
||||||
#include "scene/resources/material.h"
|
#include "scene/resources/material.h"
|
||||||
#include "scene/resources/mesh.h"
|
#include "scene/resources/mesh.h"
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
#include "core/print_string.h"
|
#include "core/print_string.h"
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
#include "core/sort.h"
|
#include "core/sort_array.h"
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
#include "editor/plugins/animation_player_editor_plugin.h"
|
#include "editor/plugins/animation_player_editor_plugin.h"
|
||||||
|
|
|
@ -53,11 +53,11 @@
|
||||||
#include "drivers/register_driver_types.h"
|
#include "drivers/register_driver_types.h"
|
||||||
#include "main/app_icon.gen.h"
|
#include "main/app_icon.gen.h"
|
||||||
#include "main/input_default.h"
|
#include "main/input_default.h"
|
||||||
|
#include "main/main_timer_sync.h"
|
||||||
#include "main/performance.h"
|
#include "main/performance.h"
|
||||||
#include "main/splash.gen.h"
|
#include "main/splash.gen.h"
|
||||||
#include "main/splash_editor.gen.h"
|
#include "main/splash_editor.gen.h"
|
||||||
#include "main/tests/test_main.h"
|
#include "main/tests/test_main.h"
|
||||||
#include "main/timer_sync.h"
|
|
||||||
#include "modules/register_module_types.h"
|
#include "modules/register_module_types.h"
|
||||||
#include "platform/register_platform_apis.h"
|
#include "platform/register_platform_apis.h"
|
||||||
#include "scene/main/scene_tree.h"
|
#include "scene/main/scene_tree.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* timer_sync.cpp */
|
/* main_timer_sync.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "timer_sync.h"
|
#include "main_timer_sync.h"
|
||||||
|
|
||||||
void MainFrameTime::clamp_idle(float min_idle_step, float max_idle_step) {
|
void MainFrameTime::clamp_idle(float min_idle_step, float max_idle_step) {
|
||||||
if (idle_step < min_idle_step) {
|
if (idle_step < min_idle_step) {
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* timer_sync.h */
|
/* main_timer_sync.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef TIMER_SYNC_H
|
#ifndef MAIN_TIMER_SYNC_H
|
||||||
#define TIMER_SYNC_H
|
#define MAIN_TIMER_SYNC_H
|
||||||
|
|
||||||
#include "core/engine.h"
|
#include "core/engine.h"
|
||||||
|
|
||||||
|
@ -98,4 +98,4 @@ public:
|
||||||
MainFrameTime advance(float p_frame_slice, int p_iterations_per_second);
|
MainFrameTime advance(float p_frame_slice, int p_iterations_per_second);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TIMER_SYNC_H
|
#endif // MAIN_TIMER_SYNC_H
|
|
@ -32,7 +32,7 @@
|
||||||
#include "core/math/face3.h"
|
#include "core/math/face3.h"
|
||||||
#include "core/math/geometry.h"
|
#include "core/math/geometry.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/sort.h"
|
#include "core/sort_array.h"
|
||||||
#include "thirdparty/misc/triangulator.h"
|
#include "thirdparty/misc/triangulator.h"
|
||||||
|
|
||||||
void CSGBrush::clear() {
|
void CSGBrush::clear() {
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#ifndef CSG_H
|
#ifndef CSG_H
|
||||||
#define CSG_H
|
#define CSG_H
|
||||||
|
|
||||||
#include "core/dvector.h"
|
|
||||||
#include "core/map.h"
|
#include "core/map.h"
|
||||||
#include "core/math/aabb.h"
|
#include "core/math/aabb.h"
|
||||||
#include "core/math/plane.h"
|
#include "core/math/plane.h"
|
||||||
|
@ -39,6 +38,7 @@
|
||||||
#include "core/math/transform.h"
|
#include "core/math/transform.h"
|
||||||
#include "core/math/vector3.h"
|
#include "core/math/vector3.h"
|
||||||
#include "core/oa_hash_map.h"
|
#include "core/oa_hash_map.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
#include "scene/resources/material.h"
|
#include "scene/resources/material.h"
|
||||||
|
|
||||||
struct CSGBrush {
|
struct CSGBrush {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "arvr_interface_gdnative.h"
|
#include "arvr_interface_gdnative.h"
|
||||||
#include "main/input_default.h"
|
#include "main/input_default.h"
|
||||||
#include "servers/arvr/arvr_positional_tracker.h"
|
#include "servers/arvr/arvr_positional_tracker.h"
|
||||||
#include "servers/visual/visual_server_global.h"
|
#include "servers/visual/visual_server_globals.h"
|
||||||
|
|
||||||
ARVRInterfaceGDNative::ARVRInterfaceGDNative() {
|
ARVRInterfaceGDNative::ARVRInterfaceGDNative() {
|
||||||
// testing
|
// testing
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
|
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
#include "core/dvector.h"
|
#include "core/pool_vector.h"
|
||||||
|
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "gdnative/pool_arrays.h"
|
#include "gdnative/pool_arrays.h"
|
||||||
|
|
||||||
#include "core/array.h"
|
#include "core/array.h"
|
||||||
#include "core/dvector.h"
|
#include "core/pool_vector.h"
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
|
|
||||||
#include "core/color.h"
|
#include "core/color.h"
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "gdnative/string.h"
|
#include "gdnative/string.h"
|
||||||
|
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include "gdnative/string_name.h"
|
#include "gdnative/string_name.h"
|
||||||
|
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
|
|
||||||
#include "scene/main/scene_tree.h"
|
#include "scene/main/scene_tree.h"
|
||||||
#include "scene/resources/scene_format_text.h"
|
#include "scene/resources/resource_format_text.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#include "core/script_language.h"
|
#include "core/script_language.h"
|
||||||
#include "core/self_list.h"
|
#include "core/self_list.h"
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
|
|
||||||
class GDScriptInstance;
|
class GDScriptInstance;
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define GDSCRIPT_TOKENIZER_H
|
#define GDSCRIPT_TOKENIZER_H
|
||||||
|
|
||||||
#include "core/pair.h"
|
#include "core/pair.h"
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
#include "core/ustring.h"
|
#include "core/ustring.h"
|
||||||
#include "core/variant.h"
|
#include "core/variant.h"
|
||||||
#include "core/vmap.h"
|
#include "core/vmap.h"
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include "mobile_vr_interface.h"
|
#include "mobile_vr_interface.h"
|
||||||
#include "core/os/input.h"
|
#include "core/os/input.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "servers/visual/visual_server_global.h"
|
#include "servers/visual/visual_server_globals.h"
|
||||||
|
|
||||||
StringName MobileVRInterface::get_name() const {
|
StringName MobileVRInterface::get_name() const {
|
||||||
return "Native mobile";
|
return "Native mobile";
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#ifdef MONO_GLUE_ENABLED
|
#ifdef MONO_GLUE_ENABLED
|
||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#include "core/string_db.h"
|
#include "core/string_name.h"
|
||||||
|
|
||||||
#include "../csharp_script.h"
|
#include "../csharp_script.h"
|
||||||
#include "../mono_gd/gd_mono_internals.h"
|
#include "../mono_gd/gd_mono_internals.h"
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define GDMONOFIELD_H
|
#define GDMONOFIELD_H
|
||||||
|
|
||||||
#include "gd_mono.h"
|
#include "gd_mono.h"
|
||||||
#include "gd_mono_class_member.h"
|
|
||||||
#include "gd_mono_header.h"
|
#include "gd_mono_header.h"
|
||||||
|
#include "i_mono_class_member.h"
|
||||||
|
|
||||||
class GDMonoField : public IMonoClassMember {
|
class GDMonoField : public IMonoClassMember {
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define GD_MONO_METHOD_H
|
#define GD_MONO_METHOD_H
|
||||||
|
|
||||||
#include "gd_mono.h"
|
#include "gd_mono.h"
|
||||||
#include "gd_mono_class_member.h"
|
|
||||||
#include "gd_mono_header.h"
|
#include "gd_mono_header.h"
|
||||||
|
#include "i_mono_class_member.h"
|
||||||
|
|
||||||
class GDMonoMethod : public IMonoClassMember {
|
class GDMonoMethod : public IMonoClassMember {
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define GD_MONO_PROPERTY_H
|
#define GD_MONO_PROPERTY_H
|
||||||
|
|
||||||
#include "gd_mono.h"
|
#include "gd_mono.h"
|
||||||
#include "gd_mono_class_member.h"
|
|
||||||
#include "gd_mono_header.h"
|
#include "gd_mono_header.h"
|
||||||
|
#include "i_mono_class_member.h"
|
||||||
|
|
||||||
class GDMonoProperty : public IMonoClassMember {
|
class GDMonoProperty : public IMonoClassMember {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* gd_mono_class_member.h */
|
/* i_mono_class_member.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef GD_MONO_CLASS_MEMBER_H
|
#ifndef I_MONO_CLASS_MEMBER_H
|
||||||
#define GD_MONO_CLASS_MEMBER_H
|
#define I_MONO_CLASS_MEMBER_H
|
||||||
|
|
||||||
#include "gd_mono_header.h"
|
#include "gd_mono_header.h"
|
||||||
|
|
||||||
|
@ -65,4 +65,4 @@ public:
|
||||||
virtual MonoObject *get_attribute(GDMonoClass *p_attr_class) = 0;
|
virtual MonoObject *get_attribute(GDMonoClass *p_attr_class) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GD_MONO_CLASS_MEMBER_H
|
#endif // I_MONO_CLASS_MEMBER_H
|
|
@ -32,7 +32,7 @@
|
||||||
#define RESOURCEIMPORTEROGGVORBIS_H
|
#define RESOURCEIMPORTEROGGVORBIS_H
|
||||||
|
|
||||||
#include "audio_stream_ogg_vorbis.h"
|
#include "audio_stream_ogg_vorbis.h"
|
||||||
#include "core/io/resource_import.h"
|
#include "core/io/resource_importer.h"
|
||||||
|
|
||||||
class ResourceImporterOGGVorbis : public ResourceImporter {
|
class ResourceImporterOGGVorbis : public ResourceImporter {
|
||||||
GDCLASS(ResourceImporterOGGVorbis, ResourceImporter)
|
GDCLASS(ResourceImporterOGGVorbis, ResourceImporter)
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "core/error_macros.h"
|
#include "core/error_macros.h"
|
||||||
|
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
#include "upnpdevice.h"
|
#include "upnp_device.h"
|
||||||
|
|
||||||
void register_upnp_types() {
|
void register_upnp_types() {
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
|
|
||||||
#include "upnpdevice.h"
|
#include "upnp_device.h"
|
||||||
|
|
||||||
#include <miniupnpc/miniupnpc.h>
|
#include <miniupnpc/miniupnpc.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* upnpdevice.cpp */
|
/* upnp_device.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "upnpdevice.h"
|
#include "upnp_device.h"
|
||||||
|
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* upnpdevice.h */
|
/* upnp_device.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef GODOT_UPNPDEVICE_H
|
#ifndef GODOT_UPNP_DEVICE_H
|
||||||
#define GODOT_UPNPDEVICE_H
|
#define GODOT_UPNP_DEVICE_H
|
||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
|
|
||||||
|
@ -92,4 +92,4 @@ private:
|
||||||
|
|
||||||
VARIANT_ENUM_CAST(UPNPDevice::IGDStatus)
|
VARIANT_ENUM_CAST(UPNPDevice::IGDStatus)
|
||||||
|
|
||||||
#endif // GODOT_UPNPDEVICE_H
|
#endif // GODOT_UPNP_DEVICE_H
|
|
@ -32,7 +32,7 @@
|
||||||
#define WEBSOCKET_CLIENT_H
|
#define WEBSOCKET_CLIENT_H
|
||||||
|
|
||||||
#include "core/error_list.h"
|
#include "core/error_list.h"
|
||||||
#include "websocket_multiplayer.h"
|
#include "websocket_multiplayer_peer.h"
|
||||||
#include "websocket_peer.h"
|
#include "websocket_peer.h"
|
||||||
|
|
||||||
class WebSocketClient : public WebSocketMultiplayerPeer {
|
class WebSocketClient : public WebSocketMultiplayerPeer {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* websocket_multiplayer.cpp */
|
/* websocket_multiplayer_peer.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "websocket_multiplayer.h"
|
#include "websocket_multiplayer_peer.h"
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
|
||||||
WebSocketMultiplayerPeer::WebSocketMultiplayerPeer() {
|
WebSocketMultiplayerPeer::WebSocketMultiplayerPeer() {
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* websocket_multiplayer.h */
|
/* websocket_multiplayer_peer.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
|
@ -32,7 +32,7 @@
|
||||||
#define WEBSOCKET_H
|
#define WEBSOCKET_H
|
||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#include "websocket_multiplayer.h"
|
#include "websocket_multiplayer_peer.h"
|
||||||
#include "websocket_peer.h"
|
#include "websocket_peer.h"
|
||||||
|
|
||||||
class WebSocketServer : public WebSocketMultiplayerPeer {
|
class WebSocketServer : public WebSocketMultiplayerPeer {
|
||||||
|
|
|
@ -206,9 +206,9 @@ static const LauncherIcon launcher_icons[] = {
|
||||||
{ "launcher_icons/mdpi_48x48", "res/drawable-mdpi-v4/icon.png" }
|
{ "launcher_icons/mdpi_48x48", "res/drawable-mdpi-v4/icon.png" }
|
||||||
};
|
};
|
||||||
|
|
||||||
class EditorExportAndroid : public EditorExportPlatform {
|
class EditorExportPlatformAndroid : public EditorExportPlatform {
|
||||||
|
|
||||||
GDCLASS(EditorExportAndroid, EditorExportPlatform)
|
GDCLASS(EditorExportPlatformAndroid, EditorExportPlatform)
|
||||||
|
|
||||||
Ref<ImageTexture> logo;
|
Ref<ImageTexture> logo;
|
||||||
Ref<ImageTexture> run_icon;
|
Ref<ImageTexture> run_icon;
|
||||||
|
@ -235,7 +235,7 @@ class EditorExportAndroid : public EditorExportPlatform {
|
||||||
|
|
||||||
static void _device_poll_thread(void *ud) {
|
static void _device_poll_thread(void *ud) {
|
||||||
|
|
||||||
EditorExportAndroid *ea = (EditorExportAndroid *)ud;
|
EditorExportPlatformAndroid *ea = (EditorExportPlatformAndroid *)ud;
|
||||||
|
|
||||||
while (!ea->quit_request) {
|
while (!ea->quit_request) {
|
||||||
|
|
||||||
|
@ -1925,7 +1925,7 @@ public:
|
||||||
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) {
|
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorExportAndroid() {
|
EditorExportPlatformAndroid() {
|
||||||
|
|
||||||
Ref<Image> img = memnew(Image(_android_logo));
|
Ref<Image> img = memnew(Image(_android_logo));
|
||||||
logo.instance();
|
logo.instance();
|
||||||
|
@ -1941,7 +1941,7 @@ public:
|
||||||
device_thread = Thread::create(_device_poll_thread, this);
|
device_thread = Thread::create(_device_poll_thread, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~EditorExportAndroid() {
|
~EditorExportPlatformAndroid() {
|
||||||
quit_request = true;
|
quit_request = true;
|
||||||
Thread::wait_to_finish(device_thread);
|
Thread::wait_to_finish(device_thread);
|
||||||
memdelete(device_lock);
|
memdelete(device_lock);
|
||||||
|
@ -1969,6 +1969,6 @@ void register_android_exporter() {
|
||||||
EDITOR_DEF("export/android/timestamping_authority_url", "");
|
EDITOR_DEF("export/android/timestamping_authority_url", "");
|
||||||
EDITOR_DEF("export/android/shutdown_adb_on_exit", true);
|
EDITOR_DEF("export/android/shutdown_adb_on_exit", true);
|
||||||
|
|
||||||
Ref<EditorExportAndroid> exporter = Ref<EditorExportAndroid>(memnew(EditorExportAndroid));
|
Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>(memnew(EditorExportPlatformAndroid));
|
||||||
EditorExport::get_singleton()->add_export_platform(exporter);
|
EditorExport::get_singleton()->add_export_platform(exporter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
|
||||||
input = memnew(InputDefault);
|
input = memnew(InputDefault);
|
||||||
input->set_fallback_mapping("Default Android Gamepad");
|
input->set_fallback_mapping("Default Android Gamepad");
|
||||||
|
|
||||||
//power_manager = memnew(power_android);
|
//power_manager = memnew(PowerAndroid);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ private:
|
||||||
SetKeepScreenOnFunc set_keep_screen_on_func;
|
SetKeepScreenOnFunc set_keep_screen_on_func;
|
||||||
AlertFunc alert_func;
|
AlertFunc alert_func;
|
||||||
|
|
||||||
//power_android *power_manager;
|
//PowerAndroid *power_manager;
|
||||||
int video_driver_index;
|
int video_driver_index;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -190,7 +190,7 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool power_android::GetPowerInfo_Android() {
|
bool PowerAndroid::GetPowerInfo_Android() {
|
||||||
int battery;
|
int battery;
|
||||||
int plugged;
|
int plugged;
|
||||||
int charged;
|
int charged;
|
||||||
|
@ -218,7 +218,7 @@ bool power_android::GetPowerInfo_Android() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
OS::PowerState power_android::get_power_state() {
|
OS::PowerState PowerAndroid::get_power_state() {
|
||||||
if (GetPowerInfo_Android()) {
|
if (GetPowerInfo_Android()) {
|
||||||
return power_state;
|
return power_state;
|
||||||
} else {
|
} else {
|
||||||
|
@ -227,7 +227,7 @@ OS::PowerState power_android::get_power_state() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_android::get_power_seconds_left() {
|
int PowerAndroid::get_power_seconds_left() {
|
||||||
if (GetPowerInfo_Android()) {
|
if (GetPowerInfo_Android()) {
|
||||||
return nsecs_left;
|
return nsecs_left;
|
||||||
} else {
|
} else {
|
||||||
|
@ -236,7 +236,7 @@ int power_android::get_power_seconds_left() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_android::get_power_percent_left() {
|
int PowerAndroid::get_power_percent_left() {
|
||||||
if (GetPowerInfo_Android()) {
|
if (GetPowerInfo_Android()) {
|
||||||
return percent_left;
|
return percent_left;
|
||||||
} else {
|
} else {
|
||||||
|
@ -245,11 +245,11 @@ int power_android::get_power_percent_left() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
power_android::power_android() :
|
PowerAndroid::PowerAndroid() :
|
||||||
nsecs_left(-1),
|
nsecs_left(-1),
|
||||||
percent_left(-1),
|
percent_left(-1),
|
||||||
power_state(OS::POWERSTATE_UNKNOWN) {
|
power_state(OS::POWERSTATE_UNKNOWN) {
|
||||||
}
|
}
|
||||||
|
|
||||||
power_android::~power_android() {
|
PowerAndroid::~PowerAndroid() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,14 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef PLATFORM_ANDROID_POWER_ANDROID_H_
|
#ifndef POWER_ANDROID_H
|
||||||
#define PLATFORM_ANDROID_POWER_ANDROID_H_
|
#define POWER_ANDROID_H
|
||||||
|
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
|
|
||||||
#include <android/native_window_jni.h>
|
#include <android/native_window_jni.h>
|
||||||
|
|
||||||
class power_android {
|
class PowerAndroid {
|
||||||
|
|
||||||
struct LocalReferenceHolder {
|
struct LocalReferenceHolder {
|
||||||
JNIEnv *m_env;
|
JNIEnv *m_env;
|
||||||
|
@ -65,8 +66,8 @@ private:
|
||||||
public:
|
public:
|
||||||
static int s_active;
|
static int s_active;
|
||||||
|
|
||||||
power_android();
|
PowerAndroid();
|
||||||
virtual ~power_android();
|
virtual ~PowerAndroid();
|
||||||
static bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env);
|
static bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env);
|
||||||
static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func);
|
static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func);
|
||||||
static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder);
|
static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder);
|
||||||
|
@ -76,4 +77,4 @@ public:
|
||||||
int get_power_percent_left();
|
int get_power_percent_left();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PLATFORM_ANDROID_POWER_ANDROID_H_ */
|
#endif // POWER_ANDROID_H
|
||||||
|
|
|
@ -7,7 +7,7 @@ import os
|
||||||
iphone_lib = [
|
iphone_lib = [
|
||||||
'godot_iphone.cpp',
|
'godot_iphone.cpp',
|
||||||
'os_iphone.cpp',
|
'os_iphone.cpp',
|
||||||
'sem_iphone.cpp',
|
'semaphore_iphone.cpp',
|
||||||
'gl_view.mm',
|
'gl_view.mm',
|
||||||
'main.m',
|
'main.m',
|
||||||
'app_delegate.mm',
|
'app_delegate.mm',
|
||||||
|
|
|
@ -45,9 +45,10 @@
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
#include "drivers/unix/syslog_logger.h"
|
#include "drivers/unix/syslog_logger.h"
|
||||||
|
|
||||||
#include "sem_iphone.h"
|
#include "semaphore_iphone.h"
|
||||||
|
|
||||||
#include "ios.h"
|
#include "ios.h"
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
int OSIPhone::get_video_driver_count() const {
|
int OSIPhone::get_video_driver_count() const {
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef PLATFORM_IPHONE_POWER_IPHONE_H_
|
#ifndef POWER_IPHONE_H
|
||||||
#define PLATFORM_IPHONE_POWER_IPHONE_H_
|
#define POWER_IPHONE_H
|
||||||
|
|
||||||
#include <os/os.h>
|
#include <os/os.h>
|
||||||
|
|
||||||
|
@ -50,4 +50,4 @@ public:
|
||||||
int get_power_percent_left();
|
int get_power_percent_left();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PLATFORM_IPHONE_POWER_IPHONE_H_ */
|
#endif // POWER_IPHONE_H
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* sem_iphone.cpp */
|
/* semaphore_iphone.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "sem_iphone.h"
|
#include "semaphore_iphone.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -71,6 +71,7 @@ void cgsem_destroy(cgsem_t *cgsem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
Error SemaphoreIphone::wait() {
|
Error SemaphoreIphone::wait() {
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* sem_iphone.h */
|
/* semaphore_iphone.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef SEM_IPHONE_H
|
#ifndef SEMAPHORE_IPHONE_H
|
||||||
#define SEM_IPHONE_H
|
#define SEMAPHORE_IPHONE_H
|
||||||
|
|
||||||
struct cgsem {
|
struct cgsem {
|
||||||
int pipefd[2];
|
int pipefd[2];
|
||||||
|
@ -56,4 +56,4 @@ public:
|
||||||
~SemaphoreIphone();
|
~SemaphoreIphone();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // SEMAPHORE_IPHONE_H
|
|
@ -10,7 +10,7 @@ files = [
|
||||||
'crash_handler_osx.mm',
|
'crash_handler_osx.mm',
|
||||||
'os_osx.mm',
|
'os_osx.mm',
|
||||||
'godot_main_osx.mm',
|
'godot_main_osx.mm',
|
||||||
'sem_osx.cpp',
|
'semaphore_osx.cpp',
|
||||||
'dir_access_osx.mm',
|
'dir_access_osx.mm',
|
||||||
'joypad_osx.cpp',
|
'joypad_osx.cpp',
|
||||||
'power_osx.cpp',
|
'power_osx.cpp',
|
||||||
|
|
|
@ -45,4 +45,4 @@ public:
|
||||||
~CrashHandler();
|
~CrashHandler();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // CRASH_HANDLER_OSX_H
|
||||||
|
|
|
@ -28,9 +28,11 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
#include "crash_handler_osx.h"
|
||||||
|
|
||||||
|
#include "core/os/os.h"
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
#include "os_osx.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "core/os/input.h"
|
#include "core/os/input.h"
|
||||||
#include "crash_handler_osx.h"
|
#include "crash_handler_osx.h"
|
||||||
#include "drivers/coreaudio/audio_driver_coreaudio.h"
|
#include "drivers/coreaudio/audio_driver_coreaudio.h"
|
||||||
#include "drivers/coremidi/core_midi.h"
|
#include "drivers/coremidi/midi_driver_coremidi.h"
|
||||||
#include "drivers/unix/os_unix.h"
|
#include "drivers/unix/os_unix.h"
|
||||||
#include "joypad_osx.h"
|
#include "joypad_osx.h"
|
||||||
#include "main/input_default.h"
|
#include "main/input_default.h"
|
||||||
|
@ -43,6 +43,7 @@
|
||||||
#include "servers/visual/rasterizer.h"
|
#include "servers/visual/rasterizer.h"
|
||||||
#include "servers/visual/visual_server_wrap_mt.h"
|
#include "servers/visual/visual_server_wrap_mt.h"
|
||||||
#include "servers/visual_server.h"
|
#include "servers/visual_server.h"
|
||||||
|
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
#include <AppKit/NSCursor.h>
|
#include <AppKit/NSCursor.h>
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
|
@ -132,7 +133,7 @@ public:
|
||||||
String im_text;
|
String im_text;
|
||||||
Point2 im_selection;
|
Point2 im_selection;
|
||||||
|
|
||||||
power_osx *power_manager;
|
PowerOSX *power_manager;
|
||||||
|
|
||||||
CrashHandler crash_handler;
|
CrashHandler crash_handler;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "drivers/gles2/rasterizer_gles2.h"
|
#include "drivers/gles2/rasterizer_gles2.h"
|
||||||
#include "drivers/gles3/rasterizer_gles3.h"
|
#include "drivers/gles3/rasterizer_gles3.h"
|
||||||
#include "main/main.h"
|
#include "main/main.h"
|
||||||
#include "sem_osx.h"
|
#include "semaphore_osx.h"
|
||||||
#include "servers/visual/visual_server_raster.h"
|
#include "servers/visual/visual_server_raster.h"
|
||||||
|
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
|
@ -1461,7 +1461,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||||
input = memnew(InputDefault);
|
input = memnew(InputDefault);
|
||||||
joypad_osx = memnew(JoypadOSX);
|
joypad_osx = memnew(JoypadOSX);
|
||||||
|
|
||||||
power_manager = memnew(power_osx);
|
power_manager = memnew(PowerOSX);
|
||||||
|
|
||||||
_ensure_user_data_dir();
|
_ensure_user_data_dir();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ Adapted from corresponding SDL 2.0 code.
|
||||||
CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **)v)
|
CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **)v)
|
||||||
|
|
||||||
/* Note that AC power sources also include a laptop battery it is charging. */
|
/* Note that AC power sources also include a laptop battery it is charging. */
|
||||||
void power_osx::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery, bool *charging) {
|
void PowerOSX::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery, bool *charging) {
|
||||||
CFStringRef strval; /* don't CFRelease() this. */
|
CFStringRef strval; /* don't CFRelease() this. */
|
||||||
CFBooleanRef bval;
|
CFBooleanRef bval;
|
||||||
CFNumberRef numval;
|
CFNumberRef numval;
|
||||||
|
@ -169,7 +169,7 @@ void power_osx::checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery,
|
||||||
#undef STRMATCH
|
#undef STRMATCH
|
||||||
|
|
||||||
// CODE CHUNK IMPORTED FROM SDL 2.0
|
// CODE CHUNK IMPORTED FROM SDL 2.0
|
||||||
bool power_osx::GetPowerInfo_MacOSX() {
|
bool PowerOSX::GetPowerInfo_MacOSX() {
|
||||||
CFTypeRef blob = IOPSCopyPowerSourcesInfo();
|
CFTypeRef blob = IOPSCopyPowerSourcesInfo();
|
||||||
|
|
||||||
nsecs_left = -1;
|
nsecs_left = -1;
|
||||||
|
@ -211,14 +211,14 @@ bool power_osx::GetPowerInfo_MacOSX() {
|
||||||
return true; /* always the definitive answer on Mac OS X. */
|
return true; /* always the definitive answer on Mac OS X. */
|
||||||
}
|
}
|
||||||
|
|
||||||
bool power_osx::UpdatePowerInfo() {
|
bool PowerOSX::UpdatePowerInfo() {
|
||||||
if (GetPowerInfo_MacOSX()) {
|
if (GetPowerInfo_MacOSX()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OS::PowerState power_osx::get_power_state() {
|
OS::PowerState PowerOSX::get_power_state() {
|
||||||
if (UpdatePowerInfo()) {
|
if (UpdatePowerInfo()) {
|
||||||
return power_state;
|
return power_state;
|
||||||
} else {
|
} else {
|
||||||
|
@ -226,7 +226,7 @@ OS::PowerState power_osx::get_power_state() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_osx::get_power_seconds_left() {
|
int PowerOSX::get_power_seconds_left() {
|
||||||
if (UpdatePowerInfo()) {
|
if (UpdatePowerInfo()) {
|
||||||
return nsecs_left;
|
return nsecs_left;
|
||||||
} else {
|
} else {
|
||||||
|
@ -234,7 +234,7 @@ int power_osx::get_power_seconds_left() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int power_osx::get_power_percent_left() {
|
int PowerOSX::get_power_percent_left() {
|
||||||
if (UpdatePowerInfo()) {
|
if (UpdatePowerInfo()) {
|
||||||
return percent_left;
|
return percent_left;
|
||||||
} else {
|
} else {
|
||||||
|
@ -242,11 +242,11 @@ int power_osx::get_power_percent_left() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
power_osx::power_osx() :
|
PowerOSX::PowerOSX() :
|
||||||
nsecs_left(-1),
|
nsecs_left(-1),
|
||||||
percent_left(-1),
|
percent_left(-1),
|
||||||
power_state(OS::POWERSTATE_UNKNOWN) {
|
power_state(OS::POWERSTATE_UNKNOWN) {
|
||||||
}
|
}
|
||||||
|
|
||||||
power_osx::~power_osx() {
|
PowerOSX::~PowerOSX() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,15 +28,16 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef PLATFORM_OSX_POWER_OSX_H_
|
#ifndef POWER_OSX_H
|
||||||
#define PLATFORM_OSX_POWER_OSX_H_
|
#define POWER_OSX_H
|
||||||
|
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "dir_access_osx.h"
|
#include "dir_access_osx.h"
|
||||||
|
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
class power_osx {
|
class PowerOSX {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nsecs_left;
|
int nsecs_left;
|
||||||
|
@ -47,12 +48,12 @@ private:
|
||||||
bool UpdatePowerInfo();
|
bool UpdatePowerInfo();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
power_osx();
|
PowerOSX();
|
||||||
virtual ~power_osx();
|
virtual ~PowerOSX();
|
||||||
|
|
||||||
OS::PowerState get_power_state();
|
OS::PowerState get_power_state();
|
||||||
int get_power_seconds_left();
|
int get_power_seconds_left();
|
||||||
int get_power_percent_left();
|
int get_power_percent_left();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PLATFORM_OSX_POWER_OSX_H_ */
|
#endif // POWER_OSX_H
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* sem_osx.cpp */
|
/* semaphore_osx.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "sem_osx.h"
|
#include "semaphore_osx.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -66,6 +66,7 @@ void cgsem_destroy(cgsem_t *cgsem) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
Error SemaphoreOSX::wait() {
|
Error SemaphoreOSX::wait() {
|
|
@ -1,5 +1,5 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* sem_osx.h */
|
/* semaphore_osx.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* GODOT ENGINE */
|
/* GODOT ENGINE */
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#ifndef SEM_OSX_H
|
#ifndef SEMAPHORE_OSX_H
|
||||||
#define SEM_OSX_H
|
#define SEMAPHORE_OSX_H
|
||||||
|
|
||||||
struct cgsem {
|
struct cgsem {
|
||||||
int pipefd[2];
|
int pipefd[2];
|
||||||
|
@ -56,4 +56,4 @@ public:
|
||||||
~SemaphoreOSX();
|
~SemaphoreOSX();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // SEMAPHORE_OSX_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue