rockbox/apps/plugins/puzzles/desktop.pl
Franklin Wei 1a6a8b52f7 Port of Simon Tatham's Puzzle Collection
Original revision: 5123b1bf68777ffa86e651f178046b26a87cf2d9

MIT Licensed. Some games still crash and others are unplayable due to
issues with controls. Still need a "real" polygon filling algorithm.

Currently builds one plugin per puzzle (about 40 in total, around 100K
each on ARM), but can easily be made to build a single monolithic
overlay (800K or so on ARM).

The following games are at least partially broken for various reasons,
and have been disabled on this commit:

Cube:     failed assertion with "Icosahedron" setting
Keen:     input issues
Mines:    weird stuff happens on target
Palisade: input issues
Solo:     input issues, occasional crash on target
Towers:   input issues
Undead:   input issues
Unequal:  input and drawing issues (concave polys)
Untangle: input issues

Features left to do:
 - In-game help system
 - Figure out the weird bugs

Change-Id: I7c69b6860ab115f973c8d76799502e9bb3d52368
2016-12-18 18:13:22 +01:00

52 lines
1.7 KiB
Perl
Executable file

#!/usr/bin/perl
# Make .desktop files for the puzzles.
#
# At present, this script is intended for developer usage: if you're
# working on the puzzles and want to play your bleeding-edge locally
# modified and compiled versions, run this script and it will create a
# collection of desktop files in ~/.local/share/applications where
# XFCE can pick them up and add them to its main menu. (Be sure to run
# 'xfdesktop --reload' after running this.)
#
# (If you don't use XFCE, patches to support other desktop
# environments are welcome :-)
use strict;
use warnings;
use Cwd 'abs_path';
die "usage: desktop.pl [<outdir> [<bindir> <icondir>]]\n"
unless @ARGV == 0 or @ARGV == 1 or @ARGV == 3;
my ($outdir, $bindir, $icondir) = @ARGV;
$outdir = $ENV{'HOME'}."/.local/share/applications" unless defined $outdir;
$bindir = "." unless defined $bindir;
$icondir = "./icons" unless defined $icondir;
$bindir = abs_path($bindir);
$icondir = abs_path($icondir);
open my $desc, "<", "gamedesc.txt"
or die "gamedesc.txt: open: $!\n";
while (<$desc>) {
chomp;
my ($id, $win, $displayname, $description, $summary) = split /:/, $_;
open my $desktop, ">", "$outdir/$id.desktop"
or die "$outdir/$id.desktop: open: $!\n";
print $desktop "[Desktop Entry]\n";
print $desktop "Version=1.0\n";
print $desktop "Type=Application\n";
print $desktop "Name=$displayname\n";
print $desktop "Comment=$description\n";
print $desktop "Exec=$bindir/$id\n";
print $desktop "Icon=$icondir/$id-48d24.png\n";
print $desktop "StartupNotify=false\n";
print $desktop "Categories=Game;\n";
print $desktop "Terminal=false\n";
close $desktop
or die "$outdir/$id.desktop: close: $!\n";
}