what happens to the rest of the internal numbers assigned to the remaining images? Do they obtain their same internal number?
Well, in my example there's still image numbers. I like having the ability to use image numbers too, I'd like both ways.
Anyway, the routine for obtaining a free image number can be done any way the developers like.
DBPro does not have a built in method of finding an unused image (or object, sound, etc) number, but matrix1utils does have functions to do this. You can also manually write functions to do it in DBPro. Before matrix1utils, what I would do is have a global that would keep track of the last used image number. Whenever I'd request a freem image, with a function called "find_free_image()", I would increment that number, check to make sure that number wasn't being used. If it was being used, I'd increment it by one and check it again. Once I find a free image number, I'd return that number. If it hit the maximum value an image number can have, it would return back to 1 and check it to see if it's free.
With this method, it's very fast as long as it doesn't run into a block of used images. If you use up all available slots, it would cause an infinate loop and crash unless you check for that too. Matrix1utils uses random numbers last I heard. It's a very fast lookup too unless you have *a lot* of images being used.