#include "rect.h"
#include "vertex3d.h"
#include "video-driver.h"
-#include "wchar.h"
#include "wrapped.h"
using namespace irr;
IVideoDriver_getName (SCM video_driver)
{
video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
- return scm_from_wide_char_string (driver->getName ());
+ return scm_from_utf32_string ((scm_t_wchar*) driver->getName ());
}
SCM
IVideoDriver_getTexture (SCM video_driver,
SCM filename)
{
+ char* cfilename = scm_to_utf8_string (filename);
video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
- video::ITexture* texture = driver->getTexture (scm_to_utf8_string (filename));
+ video::ITexture* texture = driver->getTexture (cfilename);
+ free (cfilename);
return scm_from_pointer ((void*) texture, NULL);
}
video::E_TRANSFORMATION_STATE
scm_to_transformation_state (SCM transformation_state)
{
- char* state = scm_to_utf8_string (scm_symbol_to_string (transformation_state));
- if (!strcmp (state, "view"))
+ char* state_name = scm_to_utf8_string (scm_symbol_to_string (transformation_state));
+ video::E_TRANSFORMATION_STATE state;
+
+ if (!strcmp (state_name, "view"))
{
- return video::ETS_VIEW;
+ state = video::ETS_VIEW;
}
- else if (!strcmp (state, "world"))
+ else if (!strcmp (state_name, "world"))
{
- return video::ETS_WORLD;
+ state = video::ETS_WORLD;
}
- else if (!strcmp (state, "projection"))
+ else if (!strcmp (state_name, "projection"))
{
- return video::ETS_PROJECTION;
+ state = video::ETS_PROJECTION;
}
- else if (!strcmp (state, "texture0"))
+ else if (!strcmp (state_name, "texture0"))
{
- return video::ETS_TEXTURE_0;
+ state = video::ETS_TEXTURE_0;
}
- else if (!strcmp (state, "texture1"))
+ else if (!strcmp (state_name, "texture1"))
{
- return video::ETS_TEXTURE_1;
+ state = video::ETS_TEXTURE_1;
}
- else if (!strcmp (state, "texture2"))
+ else if (!strcmp (state_name, "texture2"))
{
- return video::ETS_TEXTURE_2;
+ state = video::ETS_TEXTURE_2;
}
- else if (!strcmp (state, "texture3"))
+ else if (!strcmp (state_name, "texture3"))
{
- return video::ETS_TEXTURE_3;
+ state = video::ETS_TEXTURE_3;
}
else
{
scm_error (scm_arg_type_key, NULL, "Wrong transformation state: ~S",
scm_list_1 (transformation_state), scm_list_1 (transformation_state));
}
+
+ free (state_name);
+ return state;
}