Jump to content
  • Advertisement
Sign in to follow this  
Kryptus

Quick problem

This topic is 4998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just made a simple PAK file opener, but one line of code doesn't work... // Structures typedef struct { char Signature[4]; int DirOffset; int DirLength; int NumFiles; } pakHeader; typedef struct { char FileName[56]; int FilePosition; int FileLength; } pakEntry; // Open a PAK file FILE *file; pakHeader Header; pakEntry *Entry; int NumFiles; file = fopen(FileName, "rb"); fread(&Header, sizeof(Header), 1, file); if (strncmp(Header.Signature, "PACK", 4)) fclose(file); fread(&Header.DirOffset, sizeof(int), 1, file); fread(&Header.DirLength, sizeof(int), 1, file); NumFiles = Header.DirLength / sizeof(Header); // This line doesn't work and returns an error! Entry = new pakEntry(NumFiles); fseek(file, Header.DirOffset, SEEK_SET); fread(Entry, sizeof(pakEntry), NumFiles, file); for (int i = 0; i < NumFiles; i++) SendMessage(hListView, LB_ADDSTRING, 0, (LPARAM) Entry->FileName); If there are any other errors, please tell me them!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!