Should't
#pragma comment(lib, "Irrlicht.lib")
and
#pragma comment (lib, "irrKlang.lib")
be enclosed in #ifdef _MSC_VER instead of #ifdef _IRR_WINDOWS_ ?
In sound.cpp of example 21:
virtual const ik_c8* getFileName() { return file->getFileName().c_str(); }
instead of
virtual const ik_c8* getFileName() { return file->getFileName(); }
about swprintf:
i had problems with this when i compiled with gcc-TDM.
I could solve them by swapping the sequence of some headers
( meaning driverChoice.h on top of irrlicht.h ):
#include "driverChoice.h" // solves problem with TDM.
#include <irrlicht.h>
With other compilers ( e.g. from the mingw-w64 project ) i had no problems.
This is something i hate about C++.
In latest trunk there is swprintf_irr, which is the best solution right now.
[fixed]small things
Re: small things
Thanks, I've changed it all.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [fixed]small things
again about s[n,w]printf:
- swprintf was added in C95 while snprintf was added in C99.
- the return values behave differently; with snprintf you can check against the buffer size and "reallocate" if necessary, with swprintf you get '-1' if SOMETHING went wrong, but you don't know what.
I always wondered, why there is no swnprintf or snwprintf, but there IS a snwprintf!
I have tried it with gcc 4.8.x. I am not sure about other compilers (Visual Studio > 2010 should have it), but don't let yourself be confused by this post - leave it as it is know (it works). If there should be any problems in the future, you can still change it if necessary.
I will have a look into other solutions from other libraries.
- swprintf was added in C95 while snprintf was added in C99.
- the return values behave differently; with snprintf you can check against the buffer size and "reallocate" if necessary, with swprintf you get '-1' if SOMETHING went wrong, but you don't know what.
I always wondered, why there is no swnprintf or snwprintf, but there IS a snwprintf!
I have tried it with gcc 4.8.x. I am not sure about other compilers (Visual Studio > 2010 should have it), but don't let yourself be confused by this post - leave it as it is know (it works). If there should be any problems in the future, you can still change it if necessary.
I will have a look into other solutions from other libraries.
Re: [fixed]small things
Also note that all those don't work on Android. Something I run into last year. I probably should go through the source again at some point and check for all those places if any of them matter on that platform and find other solutions there.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [fixed]small things
They don't even work on Windows, which is the reason for the char-wchar converter functions.