]> git.jsancho.org Git - c-irrlicht.git/blobdiff - src/IGUIEnvironment.cpp
Scene node animator
[c-irrlicht.git] / src / IGUIEnvironment.cpp
index a77c678feb6b7bbd38c1c5e9b48820a08a1a6098..f64f5a8abca65e859da4aafd768a9f587bbaa499 100644 (file)
 #include "IGUIEnvironment.h"
 
 extern "C" {
-  void* irr_gui_IGUIEnvironment_addStaticText(void* guienv,
-                                              const char* text,
-                                              const irr_core_rect_s32* rectangle,
-                                              bool border,
-                                              bool wordWrap,
-                                              void* parent,
-                                              int32_t id,
-                                              bool fillBackground)
+  irr_gui_IGUIStaticText*
+  irr_gui_addStaticText(irr_gui_IGUIEnvironment* guienv,
+                        const char* text,
+                        const irr_core_rect_s32* rectangle,
+                        bool border,
+                        bool wordWrap,
+                        irr_gui_IGUIElement* parent,
+                        int32_t id,
+                        bool 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);
+    mbstowcs(wtext, text, strlen(text) + 1);
 
     // Make rectangle
-    irr::core::rect<irr::s32> rect =            \
+    irr::core::rect<irr::s32> rect =
       irr::core::rect<irr::s32>(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(void* guienv)
+  void
+  irr_gui_drawAll(irr_gui_IGUIEnvironment* guienv)
   {
     ((irr::gui::IGUIEnvironment*)guienv)->drawAll();
   }