From fc3be36ca8e29c32e1758ae99c9982aa287d8920 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 14 May 2020 09:16:57 +0200 Subject: [PATCH] avoid problems with complex inheritance tree and getters --- irrlicht/base.scm | 7 ++++++- irrlicht/device.scm | 2 +- irrlicht/gui.scm | 6 +++--- irrlicht/io.scm | 6 +++--- irrlicht/irr.scm | 4 ++-- irrlicht/scene.scm | 12 ++++++------ irrlicht/video.scm | 4 ++-- 7 files changed, 23 insertions(+), 18 deletions(-) diff --git a/irrlicht/base.scm b/irrlicht/base.scm index dba889b..db1de76 100644 --- a/irrlicht/base.scm +++ b/irrlicht/base.scm @@ -27,8 +27,13 @@ is-empty?)) (define-class () - (irr-class #:init-value "" #:getter irr-class) + (irr-class #:init-value "") (irr-pointer #:init-value %null-pointer #:getter irr-pointer #:init-keyword #:irr-pointer)) +;; irr-class getter is defined in this way to avoid problems with multiple getters +;; in multiple inherited classes +(define-method (irr-class (obj )) + (slot-ref obj 'irr-class)) + (define-method (is-empty? (obj )) (equal? (irr-pointer obj) %null-pointer)) diff --git a/irrlicht/device.scm b/irrlicht/device.scm index 6e9dfcc..ef1b776 100644 --- a/irrlicht/device.scm +++ b/irrlicht/device.scm @@ -31,7 +31,7 @@ ;; IrrlichtDevice (define-class () - (irr-class #:init-value "IrrlichtDevice" #:getter irr-class)) + (irr-class #:init-value "IrrlichtDevice")) (define* (create-device #:key (device-type 'software) diff --git a/irrlicht/gui.scm b/irrlicht/gui.scm index 3d0e091..818d062 100644 --- a/irrlicht/gui.scm +++ b/irrlicht/gui.scm @@ -29,14 +29,14 @@ ;; IGUIElement (define-class ( ) - (irr-class #:init-value "IGUIElement" #:getter irr-class)) + (irr-class #:init-value "IGUIElement")) (export ) ;; IGUIEnvironment (define-class () - (irr-class #:init-value "IGUIEnvironment" #:getter irr-class)) + (irr-class #:init-value "IGUIEnvironment")) (define-method (add-static-text! (gui-environment ) text rectangle . rest) (let-keywords rest #f @@ -66,6 +66,6 @@ ;; IGUIStaticText (define-class () - (irr-class #:init-value "IGUIStaticText" #:getter irr-class)) + (irr-class #:init-value "IGUIStaticText")) (export ) diff --git a/irrlicht/io.scm b/irrlicht/io.scm index 1e94c5d..0276982 100644 --- a/irrlicht/io.scm +++ b/irrlicht/io.scm @@ -27,21 +27,21 @@ ;; IAttributeExchangingObject (define-class () - (irr-class #:init-value "IAttributeExchangingObject" #:getter irr-class)) + (irr-class #:init-value "IAttributeExchangingObject")) (export ) ;;IFileArchive (define-class () - (irr-class #:init-value "IFileArchive" #:getter irr-class)) + (irr-class #:init-value "IFileArchive")) (export ) ;;IFileSystem (define-class () - (irr-class #:init-value "IFileSystem" #:getter irr-class)) + (irr-class #:init-value "IFileSystem")) (define-method (add-file-archive! (file-system ) filename . rest) (let-keywords rest #f diff --git a/irrlicht/irr.scm b/irrlicht/irr.scm index 19af56f..b1ffdcc 100644 --- a/irrlicht/irr.scm +++ b/irrlicht/irr.scm @@ -26,7 +26,7 @@ ;; IReferenceCounted (define-class () - (irr-class #:init-value "IReferenceCounted" #:getter irr-class)) + (irr-class #:init-value "IReferenceCounted")) (define-method (drop! (obj )) (let ((drop (get-irrlicht-proc "drop" obj))) @@ -37,6 +37,6 @@ ;; IEventReceiver (define-class () - (irr-class #:init-value "IEventReceiver" #:getter irr-class)) + (irr-class #:init-value "IEventReceiver")) (export ) diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index a59e0fa..d268dea 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -30,21 +30,21 @@ ;; IMesh (define-class () - (irr-class #:init-value "IMesh" #:getter irr-class)) + (irr-class #:init-value "IMesh")) (export ) ;; IAnimatedMesh (define-class () - (irr-class #:init-value "IAnimatedMesh" #:getter irr-class)) + (irr-class #:init-value "IAnimatedMesh")) (export ) ;; ISceneManager (define-class () - (irr-class #:init-value "ISceneManager" #:getter irr-class)) + (irr-class #:init-value "ISceneManager")) (define-method (add-animated-mesh-scene-node! (scene-manager ) (mesh ) @@ -101,7 +101,7 @@ ;; ISceneNode (define-class () - (irr-class #:init-value "ISceneNode" #:getter irr-class)) + (irr-class #:init-value "ISceneNode")) (define-method (set-material-flag! (node ) flag new-value) ((get-irrlicht-proc "setMaterialFlag" node) @@ -120,7 +120,7 @@ ;; IAnimatedMeshSceneNode (define-class () - (irr-class #:init-value "IAnimatedMeshSceneNode" #:getter irr-class)) + (irr-class #:init-value "IAnimatedMeshSceneNode")) (define-method (set-md2-animation! (node ) anim) ((get-irrlicht-proc "setMD2Animation" node) @@ -132,6 +132,6 @@ ;; ICameraSceneNode (define-class () - (irr-class #:init-value "ICameraSceneNode" #:getter irr-class)) + (irr-class #:init-value "ICameraSceneNode")) (export ) diff --git a/irrlicht/video.scm b/irrlicht/video.scm index 5659276..7dd433d 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -27,14 +27,14 @@ ;; ITexture (define-class () - (irr-class #:init-value "ITexture" #:getter irr-class)) + (irr-class #:init-value "ITexture")) (export ) ;; IVideoDriver (define-class () - (irr-class #:init-value "IVideoDriver" #:getter irr-class)) + (irr-class #:init-value "IVideoDriver")) (define-method (begin-scene (video-driver ) . rest) (let-keywords rest #f -- 2.39.5