From 4ba4abfda573f3bf53b3ee54f59282788ae1438b Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 5 Dec 2019 13:42:04 +0100 Subject: [PATCH] IReferenceCounted --- Makefile.am | 2 ++ include/IReferenceCounted.h | 40 +++++++++++++++++++++++++++++++++++++ include/IrrlichtDevice.h | 3 --- include/cirrlicht.h | 1 + src/IReferenceCounted.cpp | 31 ++++++++++++++++++++++++++++ src/IrrlichtDevice.cpp | 6 ------ 6 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 include/IReferenceCounted.h create mode 100644 src/IReferenceCounted.cpp diff --git a/Makefile.am b/Makefile.am index 641b6d1..f0f2546 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ libCIrrlicht_la_SOURCES = \ src/ICursorControl.cpp \ src/IFileSystem.cpp \ src/IGUIEnvironment.cpp \ + src/IReferenceCounted.cpp \ src/IrrlichtDevice.cpp \ src/ISceneManager.cpp \ src/ISceneNode.cpp \ @@ -31,6 +32,7 @@ pkginclude_HEADERS = \ include/IGUIEnvironment.h \ include/IGUIStaticText.h \ include/IMeshSceneNode.h \ + include/IReferenceCounted.h \ include/IrrlichtDevice.h \ include/irrTypes.h \ include/ISceneManager.h \ diff --git a/include/IReferenceCounted.h b/include/IReferenceCounted.h new file mode 100644 index 0000000..25e6944 --- /dev/null +++ b/include/IReferenceCounted.h @@ -0,0 +1,40 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-irrlicht is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + c-irrlicht is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with guile-irrlicht. If not, see + . +*/ + +#ifndef __C_I_IREFERENCE_COUNTED_H_INCLUDED__ +#define __C_I_IREFERENCE_COUNTED_H_INCLUDED__ + +#include + +typedef void irr_IReferenceCounted; + +#ifdef __cplusplus +extern "C" { +#endif + + bool + irr_drop(irr_IReferenceCounted* object); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index b328be2..fcd0b45 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -61,9 +61,6 @@ extern "C" { bool irr_run(irr_IrrlichtDevice* device); - bool - irr_drop(irr_IrrlichtDevice* device); - void irr_yield(irr_IrrlichtDevice* device); diff --git a/include/cirrlicht.h b/include/cirrlicht.h index 828a892..f8b8e4f 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -40,6 +40,7 @@ #include "IGUIElement.h" #include "IGUIStaticText.h" #include "IMeshSceneNode.h" +#include "IReferenceCounted.h" #include "IrrlichtDevice.h" #include "irrTypes.h" #include "ISceneManager.h" diff --git a/src/IReferenceCounted.cpp b/src/IReferenceCounted.cpp new file mode 100644 index 0000000..2e5dc2b --- /dev/null +++ b/src/IReferenceCounted.cpp @@ -0,0 +1,31 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-irrlicht is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + c-irrlicht is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with guile-irrlicht. If not, see + . +*/ + +#include +#include "IReferenceCounted.h" + +extern "C" { + bool + irr_drop(irr_IReferenceCounted* object) + { + return ((irr::IReferenceCounted*)object)->drop(); + } +} diff --git a/src/IrrlichtDevice.cpp b/src/IrrlichtDevice.cpp index 32feec3..512b9da 100644 --- a/src/IrrlichtDevice.cpp +++ b/src/IrrlichtDevice.cpp @@ -75,12 +75,6 @@ extern "C" { return ((irr::IrrlichtDevice*)device)->run(); } - bool - irr_drop(irr_IrrlichtDevice* device) - { - return ((irr::IrrlichtDevice*)device)->drop(); - } - void irr_yield(irr_IrrlichtDevice* device) { -- 2.39.5