, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
nml-0.2.4/docs/changelog.txt0000644000061700006170000000675012036626442016464 0ustar abuildabuild000000000000000.2.4 (2012-10-14)
------------------------------------------------------------------------
- Feature: Report NML line information as well as pixel position for pure white pixels. Also, report number of pixels in the sprite, instead of the whole image. (issue #4029)
- Feature: 'signals' callback for railtypes.
- Feature: Allow the 'nfo' unit to be used with non-constant values. (issue #3828)
- Feature: 'build_prod_change' callback for industries to set industry production level on construction.
- Feature: Constant CB_RESULT_REFIT_COST_MASK
- Feature: Vehicle misc_flag VEHTYPE_FLAG_NO_BREAKDOWN_SMOKE.
- Feature: 'current_max_speed' variable for vehicles. (issue #3979)
- Feature: 'vehicle_is_in_depot' variable for aircraft.
- Feature: 'range' property and callback for aircraft.
- Feature: 'production_rate_1/2' variables for industries.
- Feature: 'town_zone' variable for railtypes.
- Feature: 'other_veh_(curv_info|is_hidden|x_offset|y_offset|z_offset)' variables for vehicles.
- Fix: Provide a proper error message when running out of action2 IDs
- Fix: A '{' at the end of a string could cause a crash
- Fix: Backslash-escapes in strings weren't properly validated. Also remove useless \n escape. (issue #3636)
- Fix: Provide a proper error message if a substring is missing, instead of an assertion error. (issue #3932)
- Fix: 'refit_cost' callback may also be called from the purchase menu.
- Fix: Allow using constants > 255 as variable parameter. (issue #4086)
- Fix: Sprite layout register code contained an unsorted iteration over dictionary keys, resulting in possible regression failures.
0.2.3 (2012-02-19)
------------------------------------------------------------------------
- Feature: Action5 for tunnel portals
- Fix: Properly catch out-of-bounds image reads (issue #3666)
- Fix: Character code 0xA0 (NBSP) is used for an up arrow in TTD, so
don't write it as ascii. Force unicode instead (issue #3643)
0.2.2 (2012-01-29)
------------------------------------------------------------------------
- Feature: support for (optional) url-information in the grf-block
- Feature: names for newly defined cargo classes: CC_POWDERIZED and CC_NEO_BULK
- Feature: clean target to Makefile in main dir and let make clean remove regression/parsetab.py
- Fix: don't crash when a line in custom_tags.txt is missing a colon delimiter
- Fix: each action4 is limited to 255 strings. Write multiple actions when we have more than that
- Fix: groff warning about manpage
- Fix: include buildout.cfg in src distribution and prune regression/nml_output/ (issue #3490)
- Fix: Add NML output for replacenew-block (issue #3450)
- Fix: include nmlc script so regression runs out-of-the-box for source package
- Fix: several files from examples/ were missing in source distributions
- Fix: 'make install' was broken
- Doc: add notice about ZPL in readme.txt
0.2.1 (2011-12-18)
------------------------------------------------------------------------
- Feature: CB_RESULT_NO_MORE_ARTICULATED_PARTS, CB_RESULT_REVERSED_VEHICLE
and CB_RESULT_NO_TEXT as constants to make porting projects to
NML 0.3 easier.
- Fix: Internal error when the ID in a replace-block was not a compile-time constant
- Fix: Crash when referencing a SpriteSetCollection in a graphics-block that was inside an if-block
- Fix: Text files in docs/ were not included in source package
- Doc: Add GPL v2 header to all .py files
0.2.0 (2011-11-20)
------------------------------------------------------------------------
No changelog available for 0.2.0 and earlier.
nml-0.2.4/docs/zpl-2.1.txt0000644000061700006170000000404012036626441015625 0ustar abuildabuild00000000000000ZPL 2.1
Zope Public License (ZPL) Version 2.1
A copyright notice accompanies this license document that identifies the copyright holders.
This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF).
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer.
Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders.
The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders.
If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nml-0.2.4/docs/index.html0000644000061700006170000000123412036626441015760 0ustar abuildabuild00000000000000
NML documentation
The NML documentation has been moved to the following location: http://newgrf-specs.tt-wiki.net/wiki/NML:Main.
You will be redirected in a few seconds, click the link if this doesn't happen (most likely because meta refresh is disabled in your browser).
nml-0.2.4/docs/nmlc.10000644000061700006170000000363512036626442015006 0ustar abuildabuild00000000000000.Dd June 18, 2011
.Dt NMLC 1
.Sh NAME
.Nm NMLC
.Nd A compiler from NML code to NFO and/or GRF files.
.Sh SYNOPSIS
.Nm nmlc
.Op options
.Op file
.Sh OPTIONS
.Bl -tag
.It Fl c
Crop extraneous transparent blue from real sprites.
.It Fl u
Save real sprites uncompressed to GRF files. This saves a lot of time
during encoding but it's not recommended when creating a file for
distribution since it makes the output file substantially bigger.
.It Fl -grf Ns = Ns Ar file
Write output in GRF format to .
.It Fl -nfo Ns = Ns Ar file
Write output in NFO format to .
.It Fl -nml Ns = Ns Ar file
Write output in NML format to .
.It Fl -output Ns = Ns Ar file | Fl o Ar file
Write output to . The output type is detected from the extension
of the filename. It must be one of nfo, nml or grf.
.It Fl -debug | Fl d
Print a dump of the AST to stdout.
.It Fl -help | Fl h
Print usage information.
.It Fl -stack | Fl s
Dump stack when an error occurs
.It Fl -custom-tags Ns = Ns Ar file | Fl t Ar file
Load custom tags from [default: custom_tags.txt]
.It Fl -lang-dir Ns = Ns Ar dir | Fl l Ar dir
Load language files from directory [default: lang]
.It Fl -default-lang Ns = Ns Ar file
The default language is stored in [default: english.lng]
.It Fl -sprites-dir Ns = Ns Ar dir | Fl a Ar dir
Store 32bpp sprites in directory [default: sprites]
.It Fl -start-sprite Ns = Ns Ar file
Set the first sprite number to write (do not use except when you output
nfo that you want to include in other files).
.It Fl -palette Ns = Ns Ar palette | Fl p Ar palette
Force nml to use the palette [default: ANY]. Valid values
are 'DOS', 'WIN', 'ANY'.
.El
.Sh SEE ALSO
The language reference at
.Pa http://hg.openttdcoop.org/nml/raw-file/tip/docs/index.html
.Sh AUTHOR
NML was written by Albert Hofkamp, Jasper Reichardt, Ingo von Borstel,
José Soler and Thijs Marinussen.
.Pp
This manual page was written by Thijs Marinussen.
nml-0.2.4/docs/readme.txt0000644000061700006170000001057012036626442015765 0ustar abuildabuild00000000000000NML readme
Last updated: 2012-10-14
Release version: 0.2.4
------------------------------------------------------------------------
Table of Contents:
------------------
1) About
2) Contact
3) Dependencies
3.1) Required dependencies
3.2) Optional dependencies
4) Installation
5) Usage
6) Known issues
7) Credits
1) About:
-- ------
NML is a a python-based compiler, capable of compiling NML files (along
with their associated language, sound and graphic files) into grf
and / or nfo files.
The documentation about the language can be found on
http://newgrf-specs.tt-wiki.net/wiki/NML:Main
NML is licensed under the GNU General Public License version 2, or at
your option, any later version. For more information, see 'license.txt'
(GPL version 2), or later versions at .
The file bootstrap.py is licensed under Zope Public License (ZPL)
Version 2.1. See zpl-2.1.txt for more information.
2) Contact:
-- --------
Contact can be made via the issue tracker / source repository at
http://dev.openttdcoop.org/projects/nml or via IRC on the
#openttdcoop.devzone channel on OFTC.
3) Dependencies:
-- -------------
3.1) Required dependencies:
---- ----------------------
NML requires the following 3rd party packages to run:
- python
Minimal version is 2.5. Python 3 is not yet supported.
- python image library
downloadable from http://www.pythonware.com/products/pil/
- ply
downloadable from http://www.dabeaz.com/ply/
3.2) Optional dependencies:
---- ----------------------
To install NML you'll need these 3rd party packages:
- buildout
Only necesary if you want to use the installer. You can
run NML without installation or manually install it.
4) Installation:
-- -------------
NML uses buildout for packaging / installation. To install NML run:
python setup.py install
If you want to install the package manually copy 'nmlc' to any directory
in your path and the directory 'nml' to any directory in your python path.
5) Usage:
-- ------
Usage: nmlc [options]
Where is the nml file to parse
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-d, --debug write the AST to stdout
-s, --stack Dump stack when an error occurs
--grf= write the resulting grf to
--nfo= write nfo output to
-M output a rule suitable for make describing the
graphics dependencies of the main grf file (requires
input file or --grf)
--MF= When used with -M, specifies a file to write the
dependencies to
--MT= target of the rule emitted by dependency generation
(requires -M)
-c crop extraneous transparent blue from real sprites
-u save uncompressed data in the grf file
--nml= write optimized nml to
-o , --output=
write output(nfo/grf) to
-t , --custom-tags=
Load custom tags from [default:
custom_tags.txt]
-l , --lang-dir=
Load language files from directory [default:
lang]
-a , --sprites-dir=
Store 32bpp sprites in directory [default:
sprites]
--default-lang=
The default language is stored in [default:
english.lng]
--start-sprite= Set the first sprite number to write (do not use
except when you output nfo that you want to include in
other files)
-p , --palette=
Force nml to use the palette [default: ANY].
Valid values are 'DOS', 'WIN', 'ANY'
6) Known issues:
-- -------------
See the issue tracker at https://dev.openttdcoop.org/projects/nml/issues
7) Credits:
-- --------
Active developers (in alphabetical order):
Jasper Reichardt (Hirundo)
Ingo von Borstel (planetmaker)
José Soler (Terkhen)
Thijs Marinussen (Yexo)
Inactive developers:
Albert Hofkamp (Alberth)
Special thanks to:
Richard Barrell
For writing the buildout script needed to install NML.
nml-0.2.4/bootstrap.py0000644000061700006170000000733712036626441015434 0ustar abuildabuild00000000000000##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Bootstrap a buildout-based project
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
$Id$
"""
import os, shutil, sys, tempfile, urllib2
from optparse import OptionParser
tmpeggs = tempfile.mkdtemp()
is_jython = sys.platform.startswith('java')
# parsing arguments
parser = OptionParser()
parser.add_option("-v", "--version", dest="version",
help="use a specific zc.buildout version")
parser.add_option("-d", "--distribute",
action="store_true", dest="distribute", default=False,
help="Use Disribute rather than Setuptools.")
parser.add_option("-c", None, action="store", dest="config_file",
help=("Specify the path to the buildout configuration "
"file to be used."))
options, args = parser.parse_args()
# if -c was provided, we push it back into args for buildout' main function
if options.config_file is not None:
args += ['-c', options.config_file]
if options.version is not None:
VERSION = '==%s' % options.version
else:
VERSION = ''
USE_DISTRIBUTE = options.distribute
args = args + ['bootstrap']
to_reload = False
try:
import pkg_resources
if not hasattr(pkg_resources, '_distribute'):
to_reload = True
raise ImportError
except ImportError:
ez = {}
if USE_DISTRIBUTE:
exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
else:
exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
if to_reload:
reload(pkg_resources)
else:
import pkg_resources
if sys.platform == 'win32':
def quote(c):
if ' ' in c:
return '"%s"' % c # work around spawn lamosity on windows
else:
return c
else:
def quote (c):
return c
cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set
if USE_DISTRIBUTE:
requirement = 'distribute'
else:
requirement = 'setuptools'
if is_jython:
import subprocess
assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
quote(tmpeggs), 'zc.buildout' + VERSION],
env=dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse(requirement)).location
),
).wait() == 0
else:
assert os.spawnle(
os.P_WAIT, sys.executable, quote (sys.executable),
'-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse(requirement)).location
),
) == 0
ws.add_entry(tmpeggs)
ws.require('zc.buildout' + VERSION)
import zc.buildout.buildout
zc.buildout.buildout.main(args)
shutil.rmtree(tmpeggs)
nml-0.2.4/setup.py0000755000061700006170000000310612036626442014551 0ustar abuildabuild00000000000000#! /usr/bin/env python
import sys, os, string, subprocess
from setuptools import setup
version = sys.version_info
if version[0] < 2 or (version[0] == 2 and version[1] < 5):
sys.exit('ERROR: Sorry, python 2.5 ... < 3.0 is required for this application.')
if version[0] >= 3:
sys.exit('WARNING: Sorry, python 3.0 or later is not yet supported. Some parts may not work.')
# For the purpose of the packet information we only use the numeric code
from nml import version_info
version = version_info.get_and_write_version()
setup(name='nml',
version=version,
description='A tool to compile nml files to grf or nfo files',
long_description = 'A tool to compile nml files to grf and / or nfo files.' \
'NML is a meta-language that aims to be a lot simpler to learn and use than nfo.',
license='GPLv2',
classifiers = ['Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Compilers',
],
packages=['nml', 'nml.actions', 'nml.ast', 'nml.expression'],
url='http://dev.openttdcoop.org/projects/nml',
author='NML Development Team',
author_email='nml-team@openttdcoop.org',
entry_points="""
[console_scripts]
nmlc = nml.main:run
"""
)
nml-0.2.4/setup.cfg0000644000061700006170000000007312036626604014655 0ustar abuildabuild00000000000000[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0