<?php/* * dmmotor: the pictures of the game choice screen (assets/launch/<iwad>.png), from each IWAD's TITLEPIC. * php tools/make-launch.php (needs the GD extension) */spl_autoload_register(function (string $class): void { $file = __DIR__ . '/../src/' . str_replace(['App\\', '\\'], ['', '/'], $class) . '.php'; if (is_file($file)) { require $file; }});foreach (['freedoom1', 'freedoom2'] as $id) { $wad = App\Dm\Wad::fromParts(__DIR__ . "/../assets/wads/$id.wad"); $gfx = new App\Dm\Gfx($wad); $fb = new App\Dm\Render\Framebuffer(320, 200); App\Dm\MenuScreen::fullPicture($gfx, $fb, 'TITLEPIC'); $image = imagecreatefromstring($fb->toBmp($gfx->palettes[0])); imagepng($image, __DIR__ . "/../assets/launch/$id.png", 9); echo "assets/launch/$id.png\n";}