Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Suggestions for checking to see if a loadX command fails

Author
Message
DrT
16
Years of Service
User Offline
Joined: 10th May 2008
Location: 26.78 degrees North, -70.49 degrees West
Posted: 20th Nov 2011 11:13
Suppose you use attempt to use loadImage and there is a problem executing this command (e.g. corrupted image file, hard disk hiccup, etc.). Suggestions for checking for failure?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 20th Nov 2011 15:34
This is the sort of thing I generally do.

That will check if the file exists, and ignore the load command if it fails. Obviously it doesn't check if the file is corrupted or not, just if it exists. You could easily flag an array to record each failure to load also. I'm not sure about checking file integrity, but I can't really see a need myself.

Login to post a reply

Server time is: 2024-11-22 16:23:45
Your offset time is: 2024-11-22 16:23:45