#!/usr/bin/perl -w
use strict;

sub img_SFLAG_SURFACE() { 0x01 }
sub img_SFLAG_UNDERGROUND { 0x02 }
sub img_SFLAG_ENTRANCE { 0x04 }
sub img_SFLAG_EXPORTED { 0x08 }
sub img_SFLAG_FIXED { 0x10 }
sub img_SFLAG_ANON { 0x20 }
sub img_SFLAG_WALL { 0x40 }

my @tab;
for (0 .. 0x7f) {
    my @f;
    push @f, "LFLAG_SURFACE" if ($_ & img_SFLAG_SURFACE);
    push @f, "LFLAG_UNDERGROUND" if ($_ & img_SFLAG_UNDERGROUND);
    push @f, "LFLAG_ENTRANCE" if ($_ & img_SFLAG_ENTRANCE);
    push @f, "LFLAG_EXPORTED" if ($_ & img_SFLAG_EXPORTED);
    push @f, "LFLAG_FIXED" if ($_ & img_SFLAG_FIXED);
    push @f, "LFLAG_NOT_ANON" unless ($_ & img_SFLAG_ANON);
    push @f, "LFLAG_NOT_WALL" unless ($_ & img_SFLAG_WALL);
    push @f, "0" if @f == 0;
    print "\t".join("|", @f).",\n";
}
