Incbin when debug is off only
BlitzMax Forums/BlitzMax Programming/Incbin when debug is off only
| ||
Right now I am doing this:'Import "incbins.bmx" 'uncomment when debug is off Global IncString:String="incbin::" ?debug incstring="" ? Notice that I have to uncomment the incbins when switching to release mode. Is this the best way to do it? What do people normally do to IncBin only when debug is off? Its not a big deal since I rarely want to incbin, it just seemed odd what I am doing. |
| ||
Pretty much I'm afraid. I generally don't worry about what I'm going to Incbin until the project is finished, or near finished, or when all the stuff I want to Incbin is finalised ... if that makes any sense! |
| ||
This is how I do it (which is pretty much what you're already doing). The only drawback is that you can't conditionally include/exclude .bmx source at compile time, so you need to comment out the Include line. Although it isn't as elegant as a preset compiler directive, it works fine:Global Debug:Byte = true 'or False Global binPath:string = "" Include "incbinDeclarations.bmx" 'comment this out if running in debug mode. If Debug binPath = "" Else binPath = "Incbin::" EndIf LoadGraphics() Function LoadGraphics() img = LoadImage(binpath+"image.png") End Function |
| ||
Pretty much I'm afraid. I generally don't worry about what I'm going to Incbin until the project is finished, or near finished, or when all the stuff I want to Incbin is finalised ... if that makes any sense! Ok that makes sense, I just like to send my WIP EXE's around to people who are interested in what I'm working on @GfK Ya thats what I was doing too until a lot of my files were changed to imports and then they didn't have access to my DEBUG const, so I think the only "variable" imports can share is ?debug. (apparently imports get recompiled when you toggle debug) |