1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-07-19 11:18:00 +02:00

Remove GameData::openFile

The openFile API is not useful for implementing the correct
behaviour, so the underlying FileIndex method will be removed
soon.
This commit is contained in:
Daniel Evans 2016-09-07 22:05:46 +01:00
parent 0be8586135
commit 0abfc695fb
6 changed files with 5 additions and 17 deletions

View File

@ -383,7 +383,7 @@ void GameData::loadDFF(const std::string& name, bool async)
void GameData::loadIFP(const std::string &name)
{
auto f = openFile(name);
auto f = index.openFile(name);
if(f)
{
@ -458,16 +458,6 @@ void GameData::loadSplash(const std::string &name)
engine->state->currentSplash = lower;
}
FileHandle GameData::openFile(const std::string &name)
{
auto file = index.openFile(name);
if( file == nullptr )
{
logger->error("Data", "Unable to open file: " + name);
}
return file;
}
int GameData::getWaterIndexAt(const glm::vec3 &ws) const
{
auto wX = (int) ((ws.x + WATER_WORLD_SIZE/2.f) / (WATER_WORLD_SIZE/WATER_HQ_DATA_SIZE));

View File

@ -147,8 +147,6 @@ public:
void loadSplash(const std::string& name);
FileHandle openFile(const std::string& name);
TextureData::Handle findTexture( const std::string& name, const std::string& alpha = "" )
{
return textures[{name, alpha}];

View File

@ -844,7 +844,7 @@ void GameWorld::loadCutscene(const std::string &name)
std::string lowerName(name);
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), ::tolower);
auto datfile = data->openFile(lowerName + ".dat");
auto datfile = data->index.openFile(lowerName + ".dat");
CutsceneData* cutscene = new CutsceneData;

View File

@ -9,7 +9,7 @@ BOOST_AUTO_TEST_SUITE(CutsceneTests)
BOOST_AUTO_TEST_CASE(test_load)
{
{
auto d = Global::get().e->data->openFile("intro.dat");
auto d = Global::get().e->data->index.openFile("intro.dat");
CutsceneTracks tracks;

View File

@ -10,7 +10,7 @@ BOOST_AUTO_TEST_SUITE(LoaderDFFTests)
BOOST_AUTO_TEST_CASE(test_load_dff)
{
{
auto d = Global::get().e->data->openFile("landstal.dff");
auto d = Global::get().e->data->index.openFile("landstal.dff");
LoaderDFF loader;

View File

@ -8,7 +8,7 @@ BOOST_AUTO_TEST_SUITE(RWBStreamTests)
BOOST_AUTO_TEST_CASE(iterate_stream_test)
{
{
auto d = Global::get().e->data->openFile("landstal.dff");
auto d = Global::get().e->data->index.openFile("landstal.dff");
RWBStream stream(d->data, d->length);