all ifstream/ofstream uses searchpath system
git-svn-id: https://clonekeenplus.svn.sourceforge.net/svnroot/clonekeenplus/cgenius/trunk@152 4df4b0f3-56ce-47cb-b001-ed939b7d65a6
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "../StringUtils.h"
|
||||
|
||||
#include "../FindFile.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -29,7 +29,7 @@ bool CExeFile::readData()
|
||||
{
|
||||
std::string filename = "data/" + m_datadirectory + "keen" + itoa(m_episode) + ".exe";
|
||||
|
||||
std::ifstream File(filename.c_str(),ios::binary);
|
||||
std::ifstream File; OpenGameFileR(File, filename, ios::binary);
|
||||
// TODO: If Exe-file wasn't detected, make the program quit somehow, or it crashes
|
||||
|
||||
if(!File) return false;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <fstream>
|
||||
#include "../FindFile.h"
|
||||
|
||||
CPatcher::CPatcher(int episode, int version,unsigned char *data, const std::string& datadir) {
|
||||
m_episode = episode;
|
||||
@@ -123,7 +124,7 @@ bool CPatcher::loadPatchfile()
|
||||
// The file was found! now read it into the memory!
|
||||
|
||||
char* buf;
|
||||
std::ifstream Patchfile(dp->d_name);
|
||||
std::ifstream Patchfile; OpenGameFileR(Patchfile, dp->d_name);
|
||||
|
||||
while(!Patchfile.eof())
|
||||
{
|
||||
@@ -163,7 +164,7 @@ void CPatcher::patchMemfromFile(const std::string& patch_file_name, int offset)
|
||||
unsigned char *buf_to_patch;
|
||||
unsigned char byte;
|
||||
|
||||
std::ifstream Patchfile(patch_file_name.c_str(), std::ios::binary);
|
||||
std::ifstream Patchfile; OpenGameFileR(Patchfile, patch_file_name, std::ios::binary);
|
||||
|
||||
if(!Patchfile) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user