ISHELL_LoadResImage problems | developer.brewmp.com ISHELL_LoadResImage problems | developer.brewmp.com

Developer

ISHELL_LoadResImage problems

Forums:

Hello,

I am using BREW 1.1 and have noticed a recent problem as my project gets larger. During different portions of the game, like menuing or game modes, I first try and free (if any have been allocated) and the load image files.

I notice that every now and then, an image file read using ISHELL_LoadResImage will return me NULL, even though "I know it exists" and it was loaded earlier.

This to me implies that there is a potential problem accessing the file system, but to the best of my knowledge, I am only accessing it during these resource loads.

I've just recently separted my resource files into one for just strings and just graphics. I did this, because it had a large amount of items in it and the emulator was originally giving me an "Application Error Memory Access File Read" when trying to do an ISHELL_LoadResString.

My resource file for graphics is about 48K and has around 26 resource to me. This is after collapsing the resources down ... there was originally around 100.

Makes me think there is a timing problem with accessing the file system.

Has anyone encountered such a problem as well?
Thanks.

Ben:confused:

It might be that your image is not completely loaded.
see the comments by "kevin" in this thread:
http://brewforums.qualcomm.com/showthread.php?s=&threadid=376
-Tyndal

It might be that your image is not completely loaded.
see the comments by "kevin" in this thread:
http://brewforums.qualcomm.com/showthread.php?s=&threadid=376
-Tyndal

Some phones (the VX4400 for example) don't work with images that are two wide. That wouldn't prevent them from loading, but once you get them loaded it may be a problem getting them to draw. I think 640 pixels is the max width, but I'm not positive, you'd need to check the phone specs.
Ed

Some phones (the VX4400 for example) don't work with images that are two wide. That wouldn't prevent them from loading, but once you get them loaded it may be a problem getting them to draw. I think 640 pixels is the max width, but I'm not positive, you'd need to check the phone specs.
Ed

Hello,
Yes, I think Tyndal was right about the image not quite being loaded yet. I actually made another version that built up a queue of images to load and the waited for each one to load. This fixed that problem, but then another problem occurred. LoadResString then would cause Memory Access problems. More specifically on FileRead. This was in both the emulator and only on certain handsets.
The annoying thing about this is that it seems that if you use the LoadResString to get a string, it cannot tell you when that load is actually complete. Although I understand why they went with a non-blocking method for I/O, it would have been nice if they gave more support routines to explicitly suspend (or maybe they exist I say in hope that I just don't know they do) one of my routines until the I/O is done.
My solution ended up being to pre-queue the strings upon load (although I didn't want to have to do this).
I should note that with the version that pre-queues the strings, I can load my images whenever I want. So it seems to me that there are times of conflict when I cannot access the resource file. Is there any good way of determining this?
Does any of this grief I'm going through with the file system sound similar to others?
Thanks.
Ben

Hello,
Yes, I think Tyndal was right about the image not quite being loaded yet. I actually made another version that built up a queue of images to load and the waited for each one to load. This fixed that problem, but then another problem occurred. LoadResString then would cause Memory Access problems. More specifically on FileRead. This was in both the emulator and only on certain handsets.
The annoying thing about this is that it seems that if you use the LoadResString to get a string, it cannot tell you when that load is actually complete. Although I understand why they went with a non-blocking method for I/O, it would have been nice if they gave more support routines to explicitly suspend (or maybe they exist I say in hope that I just don't know they do) one of my routines until the I/O is done.
My solution ended up being to pre-queue the strings upon load (although I didn't want to have to do this).
I should note that with the version that pre-queues the strings, I can load my images whenever I want. So it seems to me that there are times of conflict when I cannot access the resource file. Is there any good way of determining this?
Does any of this grief I'm going through with the file system sound similar to others?
Thanks.
Ben