![]() |
|
HOW TO LOAD DAT FILE IN PACK FILE |
tibgamer
Member #6,859
February 2006
![]() |
Hi guys.. I have been trying to load dat file in a pack file...but i couldn't able to do it..though..after much fiddling..i could able to load a bitmap in packfile..so..could you guys..please tell me how to load dat file in a packfile..
software is not written, it is rewritten |
umperio
Member #3,474
April 2003
![]() |
You could simply put the bitmap in a datafile and use global compression. Regards |
miran
Member #2,407
June 2002
|
You seriously need to read the manual. It looks like you have no idea what you're talking about. I have neither but if I made a wild guess, I'd say you're looking for this function: DATAFILE *load_datafile_object(const char *filename, const char *objectname); DATAFILE *object = load_datafile_object("datafile.dat", "MYBITMAP"); if (object != 0) { BITMAP *bmp = (BITMAP *)object->dat; } Of course I could be wrong and this is not what you're asking about. It's hard to tell from your post... -- |
tibgamer
Member #6,859
February 2006
![]() |
hi guys.. i already know how to put bitmap into dat file and know how to load object of dat file...but only thing i am looking for is some specific PACKFILE routines from where you can load dat file and blit it. For example..in my code i used: pf = pack_fopen ("frog.bmp", F_READ); which i guess..reads a bitmap file from disk and puts it into compressed packfile..rite..so..like that..i am looking for packfile routine..which loads a datfile...assuming..there must be a PACKFILE routine for such thing...! Miran: i guess.urs code only loads object of datfile and puts it into bmp..and then blit it..rite...so there is no mention of any PACKFILE routines...hope you guys know what i am looking for in particular.... Regards software is not written, it is rewritten |
miran
Member #2,407
June 2002
|
Quote: hope you guys know what i am looking for in particular.... No. But why is load_bitmap() not good enough for you? EDIT: Or you could use BITMAP *load_bmp_pf(PACKFILE *f, RGB *pal); When I said you seriously need to read the manual, I was serious. This is all in there. -- |
Kitty Cat
Member #2,815
October 2002
![]() |
Quote:
EDIT: Or you could use He does. He's asking for something similar for datafiles. The answer is, there's no need. pack_fopen doesn't load the file into memory. It buffers a small bit of the file (about 4K) for slightly quicker access, but it's still read from disk as-needed. Given your code, there's no reason not to use load_bitmap, or load_datafile[_object]. -- |
tibgamer
Member #6,859
February 2006
![]() |
Quote: When I said you seriously need to read the manual, I was serious. This is all in there. i have been reading manual very carefully...Before coming here..i always..reads manual...n..if i couldn't able to understand it..then i come here for you guys help.. load_bitmap() BITMAP *load_bmp_pf(PACKFILE *f, RGB *pal); i already used it in my first post...you can find it in the function thanks anyway.... software is not written, it is rewritten |
miran
Member #2,407
June 2002
|
Ah, now I get it. Well, the load_datafile() function as far as I know internally uses the packfile routines, so what you're looking for wouldn't really make much sense. -- |
umperio
Member #3,474
April 2003
![]() |
Quote: and when i tried to load datfile using PACKFILE...i am finding hard to find any PACKFILE ROUTINE to load datfile...now..it seems like there aren't any PACKFILE ROUTINE to load datfile...disappointed...! Because, again, there's no need for them, if you need a compressed datafile, just create a compressed one with grabber and load it normally with load_datafile. |
Tobias Dammers
Member #2,604
August 2002
![]() |
Do you understand what a packfile really is? Basically, it's just a plain vanilla libc FILE*, with a few extra features: A DATAFILE is allegro's implementation of a resource file. It is organized in chunks, each of which can hold an object of various types. The datafile routines internally use the packfile API for i/o, but you don't need to know this. So for all datafiles (files that you created using grabber or dat), use the datafile api. For all other files, use the packfile api. --- |
|