From: Javier Sancho Date: Mon, 14 Oct 2019 18:03:10 +0000 (+0200) Subject: Rename functions and fix some little bugs X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=bf35c1c5384d6ccae7b7690ee08c511d036ffaec;p=c-irrlicht.git Rename functions and fix some little bugs --- diff --git a/Makefile.am b/Makefile.am index bcec8c1..b2da572 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,7 @@ pkginclude_HEADERS = \ include/dimension2d.h \ include/EDriverTypes.h \ include/EMaterialFlags.h \ + include/IAnimatedMesh.h \ include/IAnimatedMeshMD2.h \ include/IAnimatedMeshSceneNode.h \ include/ICameraSceneNode.h \ diff --git a/examples/01.HelloWorld.c b/examples/01.HelloWorld.c index 6027d54..d630dfc 100644 --- a/examples/01.HelloWorld.c +++ b/examples/01.HelloWorld.c @@ -36,55 +36,53 @@ int main() } // set window caption - irr_IrrlichtDevice_setWindowCaption(device, "Hello World! - Irrlicht Engine Demo"); + irr_setWindowCaption(device, "Hello World! - Irrlicht Engine Demo"); // instances for doing things - irr_video_IVideoDriver* driver = irr_IrrlichtDevice_getVideoDriver(device); - irr_scene_ISceneManager* smgr = irr_IrrlichtDevice_getSceneManager(device); - irr_gui_IGUIEnvironment* guienv = irr_IrrlichtDevice_getGUIEnvironment(device); + irr_video_IVideoDriver* driver = irr_getVideoDriver(device); + irr_scene_ISceneManager* smgr = irr_getSceneManager(device); + irr_gui_IGUIEnvironment* guienv = irr_getGUIEnvironment(device); // add a static text irr_core_rect_s32 box = {10, 10, 260, 22}; - irr_gui_IGUIEnvironment_addStaticText(guienv, - "Hello World! This is the Irrlicht Software renderer!", - &box, 1, 1, NULL, -1, 0); + irr_gui_addStaticText(guienv, + "Hello World! This is the Irrlicht Software renderer!", + &box, 1, 1, NULL, -1, 0); // load a quake2 mesh - irr_scene_IAnimatedMesh* mesh = irr_scene_ISceneManager_getMesh(smgr, "media/sydney.md2"); + irr_scene_IAnimatedMesh* mesh = irr_scene_getMesh(smgr, "media/sydney.md2"); if (!mesh) { - irr_IrrlichtDevice_drop(device); + irr_drop(device); return 1; } irr_scene_IAnimatedMeshSceneNode* node = - irr_scene_ISceneManager_addAnimatedMeshSceneNode(smgr, mesh, NULL, -1, - NULL, NULL, NULL, 0); + irr_scene_addAnimatedMeshSceneNode(smgr, mesh, NULL, -1, + NULL, NULL, NULL, 0); if (node) { - irr_scene_IAnimatedMeshSceneNode_setMaterialFlag(node, irr_video_EMF_LIGHTING, 0); - irr_scene_IAnimatedMeshSceneNode_setMD2Animation(node, irr_scene_EMAT_STAND); - irr_video_ITexture* texture = irr_video_IVideoDriver_getTexture(driver, - "media/sydney.bmp"); - irr_scene_IAnimatedMeshSceneNode_setMaterialTexture(node, 0, texture); + irr_scene_setMaterialFlagAM(node, irr_video_EMF_LIGHTING, 0); + irr_scene_setMD2Animation(node, irr_scene_EMAT_STAND); + irr_video_ITexture* texture = irr_video_getTexture(driver, "media/sydney.bmp"); + irr_scene_setMaterialTextureAM(node, 0, texture); } // camera irr_core_vector3df position = {0, 30, -40}; irr_core_vector3df lookat = {0, 5, 0}; - irr_scene_ISceneManager_addCameraSceneNode(smgr, NULL, &position, &lookat, - -1, 1); + irr_scene_addCameraSceneNode(smgr, NULL, &position, &lookat, -1, 1); // loop irr_video_SColor bgcolor = {255, 100, 101, 140}; - while (irr_IrrlichtDevice_run(device)) + while (irr_run(device)) { - irr_video_IVideoDriver_beginScene(driver, 1, 1, &bgcolor, NULL, NULL); - irr_gui_IGUIEnvironment_drawAll(guienv); - irr_scene_ISceneManager_drawAll(smgr); - irr_video_IVideoDriver_endScene(driver); + irr_video_beginScene(driver, 1, 1, &bgcolor, NULL, NULL); + irr_gui_drawAll(guienv); + irr_scene_drawAll(smgr); + irr_video_endScene(driver); } - irr_IrrlichtDevice_drop(device); + irr_drop(device); return 0; } diff --git a/include/IAnimatedMesh.h b/include/IAnimatedMesh.h new file mode 100644 index 0000000..90c4c0c --- /dev/null +++ b/include/IAnimatedMesh.h @@ -0,0 +1,27 @@ +/* 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_ANIMATED_MESH_H_INCLUDED__ +#define __C_I_ANIMATED_MESH_H_INCLUDED__ + +typedef void irr_scene_IAnimatedMesh; + +#endif diff --git a/include/IAnimatedMeshSceneNode.h b/include/IAnimatedMeshSceneNode.h index 27f2f5d..7626ad5 100644 --- a/include/IAnimatedMeshSceneNode.h +++ b/include/IAnimatedMeshSceneNode.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_SCENE_NODE_H_INCLUDED__ -#define __C_SCENE_NODE_H_INCLUDED__ +#ifndef __C_I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ +#define __C_I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ #include "EMaterialFlags.h" #include "IAnimatedMeshMD2.h" @@ -33,18 +33,18 @@ extern "C" { #endif void - irr_scene_IAnimatedMeshSceneNode_setMaterialFlag(irr_scene_IAnimatedMeshSceneNode* node, - irr_video_E_MATERIAL_FLAG flag, - int newvalue); + irr_scene_setMaterialFlagAM(irr_scene_IAnimatedMeshSceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + int newvalue); void - irr_scene_IAnimatedMeshSceneNode_setMaterialTexture(irr_scene_IAnimatedMeshSceneNode* node, - unsigned int textureLayer, - irr_video_ITexture* texture); + irr_scene_setMaterialTextureAM(irr_scene_IAnimatedMeshSceneNode* node, + unsigned int textureLayer, + irr_video_ITexture* texture); int - irr_scene_IAnimatedMeshSceneNode_setMD2Animation(irr_scene_IAnimatedMeshSceneNode* node, - irr_scene_EMD2_ANIMATION_TYPE anim); + irr_scene_setMD2Animation(irr_scene_IAnimatedMeshSceneNode* node, + irr_scene_EMD2_ANIMATION_TYPE anim); #ifdef __cplusplus } diff --git a/include/IGUIEnvironment.h b/include/IGUIEnvironment.h index 8cb15b3..e97f3d3 100644 --- a/include/IGUIEnvironment.h +++ b/include/IGUIEnvironment.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_GUI_ENVIRONMENT_H_INCLUDED__ -#define __C_GUI_ENVIRONMENT_H_INCLUDED__ +#ifndef __C_I_GUI_ENVIRONMENT_H_INCLUDED__ +#define __C_I_GUI_ENVIRONMENT_H_INCLUDED__ #include "IGUIElement.h" #include "IGUIStaticText.h" @@ -33,17 +33,17 @@ extern "C" { #endif irr_gui_IGUIStaticText* - irr_gui_IGUIEnvironment_addStaticText(irr_gui_IGUIEnvironment* guienv, - const char* text, - const irr_core_rect_s32* rectangle, - int border, - int wordWrap, - irr_gui_IGUIElement* parent, - int id, - int fillBackground); + irr_gui_addStaticText(irr_gui_IGUIEnvironment* guienv, + const char* text, + const irr_core_rect_s32* rectangle, + int border, + int wordWrap, + irr_gui_IGUIElement* parent, + int id, + int fillBackground); void - irr_gui_IGUIEnvironment_drawAll(irr_gui_IGUIEnvironment* guienv); + irr_gui_drawAll(irr_gui_IGUIEnvironment* guienv); #ifdef __cplusplus } diff --git a/include/ISceneManager.h b/include/ISceneManager.h index 0be8e3c..509836b 100644 --- a/include/ISceneManager.h +++ b/include/ISceneManager.h @@ -19,45 +19,45 @@ . */ -#ifndef __C_SCENE_MANAGER_H_INCLUDED__ -#define __C_SCENE_MANAGER_H_INCLUDED__ +#ifndef __C_I_SCENE_MANAGER_H_INCLUDED__ +#define __C_I_SCENE_MANAGER_H_INCLUDED__ +#include "IAnimatedMesh.h" #include "IAnimatedMeshSceneNode.h" #include "ICameraSceneNode.h" +#include "ISceneNode.h" #include "vector3d.h" -typedef void irr_scene_IAnimatedMesh; typedef void irr_scene_ISceneManager; -typedef void irr_scene_ISceneNode; #ifdef __cplusplus extern "C" { #endif irr_scene_IAnimatedMeshSceneNode* - irr_scene_ISceneManager_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr, - irr_scene_IAnimatedMesh* mesh, - irr_scene_ISceneNode* parent, - int id, - irr_core_vector3df* position, - irr_core_vector3df* rotation, - irr_core_vector3df* scale, - int alsoAddIfMeshPointerZero); + irr_scene_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr, + irr_scene_IAnimatedMesh* mesh, + irr_scene_ISceneNode* parent, + int id, + irr_core_vector3df* position, + irr_core_vector3df* rotation, + irr_core_vector3df* scale, + int alsoAddIfMeshPointerZero); irr_scene_ICameraSceneNode* - irr_scene_ISceneManager_addCameraSceneNode(irr_scene_ISceneManager* smgr, - irr_scene_ISceneNode* parent, - irr_core_vector3df* position, - irr_core_vector3df* lookat, - int id, - int makeActive); + irr_scene_addCameraSceneNode(irr_scene_ISceneManager* smgr, + irr_scene_ISceneNode* parent, + irr_core_vector3df* position, + irr_core_vector3df* lookat, + int id, + int makeActive); void - irr_scene_ISceneManager_drawAll(irr_scene_ISceneManager* smgr); + irr_scene_drawAll(irr_scene_ISceneManager* smgr); irr_scene_IAnimatedMesh* - irr_scene_ISceneManager_getMesh(irr_scene_ISceneManager* smgr, - const char* filename); + irr_scene_getMesh(irr_scene_ISceneManager* smgr, + const char* filename); #ifdef __cplusplus } diff --git a/include/ISceneNode.h b/include/ISceneNode.h index 334c4e2..107b788 100644 --- a/include/ISceneNode.h +++ b/include/ISceneNode.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_SCENE_NODE_H_INCLUDED__ -#define __C_SCENE_NODE_H_INCLUDED__ +#ifndef __C_I_SCENE_NODE_H_INCLUDED__ +#define __C_I_SCENE_NODE_H_INCLUDED__ #include "EMaterialFlags.h" #include "ITexture.h" @@ -32,14 +32,14 @@ extern "C" { #endif void - irr_scene_ISceneNode_setMaterialFlag(irr_scene_ISceneNode* node, - irr_video_E_MATERIAL_FLAG flag, - bool newvalue); + irr_scene_setMaterialFlag(irr_scene_ISceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + int newvalue); void - irr_scene_ISceneNode_setMaterialTexture(irr_scene_ISceneNode* node, - u_int32_t textureLayer, - irr_video_ITexture* texture); + irr_scene_setMaterialTexture(irr_scene_ISceneNode* node, + unsigned int textureLayer, + irr_video_ITexture* texture); #ifdef __cplusplus } diff --git a/include/ITexture.h b/include/ITexture.h index 50c2c76..fdd279a 100644 --- a/include/ITexture.h +++ b/include/ITexture.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_TEXTURE_H_INCLUDED__ -#define __C_TEXTURE_H_INCLUDED__ +#ifndef __C_I_TEXTURE_H_INCLUDED__ +#define __C_I_TEXTURE_H_INCLUDED__ typedef void irr_video_ITexture; diff --git a/include/IVideoDriver.h b/include/IVideoDriver.h index 98a837e..b37cde8 100644 --- a/include/IVideoDriver.h +++ b/include/IVideoDriver.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_IRR_I_VIDEO_DRIVER_H_INCLUDED__ -#define __C_IRR_I_VIDEO_DRIVER_H_INCLUDED__ +#ifndef __C_I_VIDEO_DRIVER_H_INCLUDED__ +#define __C_I_VIDEO_DRIVER_H_INCLUDED__ #include "ITexture.h" #include "SColor.h" @@ -34,19 +34,19 @@ extern "C" { #endif int - irr_video_IVideoDriver_beginScene(irr_video_IVideoDriver* driver, - int backBuffer, - int zBuffer, - const irr_video_SColor* color, - irr_video_SExposedVideoData* videoData, - const irr_core_rect_s32* sourceRect); + irr_video_beginScene(irr_video_IVideoDriver* driver, + int backBuffer, + int zBuffer, + const irr_video_SColor* color, + irr_video_SExposedVideoData* videoData, + const irr_core_rect_s32* sourceRect); int - irr_video_IVideoDriver_endScene(irr_video_IVideoDriver* driver); + irr_video_endScene(irr_video_IVideoDriver* driver); irr_video_ITexture* - irr_video_IVideoDriver_getTexture(irr_video_IVideoDriver* driver, - const char* filename); + irr_video_getTexture(irr_video_IVideoDriver* driver, + const char* filename); #ifdef __cplusplus } diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index 9ca9589..df717e7 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -33,23 +33,23 @@ extern "C" { #endif irr_gui_IGUIEnvironment* - irr_IrrlichtDevice_getGUIEnvironment(irr_IrrlichtDevice* device); + irr_getGUIEnvironment(irr_IrrlichtDevice* device); irr_scene_ISceneManager* - irr_IrrlichtDevice_getSceneManager(irr_IrrlichtDevice* device); + irr_getSceneManager(irr_IrrlichtDevice* device); irr_video_IVideoDriver* - irr_IrrlichtDevice_getVideoDriver(irr_IrrlichtDevice* device); + irr_getVideoDriver(irr_IrrlichtDevice* device); void - irr_IrrlichtDevice_setWindowCaption(irr_IrrlichtDevice* device, + irr_setWindowCaption(irr_IrrlichtDevice* device, const char* text); int - irr_IrrlichtDevice_run(irr_IrrlichtDevice* device); + irr_run(irr_IrrlichtDevice* device); int - irr_IrrlichtDevice_drop(irr_IrrlichtDevice* device); + irr_drop(irr_IrrlichtDevice* device); #ifdef __cplusplus } diff --git a/include/SColor.h b/include/SColor.h index 4409a74..0c6e809 100644 --- a/include/SColor.h +++ b/include/SColor.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_COLOR_H_INCLUDED__ -#define __C_COLOR_H_INCLUDED__ +#ifndef __C_IRR_COLOR_H_INCLUDED__ +#define __C_IRR_COLOR_H_INCLUDED__ typedef struct { diff --git a/include/vector3d.h b/include/vector3d.h index 36de9a9..fd94026 100644 --- a/include/vector3d.h +++ b/include/vector3d.h @@ -19,8 +19,8 @@ . */ -#ifndef __C_IRR_POINT_3D_H_INCLUDED__ -#define __C_IRR_POINT_3D_H_INCLUDED__ +#ifndef __C_IRR_VECTOR_3D_H_INCLUDED__ +#define __C_IRR_VECTOR_3D_H_INCLUDED__ typedef struct { diff --git a/src/CIrrlicht.cpp b/src/CIrrlicht.cpp index f04f999..c17daa2 100644 --- a/src/CIrrlicht.cpp +++ b/src/CIrrlicht.cpp @@ -31,10 +31,10 @@ extern "C" { int stencilbuffer, int vsync) { - irr::core::dimension2d wsize = \ + irr::core::dimension2d wsize = irr::core::dimension2d(windowSize->width, windowSize->height); - irr::IrrlichtDevice *device = \ + irr::IrrlichtDevice *device = irr::createDevice((irr::video::E_DRIVER_TYPE)deviceType, wsize, bits, fullscreen, stencilbuffer, vsync); diff --git a/src/IAnimatedMeshSceneNode.cpp b/src/IAnimatedMeshSceneNode.cpp index f7348fc..319046b 100644 --- a/src/IAnimatedMeshSceneNode.cpp +++ b/src/IAnimatedMeshSceneNode.cpp @@ -24,28 +24,31 @@ extern "C" { void - irr_scene_IAnimatedMeshSceneNode_setMaterialFlag(irr_scene_IAnimatedMeshSceneNode* node, - irr_video_E_MATERIAL_FLAG flag, - int newvalue) + irr_scene_setMaterialFlagAM(irr_scene_IAnimatedMeshSceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + int newvalue) { - ((irr::scene::IAnimatedMeshSceneNode*)node)->setMaterialFlag((irr::video::E_MATERIAL_FLAG)flag, - newvalue); + ((irr::scene::IAnimatedMeshSceneNode*)node) + ->setMaterialFlag((irr::video::E_MATERIAL_FLAG)flag, + newvalue); } void - irr_scene_IAnimatedMeshSceneNode_setMaterialTexture(irr_scene_IAnimatedMeshSceneNode* node, - unsigned int textureLayer, - irr_video_ITexture* texture) + irr_scene_setMaterialTextureAM(irr_scene_IAnimatedMeshSceneNode* node, + unsigned int textureLayer, + irr_video_ITexture* texture) { - ((irr::scene::IAnimatedMeshSceneNode*)node)->setMaterialTexture(textureLayer, - (irr::video::ITexture*)texture); + ((irr::scene::IAnimatedMeshSceneNode*)node) + ->setMaterialTexture(textureLayer, + (irr::video::ITexture*)texture); } int - irr_scene_IAnimatedMeshSceneNode_setMD2Animation(irr_scene_IAnimatedMeshSceneNode* node, - irr_scene_EMD2_ANIMATION_TYPE anim) + irr_scene_setMD2Animation(irr_scene_IAnimatedMeshSceneNode* node, + irr_scene_EMD2_ANIMATION_TYPE anim) { - return ((irr::scene::IAnimatedMeshSceneNode*)node)->setMD2Animation((irr::scene::EMD2_ANIMATION_TYPE)anim); + return ((irr::scene::IAnimatedMeshSceneNode*)node) + ->setMD2Animation((irr::scene::EMD2_ANIMATION_TYPE)anim); } } diff --git a/src/IGUIEnvironment.cpp b/src/IGUIEnvironment.cpp index 4a5d68b..927c0b9 100644 --- a/src/IGUIEnvironment.cpp +++ b/src/IGUIEnvironment.cpp @@ -25,40 +25,41 @@ extern "C" { irr_gui_IGUIStaticText* - irr_gui_IGUIEnvironment_addStaticText(irr_gui_IGUIEnvironment* guienv, - const char* text, - const irr_core_rect_s32* rectangle, - int border, - int wordWrap, - irr_gui_IGUIElement* parent, - int id, - int fillBackground) + irr_gui_addStaticText(irr_gui_IGUIEnvironment* guienv, + const char* text, + const irr_core_rect_s32* rectangle, + int border, + int wordWrap, + irr_gui_IGUIElement* parent, + int id, + int fillBackground) { // Convert to wide char text wchar_t *wtext = (wchar_t*)malloc((strlen(text) + 1) * sizeof(wchar_t)); mbsrtowcs(wtext, &text, strlen(text) + 1, NULL); // Make rectangle - irr::core::rect rect = \ + irr::core::rect rect = irr::core::rect(rectangle->x, rectangle->y, rectangle->x2, rectangle->y2); // Add static text - irr::gui::IGUIStaticText *staticText = \ - ((irr::gui::IGUIEnvironment*)guienv)->addStaticText(wtext, - rect, - border, - wordWrap, - (irr::gui::IGUIElement*)parent, - id, - fillBackground); + irr::gui::IGUIStaticText *staticText = + ((irr::gui::IGUIEnvironment*)guienv) + ->addStaticText(wtext, + rect, + border, + wordWrap, + (irr::gui::IGUIElement*)parent, + id, + fillBackground); return staticText; } void - irr_gui_IGUIEnvironment_drawAll(irr_gui_IGUIEnvironment* guienv) + irr_gui_drawAll(irr_gui_IGUIEnvironment* guienv) { ((irr::gui::IGUIEnvironment*)guienv)->drawAll(); } diff --git a/src/ISceneManager.cpp b/src/ISceneManager.cpp index e88bd00..bef569b 100644 --- a/src/ISceneManager.cpp +++ b/src/ISceneManager.cpp @@ -24,14 +24,14 @@ extern "C" { irr_scene_IAnimatedMeshSceneNode* - irr_scene_ISceneManager_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr, - irr_scene_IAnimatedMesh* mesh, - irr_scene_ISceneNode* parent, - int id, - irr_core_vector3df* position, - irr_core_vector3df* rotation, - irr_core_vector3df* scale, - int alsoAddIfMeshPointerZero) + irr_scene_addAnimatedMeshSceneNode(irr_scene_ISceneManager* smgr, + irr_scene_IAnimatedMesh* mesh, + irr_scene_ISceneNode* parent, + int id, + irr_core_vector3df* position, + irr_core_vector3df* rotation, + irr_core_vector3df* scale, + int alsoAddIfMeshPointerZero) { const irr::core::vector3df iPosition = position ? @@ -49,22 +49,23 @@ extern "C" { irr::core::vector3df(1, 1, 1); return (irr_scene_IAnimatedMeshSceneNode*) - ((irr::scene::ISceneManager*)smgr)->addAnimatedMeshSceneNode((irr::scene::IAnimatedMesh*)mesh, - (irr::scene::ISceneNode*)parent, - id, - iPosition, - iRotation, - iScale, - alsoAddIfMeshPointerZero); + ((irr::scene::ISceneManager*)smgr) + ->addAnimatedMeshSceneNode((irr::scene::IAnimatedMesh*)mesh, + (irr::scene::ISceneNode*)parent, + id, + iPosition, + iRotation, + iScale, + alsoAddIfMeshPointerZero); } irr_scene_ICameraSceneNode* - irr_scene_ISceneManager_addCameraSceneNode(irr_scene_ISceneManager* smgr, - irr_scene_ISceneNode* parent, - irr_core_vector3df* position, - irr_core_vector3df* lookat, - int id, - int makeActive) + irr_scene_addCameraSceneNode(irr_scene_ISceneManager* smgr, + irr_scene_ISceneNode* parent, + irr_core_vector3df* position, + irr_core_vector3df* lookat, + int id, + int makeActive) { const irr::core::vector3df& iPosition = position ? @@ -77,23 +78,24 @@ extern "C" { irr::core::vector3df(0, 0, 100); return (irr_scene_ICameraSceneNode*) - ((irr::scene::ISceneManager*)smgr)->addCameraSceneNode((irr::scene::ISceneNode*)parent, - iPosition, - iLookat, - id, - makeActive); + ((irr::scene::ISceneManager*)smgr) + ->addCameraSceneNode((irr::scene::ISceneNode*)parent, + iPosition, + iLookat, + id, + makeActive); } void - irr_scene_ISceneManager_drawAll(irr_scene_ISceneManager* smgr) + irr_scene_drawAll(irr_scene_ISceneManager* smgr) { ((irr::scene::ISceneManager*)smgr)->drawAll(); } irr_scene_IAnimatedMesh* - irr_scene_ISceneManager_getMesh(irr_scene_ISceneManager* smgr, - const char* filename) + irr_scene_getMesh(irr_scene_ISceneManager* smgr, + const char* filename) { return (irr_scene_IAnimatedMesh*) ((irr::scene::ISceneManager*)smgr)->getMesh(filename); diff --git a/src/ISceneNode.cpp b/src/ISceneNode.cpp index 635ba97..ea77119 100644 --- a/src/ISceneNode.cpp +++ b/src/ISceneNode.cpp @@ -24,20 +24,22 @@ extern "C" { void - irr_scene_ISceneNode_setMaterialFlag(irr_scene_ISceneNode* node, - irr_video_E_MATERIAL_FLAG flag, - bool newvalue) + irr_scene_setMaterialFlag(irr_scene_ISceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + int newvalue) { - ((irr::scene::ISceneNode*)node)->setMaterialFlag((irr::video::E_MATERIAL_FLAG)flag, - newvalue); + ((irr::scene::ISceneNode*)node) + ->setMaterialFlag((irr::video::E_MATERIAL_FLAG)flag, + newvalue); } void - irr_scene_ISceneNode_setMaterialTexture(irr_scene_ISceneNode* node, - u_int32_t textureLayer, - irr_video_ITexture* texture) + irr_scene_setMaterialTexture(irr_scene_ISceneNode* node, + unsigned int textureLayer, + irr_video_ITexture* texture) { - ((irr::scene::ISceneNode*)node)->setMaterialTexture(textureLayer, - (irr::video::ITexture*)texture); + ((irr::scene::ISceneNode*)node) + ->setMaterialTexture(textureLayer, + (irr::video::ITexture*)texture); } } diff --git a/src/IVideoDriver.cpp b/src/IVideoDriver.cpp index ea27d4c..7101961 100644 --- a/src/IVideoDriver.cpp +++ b/src/IVideoDriver.cpp @@ -24,12 +24,12 @@ extern "C" { int - irr_video_IVideoDriver_beginScene(irr_video_IVideoDriver* driver, - int backBuffer, - int zBuffer, - const irr_video_SColor* color, - irr_video_SExposedVideoData* videoData, - const irr_core_rect_s32* sourceRect) + irr_video_beginScene(irr_video_IVideoDriver* driver, + int backBuffer, + int zBuffer, + const irr_video_SColor* color, + irr_video_SExposedVideoData* videoData, + const irr_core_rect_s32* sourceRect) { // Color irr::video::SColor col = irr::video::SColor(color->a, color->r, @@ -50,22 +50,23 @@ extern "C" { } // Begin scene - return ((irr::video::IVideoDriver*)driver)->beginScene(backBuffer, - zBuffer, - col, - vdata, - sourceRect != NULL ? &rect : 0); + return ((irr::video::IVideoDriver*)driver) + ->beginScene(backBuffer, + zBuffer, + col, + vdata, + sourceRect != NULL ? &rect : 0); } int - irr_video_IVideoDriver_endScene(irr_video_IVideoDriver* driver) + irr_video_endScene(irr_video_IVideoDriver* driver) { return ((irr::video::IVideoDriver*)driver)->endScene(); } irr_video_ITexture* - irr_video_IVideoDriver_getTexture(irr_video_IVideoDriver* driver, - const char* filename) + irr_video_getTexture(irr_video_IVideoDriver* driver, + const char* filename) { return (irr_video_ITexture*) ((irr::video::IVideoDriver*)driver)->getTexture(filename); diff --git a/src/IrrlichtDevice.cpp b/src/IrrlichtDevice.cpp index 190800e..b877d25 100644 --- a/src/IrrlichtDevice.cpp +++ b/src/IrrlichtDevice.cpp @@ -25,26 +25,26 @@ extern "C" { irr_gui_IGUIEnvironment* - irr_IrrlichtDevice_getGUIEnvironment(irr_IrrlichtDevice* device) + irr_getGUIEnvironment(irr_IrrlichtDevice* device) { return ((irr::IrrlichtDevice*)device)->getGUIEnvironment(); } irr_scene_ISceneManager* - irr_IrrlichtDevice_getSceneManager(irr_IrrlichtDevice* device) + irr_getSceneManager(irr_IrrlichtDevice* device) { return ((irr::IrrlichtDevice*)device)->getSceneManager(); } irr_video_IVideoDriver* - irr_IrrlichtDevice_getVideoDriver(irr_IrrlichtDevice* device) + irr_getVideoDriver(irr_IrrlichtDevice* device) { return ((irr::IrrlichtDevice*)device)->getVideoDriver(); } void - irr_IrrlichtDevice_setWindowCaption(irr_IrrlichtDevice* device, - const char* text) + irr_setWindowCaption(irr_IrrlichtDevice* device, + const char* text) { wchar_t *wtext = (wchar_t*)malloc((strlen(text) + 1) * sizeof(wchar_t)); mbsrtowcs(wtext, &text, strlen(text) + 1, NULL); @@ -52,13 +52,13 @@ extern "C" { } int - irr_IrrlichtDevice_run(irr_IrrlichtDevice* device) + irr_run(irr_IrrlichtDevice* device) { return ((irr::IrrlichtDevice*)device)->run() ? 1 : 0; } int - irr_IrrlichtDevice_drop(irr_IrrlichtDevice* device) + irr_drop(irr_IrrlichtDevice* device) { return ((irr::IrrlichtDevice*)device)->drop() ? 1 : 0; }