Setup/ImageGen

* consider preconverted png images when initially checking resources
 * fixed minor bugs
This commit is contained in:
Sarjuuk
2024-05-09 15:16:10 +02:00
parent d7fa4a900e
commit 9a1cb5f2f9
3 changed files with 34 additions and 26 deletions

View File

@@ -522,7 +522,7 @@ if (!CLI)
$multiLevel = 0;
do
{
if (!CLISetup::filesInPath('/'.$textureStr.'\/'.$textureStr.($multiLevel + 1).'_\d\.blp/i', true))
if (!CLISetup::filesInPath('/'.$textureStr.'\/'.$textureStr.($multiLevel + 1).'_\d\.(blp|png)/i', true))
break;
$multiLevel++;
@@ -531,8 +531,7 @@ if (!CLI)
while ($multiLevel < 18); // Karazhan has 17 frickin floors
// check if we can create base map anyway
$file = $path.'/'.$textureStr.'1.blp';
$hasBaseMap = CLISetup::fileExists($file);
$hasBaseMap = CLISetup::fileExists($path.'/'.$textureStr.'1.blp') || CLISetup::fileExists($path.'/'.$textureStr.'1.png');
CLI::write(' - area has '.($multiLeveled ? $multiLevel . ' levels' : 'only base level'));
@@ -684,7 +683,7 @@ if (!CLI)
$files = CLISetup::filesInPath('/'.str_replace('/', '\\/', $paths[0x8][2]).'/i', true);
foreach ($files as $f)
{
if (preg_match('/([^\/]+)(\d).blp/i', $f, $m))
if (preg_match('/([^\/]+)(\d).(blp|png)/i', $f, $m))
{
if ($m[1] && $m[2])
{