} /* * All done; save map to disk, then generate a new JavaScript list * of available maps which includes the new map, and finally output * the map which was saved. */ $filename = Game::mapFilename($Game->id, $turn); if (HIDEMOVES) { $filename = str_replace(".map", "-hideMoves.map", $filename); } if (defined('DATC') && $mapType != 'small') { $drawMap->saveThumbnail($filename . '-thumb'); } // colorCorrect Patch if (COLORCORRECT) { $filename = str_replace(".map", "-" . COLORCORRECT . ".map", $filename); $drawMap->colorEnhance(COLORCORRECT); } // End colorCorrect Patch // Add countrynames for colorblind: if (COUNTRYNAMES) { $filename = str_replace(".map", "-names.map", $filename); } if (PREVIEW) { $drawMap->writeToBrowser(); } else { $drawMap->write($filename); libHTML::serveImage($filename); } unset($drawMap); // $drawMap is memory intensive and should be freed as soon as no longer needed