2017-06-28 23:00:08 +00:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2017-07-30 13:03:54 +00:00
|
|
|
#include "../Utilities/ZipReader.h"
|
2017-09-30 18:07:07 +00:00
|
|
|
#include "HdData.h"
|
|
|
|
#include "VirtualFile.h"
|
2017-06-28 23:00:08 +00:00
|
|
|
|
|
|
|
class HdPackLoader
|
|
|
|
{
|
|
|
|
public:
|
2017-07-30 13:03:54 +00:00
|
|
|
static bool LoadHdNesPack(string definitionFile, HdPackData &outData);
|
|
|
|
static bool LoadHdNesPack(VirtualFile &romFile, HdPackData &outData);
|
2017-06-28 23:00:08 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
HdPackData* _data;
|
2017-07-30 13:03:54 +00:00
|
|
|
bool _loadFromZip = false;
|
|
|
|
ZipReader _reader;
|
2017-06-28 23:00:08 +00:00
|
|
|
string _hdPackDefinitionFile;
|
|
|
|
string _hdPackFolder;
|
|
|
|
vector<HdPackBitmapInfo> _hdNesBitmaps;
|
|
|
|
|
2017-07-30 13:03:54 +00:00
|
|
|
HdPackLoader();
|
|
|
|
|
|
|
|
bool InitializeLoader(VirtualFile &romPath, HdPackData *data);
|
|
|
|
bool LoadFile(string filename, vector<uint8_t> &fileData);
|
2017-08-19 20:46:57 +00:00
|
|
|
bool CheckFile(string filename);
|
2017-06-28 23:00:08 +00:00
|
|
|
|
|
|
|
bool LoadPack();
|
|
|
|
void InitializeHdPack();
|
|
|
|
void LoadCustomPalette();
|
|
|
|
|
2017-08-16 00:25:25 +00:00
|
|
|
void InitializeGlobalConditions();
|
|
|
|
|
2017-08-19 20:46:57 +00:00
|
|
|
//Video
|
2017-07-30 13:03:54 +00:00
|
|
|
bool ProcessImgTag(string src);
|
2017-06-28 23:00:08 +00:00
|
|
|
void ProcessPatchTag(vector<string> &tokens);
|
2017-08-13 01:21:55 +00:00
|
|
|
void ProcessOverscanTag(vector<string> &tokens);
|
2017-06-28 23:00:08 +00:00
|
|
|
void ProcessConditionTag(vector<string> &tokens);
|
|
|
|
void ProcessTileTag(vector<string> &tokens, vector<HdPackCondition*> conditions);
|
|
|
|
void ProcessBackgroundTag(vector<string> &tokens, vector<HdPackCondition*> conditions);
|
|
|
|
void ProcessOptionTag(vector<string>& tokens);
|
|
|
|
|
2017-08-19 20:46:57 +00:00
|
|
|
//Audio
|
|
|
|
int ProcessSoundTrack(string albumString, string trackString, string filename);
|
|
|
|
void ProcessBgmTag(vector<string> &tokens);
|
|
|
|
void ProcessSfxTag(vector<string> &tokens);
|
|
|
|
|
2017-06-28 23:00:08 +00:00
|
|
|
vector<HdPackCondition*> ParseConditionString(string conditionString, vector<unique_ptr<HdPackCondition>> &conditions);
|
|
|
|
};
|