PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

General Animation Questions

Hi, I can not get working my large animation files, because they are too big.It is very interesting, how animation was organized in GledPlay, because they worked in there. Anyway, I get No Sys Memory Error, when I'm trying to create surface. So I wondering, what if I'll use lots of frame files, instead of cutting them of from big one, creating new surface with new frames everytime - is it good solution, or will it be very slow? And maybe there is some other ways to prevent system memory from being overloaded?
Hi Ryumaster,

Making separate small surfaces shouldn't have an effect on in-game performance. If you arrange frames vertically they may even be faster (because of the memory layout).

It may only give a bit more overhead when loading your surfaces. If you're saving them in EPK files, I recommend using the PackBuildIndex function to quickly access the files (this function has more effect on EPK packs with a lot of files).
I decided to preload all animation files before level starts, because surface loadings slows game visually. I have made *.tga file with all alpha channels. But When I'm trying to load it, I'm always getting E_NOMEMORY error. And I've rased ppc emulator memory to 128 mb, but it is not helping. How much memory tga file of 14,1mb size takes in edgelib? Maybe it is some kind of bug?


Code:
if (file.PackGetFileData(filedata, filedatasize, "animations.tga") == E_OK)

{

if (shared->ecd->dsp->CreateSurface(&shared-;>npc1, filedata, filedatasize) != E_OK) //NO_MEMORY HERE
*module = MODULE_CLEANUP;

}
Hi Ryumaster,

Can you tell me the dimensions of the .tga file?

Maybe it's a good idea to save it as .png instead and try loading it. Also, would you like to try loading it from a file directly instead of using packages?
edge wrote:Hi Ryumaster,

Can you tell me the dimensions of the .tga file?

Maybe it's a good idea to save it as .png instead and try loading it. Also, would you like to try loading it from a file directly instead of using packages?


Hi! The dimensions are 15360 X 240. As you recommended, I'll arrange animation pic vertically because of memory layout, after I'll get it working this way.
I have tried saveing it as bmp and png as well. PNG only for testing, because I get no alpha channel with png 16 bit pic.
I'll try loading it from file and tell you what have I got, but it will take me some time to figure out how to add full path and e.t.c because I'm newby programmer, so please wait a bit :)
Hi Ryumaster,

You don't need to add the path. Just place your file inthe same directory as the executable file, and you should be able to load it directly (for example: display->CreateSurface(&surf;, "image.png")).

Arranging the image vertically also has the advantage that the loader require less memory to handle each scanline of the picture. I still recommend splitting it into separate files though.
I'll try splitting to find the most quicker way, but I have to get it working firstly :)

So opening is very simple, okay.

Tga file still gives me E_NOMEMORY error.
Bmp - E_UNSUPPORTED. I tryed saving bmp as 8, 16 and 24 bit from Photoshop with default settings. Maybe there is some auto-compression enabled or something? I couldn't find any. Bmp should be supported by edge as I see from reference.
Hi Ryumaster,

Have you tried to create a native Windows Desktop build and load the image file? For example, open the helloworld sample, edit the code to load your image and check the return value. Maybe the emulator has trouble allocating big amounts of memory.

The 24-bits bitmap should load OK. Perhaps it can't load because of its size. Maybe you can try opening the file with paint, paint over it, undo and save the file.
I'll get the real devices firstly and make some testings, then. I'll write here back for I've got.