the structure of .paks
i hear so many different things its starting to confuse me. ive seen the structure of a pak from quake 2 and it has a different structure to another pak used in a different game. i heard paks are made by some freeware and its a standard method yet i cant find any doc's on it.
the following code is how a pak is read from a game i play and also i saw a comment referring to the pak structure as a .ASD structure.
so could someone point me to a structure of a standard pak or some freeware that is open source that deals with paks? or just any info on this matter ;/.
CSprite::CSprite(HANDLE hFileRead, short sSprID, short NthFile, char* FileName)
{
int i;
DWORD nCount, dwASDfileLoc;
for( i=0 ; i < 60 ; i++ )
{
m_stBrush[i].x = -1;
m_stBrush[i].y = -1;
m_stBrush[i].szx = -1;
m_stBrush[i].szy = -1;
m_stBrush[i].pvx = -1;
m_stBrush[i].pvy = -1;
}
m_sSprID = sSprID;
ZeroMemory( m_cFileName, sizeof(m_cFileName) );
strcpy( m_cFileName, FileName );
SetFilePointer(hFileRead, 24 + NthFile*8, NULL, FILE_BEGIN);
ReadFile(hFileRead, &dwASDfileLoc, 4, &nCount, NULL);
SetFilePointer(hFileRead, dwASDfileLoc+100, NULL, FILE_BEGIN);
ReadFile(hFileRead, &m_iTotalFrame, 4, &nCount, NULL);
ReadFile(hFileRead, m_stSpd, m_iTotalFrame*12, &nCount, NULL);
m_dwBmpStartPos = dwASDfileLoc + 108 + m_iTotalFrame*12;
m_bIsDCEmpty = TRUE;
}
[1480 byte] By [
master661] at [2007-11-19 10:44:49]

# 1 Re: the structure of .paks
Lot of time passed since I was programming for Quake, but maybe this info will be helpful:
First of all, structure of .pak file is slightly different for each game using quake engine. So, Q1, Q2, HL, and so on pak files are not 100% compatible. You can find out how to read or create them either browsing game source code, or getting source code of any freeware tool. The best I encountered were PakExplorer and Quark: Quake Army Knife. AFAIR both programs allowed you to create own pak files. However, it was quite long ago and maybe today there are better tools. Also try to google and search planetquake forums, maybe there you will find some info. Just remember: different .pak files can have different format, just make sure that stuff you are reading applies to quake archives.
Good luck
Hob
Hobson at 2007-11-10 3:50:30 >
