Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pack File Commands (dbReadDirBlock, dbReadFileBlock so on)

Author
Message
Alfie
16
Years of Service
User Offline
Joined: 25th Dec 2007
Location:
Posted: 29th Jan 2009 10:11 Edited at: 29th Jan 2009 10:34
Has anyone used them before? I only found one post on the forums even mentioning them

I just gave them a go. Basically, using open files (dbOpenToRead/Write) you pack or unpack files using:
dbReadFileBlock, dbReadDirBlock, dbWriteDirBlock, dbWriteFileBlock.

Is this an acceptable way of working? To load a texture you would have to first extract it, load the texture and then delete the extracted file again.

Are there better ways to do it? I suppose people rarely get their projects to that stage and it isn't usually an issue, but obviously this kind of thing is necessary for a finished game so someone must have figured it out? (please) Or is it acceptable to do it this way?

re-edit - I took this out before I realised it was commented on but - it would be great if we could dbSetDir in the pack file and proceed as normal. Maybe an idea for an update?

Cheers
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 29th Jan 2009 10:25
Well, DarkGDK file commands is slow. Maybe there is another way to unpack/pack files than use the *Block commands. But you have a great idea! I have never see these commands before!
Khrys
15
Years of Service
User Offline
Joined: 11th Feb 2009
Location:
Posted: 12th Feb 2009 01:40
Hi,

I tried to use the Memblock commands to build a ressources file using dbMakeMemblockFromImage, dbWriteMemBlock, dbReadMemBlock and dbMakeImageFromMemblock.

It's an easy way to access data but the file created is huge. (about 15 Mo with this method instead of 2 Mo using pack files.)

I prefer to use the dbWriteFileBlock and dbReadFileBlock commands even if I have to extract the files and delete them after used the textures. Afterall is just 2 more commands of code and it's not very slow for small projects.
Including this in a loop allow to texture a lot of objets using 3 lines of code (Ok I use more than one commands per line ), but it's really short.

Anyway I agree, this might cause problems with "big" programs.

Cheers

Login to post a reply

Server time is: 2024-09-30 17:33:06
Your offset time is: 2024-09-30 17:33:06