Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/core/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace godot {

class String;

struct Color {
class Color {
public:
union {
struct {
float r;
Expand Down
3 changes: 2 additions & 1 deletion include/core/Rect2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace godot {

struct Transform2D;

struct Rect2 {
class Rect2 {
public:
Point2 position;
Size2 size;

Expand Down
3 changes: 2 additions & 1 deletion include/core/Rect2i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

namespace godot {

struct Rect2i {
class Rect2i {
public:
Point2i position;
Size2i size;

Expand Down
3 changes: 2 additions & 1 deletion include/core/Transform2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

namespace godot {

struct Transform2D {
class Transform2D {
public:
// Warning #1: basis of Transform2D is stored differently from Basis. In terms of elements array, the basis matrix looks like "on paper":
// M = (elements[0][0] elements[1][0])
// (elements[0][1] elements[1][1])
Expand Down
5 changes: 3 additions & 2 deletions include/core/Vector2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

namespace godot {

struct Vector2i;
class Vector2i;

struct Vector2 {
class Vector2 {
public:
enum Axis {
AXIS_X,
AXIS_Y,
Expand Down
3 changes: 2 additions & 1 deletion include/core/Vector2i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

namespace godot {

struct Vector2i {
class Vector2i {
public:
enum Axis {
AXIS_X,
AXIS_Y,
Expand Down
5 changes: 3 additions & 2 deletions include/core/Vector3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
namespace godot {

class Basis;
struct Vector3i;
class Vector3i;

struct Vector3 {
class Vector3 {
public:
enum Axis {
AXIS_X,
AXIS_Y,
Expand Down
3 changes: 2 additions & 1 deletion include/core/Vector3i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

namespace godot {

struct Vector3i {
class Vector3i {
public:
enum Axis {
AXIS_X,
AXIS_Y,
Expand Down
6 changes: 3 additions & 3 deletions src/core/GodotGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ void Godot::nativescript_terminate(void *handle) {
godot::nativescript_api->godot_nativescript_unregister_instance_binding_data_functions(godot::_RegisterState::language_index);
}

static void print_warning(const char *description, const char *function, const char *file, int line) {
void Godot::print_warning(const char *description, const char *function, const char *file, int line) {
godot::api->godot_print_warning(description, function, file, line);
}
static void print_error(const char *description, const char *function, const char *file, int line) {
void Godot::print_error(const char *description, const char *function, const char *file, int line) {
godot::api->godot_print_error(description, function, file, line);
}
static void print_script_error(const char *description, const char *function, const char *file, int line) {
void Godot::print_script_error(const char *description, const char *function, const char *file, int line) {
godot::api->godot_print_script_error(description, function, file, line);
}

Expand Down
7 changes: 4 additions & 3 deletions src/core/Variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Variant::operator String() const {
godot_string s = godot::api->godot_variant_as_string(&_godot_variant);
return String(s);
}

Variant::operator Vector2() const {
godot_vector2 s = godot::api->godot_variant_as_vector2(&_godot_variant);
return Vector2(s);
Expand Down Expand Up @@ -345,7 +346,7 @@ bool Variant::operator==(const Variant &b) const {
return false;
}
valid = godot::api->godot_variant_as_bool(&result);
godot_variant_destroy(&result);
godot::api->godot_variant_destroy(&result);
return valid;
}

Expand All @@ -361,7 +362,7 @@ bool Variant::operator<(const Variant &b) const {
return false;
}
valid = godot::api->godot_variant_as_bool(&result);
godot_variant_destroy(&result);
godot::api->godot_variant_destroy(&result);
return valid;
}

Expand All @@ -373,7 +374,7 @@ bool Variant::operator<=(const Variant &b) const {
return false;
}
valid = godot::api->godot_variant_as_bool(&result);
godot_variant_destroy(&result);
godot::api->godot_variant_destroy(&result);
return valid;
}

Expand Down