Is this a legit "compile-out" ? [niko cleared it o

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Is this a legit "compile-out" ? [niko cleared it o

Post by MasterGod »

I'm using irrKlang in my project and I want to add a compile define like irrlicht's. Read this and I'll continue explaining:

Code: Select all

// Copyright (c) 2007-2008 Tomer Nosrati
// This file is part of the "NUSoftware Game Engine".
// For conditions of distribution and use, see copyright notice in nge.h

#include "ISoundManager.h"
#include "devices/CIrrKlangManager.h"

ISoundManager* createSoundManager(E_AUDIO_DEVICE AudioDevice)
{
	switch(AudioDevice)
	{
	case EAD_IRRKLANG: 
#		ifdef _NGE_COMPILE_WITH_IRRKLANG_
			return new CIrrKlangManager();
#		else
			return 0;
#		endif

	case EAD_FMOD:
#		ifdef _NGE_COMPILE_WITH_FMOD_
			return 0; // until there will be a fmod manager
#		else
			return 0;
#		endif

	default: return 0;
	}

	return 0;
}
Is that enough so when I use my engine in a commercial product and undefine _NGE_COMPILE_WITH_IRRKLANG_ it wont break the license?

Note: There are still places where irrKlang.h is included but none of them actually use the library because it needs a CIrrKlangManager which it doesn't get because of the code above.
Last edited by MasterGod on Fri Feb 01, 2008 11:04 am, edited 1 time in total.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

well if you have that feature enabled and don't ship the IrrKlang libarys it would be ok i guess ;)

but don;t think this gonna work with FMod:

ISoundManager* createSoundManager(E_AUDIO_DEVICE AudioDevice)
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

After adding this (in CIrrKlangManager.h):

Code: Select all

#if GAME_COMPILER == COMPILER_MSVC
#	ifdef _NGE_COMPILE_WITH_IRRKLANG_
#		pragma message ("Linking irrKlang")
#		pragma comment(lib, "irrKlang.lib")
#	endif
#endif
When I don't define _NGE_COMPILE_WITH_IRRKLANG_:
1. I don't need the .lib of irrKlang
2. I don't need the dll
3. I DO need the .h files for compilation.
4. It compiles fine and everything is as expected.

Maybe niko can make it clear?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I would think that even just including the header files for irrklang would break the licence, can you not get it to work without them? I would think you could do similar things to not require them.
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Should I stick a #ifdef before every irrklang include?
It would break my code cause it needs the types declared in those .h files..

Maybe because all the real code, the implementation which is in the dll and lib files could be not-shipped and only the .h files will be required to compile, its ok.. But I must have niko answering that and have his approval.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah you'd have to #def out all the irrklang includes, you shouldn't really rely on the types in there if you're not meant to be using the code. In fact that probably does break the licence because you're using the types from the irrklang code.

Just redefine your own versions of the types in your own code and you could have a single header file for your audio stuff which your own classes use and in that audio header file you decide which lib headers to include (irrklang, fmod etc) which would allow you to remove the irrklang headers completely from your code, except for that audio header where they wouldn't be compiled in if you didn't ask for them.

Incidentally i reckon Christian might appreciate a word with you about this switchable audio library implementation as he wants to do some similar things in The First King.
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

MasterGod wrote:After adding this (in CIrrKlangManager.h):

Code: Select all

#if GAME_COMPILER == COMPILER_MSVC
#	ifdef _NGE_COMPILE_WITH_IRRKLANG_
#		pragma message ("Linking irrKlang")
#		pragma comment(lib, "irrKlang.lib")
#	endif
#endif
When I don't define _NGE_COMPILE_WITH_IRRKLANG_:
1. I don't need the .lib of irrKlang
2. I don't need the dll
3. I DO need the .h files for compilation.
4. It compiles fine and everything is as expected.

Maybe niko can make it clear?
niko's email wrote:Nikolaus Gebhardt to me

show details 11:12 AM (1 hour ago)



Reply


Hi,
no, sure, that's absolutely ok. Just use it :)
niko
- Show quoted text -
Seems like niko agrees with me that it's enough :D Yay!
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Lovely chap! That probably makes it easier for you. Though i imagine for other projects that can't be used freely or whatever they probably wouldn't be so friendly about it.
Image Image Image
Post Reply