Avoid loading specific modules !

BlitzMax Forums/BlitzMax Programming/Avoid loading specific modules !

Armitage 1982(Posted 2012) [#1]
Hi

Without using Framework,
is there a way to avoid loading pngloader.mod and jpgloader.mod ?

I cannot use Framework because my sound system won't work correctly if I do that (nightmare dependences).

If you are using the Freeimage module, you may have notice that if you remove these 2 folders from your BlitzMax mod folder and correctly import freeimage.mod, you are able to use loadAnimImage() with JPG and BMP without a crash (loadjpg crash).

This is because these 2 libraries are already used by Freeimage and are conflicts with the BRL one.

BlitzMax load every modules present in BRL when you do not specify a Framework, but isn't really no other option than removing these two from BRL ?

Thanks :)


H&K(Posted 2012) [#2]
I cannot use Framework because my sound system won't work correctly if I do that (nightmare dependences).
Yes it will, its just a pain.


ima747(Posted 2012) [#3]
freeimage overrides those modules so it can override some of their functions. Because of this if you remove the modules and don't use any functions that aren't overridden by freeimage then it still works.

You can use sound with Framework, but it's a bit of a PITA because of the way the sound modules are structured. You will likely have to import a number of modules to get sound working. Here's what I import in a project with sound that uses framework. Not sure if you need direct sound and free audio, but mine's mac and PC and I didn't want to figure out if I could remove more. Note, if you're not using wavs then you'll need a different loader, etc.
Import BRL.Audio
Import BRL.DirectSoundAudio
Import BRL.FreeAudioAudio
Import BRL.WAVLoader