DinkSmallwoodHD/source/dink/FFReader.h
seth 59d4b5754c * Dink now continues to download and install dmods when in the background, but everywhere else pauses automatically
* After installing a dmod, you can now choose to play it now or go back to the browse dmod list
* DMOD data downloaded from dink network is now cached for that session (it's not going to change so quickly, so why stress DN.com if we don't have to)
* (Bugfix) "installing <dmod>..." text message is no longer truncated in a weird way sometimes
* (Bugfix) Fixed another issue where a base graphic could fill in with a missing .bmp in a sequence when it shouldn't


git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1505 353e56fe-9613-0410-8469-b96ad8e6f29c
2017-09-23 11:52:16 +00:00

60 lines
No EOL
1.5 KiB
C++

// ***************************************************************
// FFReader - Creation date: 12/31/2009
// -------------------------------------------------------------
// Robinson Technologies Copyright (C) 2009 - All Rights Reserved
//
// ***************************************************************
// Programmer(s): Seth A. Robinson (seth@rtsoft.com)
// ***************************************************************
#ifndef FFReader_h__
#define FFReader_h__
#include "BaseApp.h"
#pragma pack(push, 1)
struct FFFileInfo
{
int offset;
char name[13];
};
#pragma pack(pop)
class FFReader
{
public:
enum eErrorType
{
ERROR_NONE,
ERROR_LOW_MEM
};
FFReader();
virtual ~FFReader();
bool DoesFileExist(const string &fName, const string &fFirstFrame);
void Init( const string &gamePath, const string &dmodGamePath, const string &baseDir, bool bUsingDinkPak);
byte * LoadFileIntoMemory(string const &fName, int *pSizeout, const string &fFirstFrame); //you need to delete [] what this gives you on your own
eErrorType GetLastError() {return m_error;}
private:
void Kill();
int GetFFRecordIndexFromFileName(const string &fName);
byte * LoadFFIntoMemory(int index, int *pSizeOut);
int GetNextFFIndex(int index);
void SetError(eErrorType error);
string m_gamePath;
string m_dmodGamePath;
string m_basePath;
FILE *m_fp;
bool m_bUsingBaseDinkFF;
eErrorType m_error;
string m_dmodBasePath;
vector<FFFileInfo> m_fileHeader;
};
#endif // FFReader_h__