Small tweaks to some of the copyright headers.

This commit is contained in:
Relintai 2023-12-31 14:34:19 +01:00
parent 052acd6f75
commit 47b327bbf7
3 changed files with 14 additions and 6 deletions

View File

@ -4,9 +4,11 @@
#include "ustring.h" #include "ustring.h"
#include "vector.h" #include "vector.h"
class Database; /*************************************************************************/
/* object.h */
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
/*************************************************************************/
//taken from GodotEngine's object.h
#define SFW_OBJECT(m_class, m_inherits) \ #define SFW_OBJECT(m_class, m_inherits) \
private: \ private: \
void operator=(const m_class &p_rval) {} \ void operator=(const m_class &p_rval) {} \

View File

@ -1,5 +1,10 @@
#include "reference.h" #include "reference.h"
/*************************************************************************/
/* reference.cpp */
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
/*************************************************************************/
bool Reference::init_ref() { bool Reference::init_ref() {
if (reference()) { if (reference()) {
if (!is_referenced() && refcount_init.unref()) { if (!is_referenced() && refcount_init.unref()) {

View File

@ -1,9 +1,10 @@
#ifndef REFERENCE_H #ifndef REFERENCE_H
#define REFERENCE_H #define REFERENCE_H
// Most of the code is from the godot engine's reference.h /*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ /* reference.h */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ /* From https://github.com/Relintai/pandemonium_engine (MIT) */
/*************************************************************************/
#include "memory.h" #include "memory.h"
#include "object.h" #include "object.h"
@ -13,7 +14,7 @@ class Reference : public Object {
SFW_OBJECT(Reference, Object); SFW_OBJECT(Reference, Object);
public: public:
/*_FORCE_INLINE_*/ bool is_referenced() const { return refcount_init.get() != 1; } _FORCE_INLINE_ bool is_referenced() const { return refcount_init.get() != 1; }
bool init_ref(); bool init_ref();
bool reference(); // returns false if refcount is at zero and didn't get increased bool reference(); // returns false if refcount is at zero and didn't get increased
bool unreference(); bool unreference();