Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » fast put_pixels(again) or al_load_bitmap(void* data)

This thread is locked; no one can reply to it. rss feed Print
 1   2 
fast put_pixels(again) or al_load_bitmap(void* data)
kazzmir
Member #1,786
December 2001
avatar

Can you upload the datafile somewhere? Your claim is that just reading the file and using allegro5 to load the individual sprites takes a long time which should be easy to verify with a small program.

aniquilator
Member #9,841
May 2008
avatar

If you are in linux, you can get the test here:
TEST
I compiled almost everything as static, you will just need allegro5.1 . Thats all.

kazzmir
Member #1,786
December 2001
avatar

 $ ./teste
./teste: error while loading shared libraries: libaudiere-1.9.4.so: cannot open shared object file: No such file or directory

Anyway statically linking your program will not let me debug it. Can you not provide the source?

Matthew Leverton
Supreme Loser
January 1999
avatar

Is There some "ident" I can pass, so it will try to load until it reaches the correct format?

Allegro has no image detection. It only loads exactly what you tell it to via the extension of the filename or the ident parameter.

kazzmir
Member #1,786
December 2001
avatar

Allegro has no image detection.

Although maybe it could. bool al_is_image_png(ALLEGRO_FILE * file); etc?

Matthew Leverton
Supreme Loser
January 1999
avatar

Or it could be something like const char *al_detect_image_format(ALLEGRO_FILE *f); that returns some global const char string. The problem (limitation) with such a thing is that the file stream would have to be seekable in order for it to be useful. So Allegro couldn't automatically just try that.

And speaking of which, it would be useful if Allegro's file interfaces could be queries to see whether or not they were seekable.

Thomas Fjellstrom
Member #476
June 2000
avatar

Yes, I think a flag or function of some sort to check would be useful.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

aniquilator
Member #9,841
May 2008
avatar

So, I've downloaded your game, paintown, and compiled it with allegro5.
And, the loading I got in mugen, when loading the kfm sff, was almost the same time I got loading my spritepack, so I have putted a char with the same sprites in your data folder, and loaded it into the mugen mode, the surprise: For it to load in my pc, it took me almost 40 seconds..

I think the problem is with my pc... :(

Thomas Fjellstrom
Member #476
June 2000
avatar

If your netbook is really slow, yeah, it'll take forever to decompress the images and upload them to the gfx card. Especially if the flash drive in it is really slow (some are).

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

aniquilator
Member #9,841
May 2008
avatar

The strange thing is that, when I'm using allegro4 or SDL, it runs faster. Crazyness.

Thomas Fjellstrom
Member #476
June 2000
avatar

Yeah, so your netbook likely has a VERY slow GPU. But a decent CPU. So it can do software some rendering faster than gpu rendering.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

kazzmir
Member #1,786
December 2001
avatar

If you just run paintown normally it will use memory bitmaps to load all sff files because they are loaded in a separate thread where there is no ALLEGRO_DISPLAY set. All processing should happen on the CPU just as with Allegro4/SDL so the only added time is uploading them to the GPU.

Can you try building the tests and just loading kfm by himself?

$ make test
$ build-allegro5/test/mugen/load

After you run the test twice (to make sure the cache is full) I see

[0:test] Success! Took 1.885 seconds

Some of the tests currently fail, just ignore those.

aniquilator
Member #9,841
May 2008
avatar

Kazzmir, I couldnt compile your test using allegro 5, what is the parameter for that?

But now I'm really shocked.
I put my program to load every thing using memory bitmaps, and them I convert every sprite to video_bitmaps.. and guess what? A lot faster than load everything in video_bitmaps.
I can't understand this very well.. Why, loading every sprite as a memory bitmap, and after clonning every sprite to replace the memory for video bitmaps is faster than, just load everything as video_bitmaps ?

Crazy stuff. kkkk

kazzmir
Member #1,786
December 2001
avatar

Kazzmir, I couldnt compile your test using allegro 5, what is the parameter for that?

Well can you say why you couldn't compile exactly?

$ export ALLEGRO5=1
$ make test

I left out the 'export ALLEGRO5=1' because you claimed you had compiled paintown with allegro5 already so I thought you figured out to set ALLEGRO5 yourself. If you don't set ALLEGRO5 you will get an SDL implementation.

Quote:

I put my program to load every thing using memory bitmaps, and them I convert every sprite to video_bitmaps.. and guess what? A lot faster than load everything in video_bitmaps.

I think theres some information you are leaving out. It would be nice to see your source.

 1   2 


Go to: