A Suggestion

Monkey Forums/Monkey Programming/A Suggestion

hardcoal(Posted 2011) [#1]
It will be very nice that instead of crashing
when LoadImage does not find an image.
It will create a default blank red Image or something like that.
that will save the crash frustration since in GLFW you don’t even get an error. its just crash, and go figure what was wrong..

same for other media types like audio.. can be a good idea.

Generaly it will be nice not to have crashes.


therevills(Posted 2011) [#2]
Normally I create a little function something like this:

Function LoadImg:Image(path$)
	Local img:Image = LoadImage(path)
	If img = Null Then
		Print(msg)
		Error(msg)
	End
	Return img
End


and the same with the other media types.


hardcoal(Posted 2011) [#3]
nice idea . ill take it
also im working on an error report module (in the future..)
which you implant on your code and it will produce general error log.

Exmaple:

If ImageNotLoaded.. AddErrorToLog("Image not loaded at line 196..")


therevills(Posted 2011) [#4]
Diddy has an Assert Module you might want to look at ;)


hardcoal(Posted 2011) [#5]
ok..