desactivate incbin clause inside a bmax file

BlitzMax Forums/BlitzMax Programming/desactivate incbin clause inside a bmax file

hub(Posted 2009) [#1]
Hi !
inside my program, i've a lot of included graphics external files (.png) to the final exe ('incbin'). These are graphics files. Into the design step, my artist need to access them. Is there a way for me to 'desactivate all the incbin clauses' without edit all the bmax file and change it manually ? (compiler directive ?)

Thanks.

Incbin "stars.png"
global stars=LoadImage( "incbin::stars.png" )
...


plash(Posted 2009) [#2]
'desactivate all the incbin clauses'
Not entirely sure what your asking here, but for one you cannot change any incbinned files once the code is compiled.


hub(Posted 2009) [#3]
perhaps more clear : is there a compiler directive to desactivate the incbin process before compile the program (to keep the external files).


Muttley(Posted 2009) [#4]
No, but you can always do something like this:

?Debug
   Const RESOURCE_PATH:String = ""
?Not Debug
   Const RESOURCE_PATH:String = "incbin::"

   IncBin "resources/dat/levels.ini"
   IncBin "resources/gfx/logo.png"
?


Then in your code you load stuff like this:

LoadImage(RESOURCE_PATH + "resources/gfx/logo.png")


That way debug releases use files in the filesystem, and release versions are incbined.


Dreamora(Posted 2009) [#5]
Unless you rewrote BMK, no

You will have to modify the source at least once.
I would recommend to do a "protocol based approach" like:
global loadProtocol:string = ""
if incBin then loadProtocol = "incbin::"


This also would give you flexible switch to TCP resources or whatever.


hub(Posted 2009) [#6]
Nice idea thanks !