]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/gui-environment.cpp
fixing bugs
[guile-irrlicht.git] / src / gui-environment.cpp
index 5af49682d673585a1865eb8d88c561d41872d7a9..420b6a67129eb743fc10a9563f1c84bd12b63f66 100644 (file)
@@ -81,15 +81,15 @@ gui_IGUIEnvironment_addImage (SCM gui_environment,
                               SCM id,
                               SCM text)
 {
-  gui::IGUIImage* image =
-    ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
-    addImage ((video::ITexture*)scm_to_pointer (image),
-              scm_to_position2d_s32 (position),
-              scm_to_bool (use_alpha_channel),
-              (TParent)scm_to_pointer (parent),
-              scm_to_int32 (id),
-              scm_to_wide_char_string (text));
-  return scm_from_pointer ((void*)image, NULL);
+  gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_pointer (gui_environment);
+  gui::IGUIImage* new_image =
+    guienv->addImage ((video::ITexture*)scm_to_pointer (image),
+                      scm_to_position2d_s32 (position),
+                      scm_to_bool (use_alpha_channel),
+                      (TParent)scm_to_pointer (parent),
+                      scm_to_int32 (id),
+                      scm_to_wide_char_string (text));
+  return scm_from_pointer ((void*) new_image, NULL);
 }