1
0
forked from mirrors/0ad

Fix biome-specific mappreviews in 7f602037ba for zipped mods, refs #4962.

Add TextureExists to avoid needless redundant hardcoding of the
filenames.
Remove mapBiome.Preview from gamedescription.js, obsolete following
8cde469501.

Differential Revision: https://code.wildfiregames.com/D1583
Accepted By: Vladislav
This was SVN commit r21859.
This commit is contained in:
elexis
2018-08-05 21:50:00 +00:00
parent 2af94c5898
commit f7783fb4bb
8 changed files with 51 additions and 15 deletions
+12 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2015 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -316,6 +316,12 @@ public:
m_TextureConverter.ConvertTexture(texture, sourcePath, looseCachePath, settings);
}
bool TextureExists(const VfsPath& path) const
{
return m_VFS->GetFileInfo(m_CacheLoader.ArchiveCachePath(path), 0) == INFO::OK ||
m_VFS->GetFileInfo(path, 0) == INFO::OK;
}
bool GenerateCachedTexture(const VfsPath& sourcePath, VfsPath& archiveCachePath)
{
archiveCachePath = m_CacheLoader.ArchiveCachePath(sourcePath);
@@ -653,6 +659,11 @@ CTexturePtr CTextureManager::CreateTexture(const CTextureProperties& props)
return m->CreateTexture(props);
}
bool CTextureManager::TextureExists(const VfsPath& path) const
{
return m->TextureExists(path);
}
CTexturePtr CTextureManager::GetErrorTexture()
{
return m->GetErrorTexture();