-
Reorganize base sprite/action hierarchy so it better reflects newgrf structure. Also rename classes to use common terms rather than grf-specific ones (real/pseudo sprite).
- Rename
BaseSprite
toAction
. - Rename
IntermediateSprite
toFakeAction
. - Rename
RealSprite
toResourceAction
. - Add new base class
Resource
that resources now inherit instead ofRealSprite
. - Make
ResourceAction
andAlternativeSprites
containers for theResource
objects. - Rename
SoundSprite
toSound
. - Rename
GraphicsSprite
toSprite
. - Rename
EmptyGraphicsSprite
toEmptySprite
. - Remove
LazyAciton
andAction.get_data_size
as no longer necessary.
- Rename
-
Fix auto-assigned IDs overlapping when adding vehicles.
-
Fix encoding of label lists in Action0 properties.
-
Fix encoding and decoding of Action 5.
-
Fix
min_life
Action0 property size for houses (spec error). -
Fix
Switch
code using wrong feature for related scope. -
Fix
Switch
code grammar issues. -
Fix alpha generation when using colourkey.
-
Fix encoding of
min_bridge_height
Action 0 station property (#33). -
Fix imageSprite conversion for non-P and non-RGBA images (#43).
-
Add sprite cache.
-
Optimize memory usage when writing NewGRF.
-
Optimize grf file size by removing duplicate sprites (by data).
-
Allow defining named temporary variables in
Switch
code. -
Rename zoom constants to use natural/nml order:
ZOOM_4X
->ZOOM_2X
->ZOOM_NORMAL
->ZOOM_OUT_2X
->ZOOM_OUT_4X
->ZOOM_OUT_8X
. -
Rename
PALETTE
toPIL_PALETTE
, addPALETTE
as a list of (r, g, b) tuples. -
Add
OKLAB_PALETTE
,NP_PALETTE
,PALETTE_IDX
constants. -
Add
srgb_to_linear
,linear_to_srgb
,srgb_to_oklab
,oklab_to_srgb
colour conversion functions. -
Add
mode
argument toMask
with option to overdraw sprite. -
Add
ShipFlags
enum. -
Support extended format in Action 1.
-
Support ids > 255 in Action 3 (#42).
-
Add
main
function to handle command line arguments. -
Add support for road stop feature (#44).
-
Add some VarAction2 variables for houses.
-
Add
station_name
andstation_class_name
Action 0 properties for stations. -
Add
TTDString
andTTDIndustry
constants. -
Add
TownGrowthEffect
constants. -
Add
Eval
as a version ofSwitch
without ranges. -
Add
subroutines
argument toSwitch
and allowname()
call syntax. -
Add
debug_zoom_levels
argument toBaseNewGRF.write
to recolour sprites according to their zoom level: 4x - red, 2x - blue, 1x - green, out-2x - cyan, out-4x - yellow, out-8x - magenta. -
Add
--debug-zoom-levels
command line argument tobuild
command ofmain
function. -
Add
WithMask
sprite class to add mask layer to images. -
Add
SpriteWrapper
class to simplify writing sprite modifiers. -
Add
MoveSprite
modifier to change sprite offsets. -
Support using StringRef in Action 0x14 (
SetProperties
). -
Support using StringRef as
NewGRF
name
anddescription
. -
Support encoding of bridge layouts.
-
Support encoding of industry layouts.
-
Support encoding of tile acceptance lists for houses and industry tiles.
-
Support expressions for register value in PERM and TEMP access.
-
Support parameter expressions for vars60+ in
Switch
code (via var7b). -
Support cropping 24bpp sprites.
-
Add
preferred_blitter
argument toNewGRF
constructor, possible valuesNewGRF.BLITTER_BPP_8
andNewGRF.BLITTER_BPP_32
. -
Add
StringManager.get_persistent_id
function to register strings in "persistent" range (0xDCxx). -
Add
Sprite.save_gif
method to generate palette animated images. -
Add
Sprite.make_rgba_image
method to generate static PILImage
. -
Add init_id_map command line command to initialize id_map.json.
-
Add
Date
type to represent dates that don't fit intodatetime.date
. -
Add example of a simple eyecandy station.
-
Start auto-assiged IDs from 0 for INDUSTRY_TILE feature.
-
Rename
AlternativeSprites.get_zoom
toget_sprite
and add bpp argument. -
Rename some of the Action0 properties for
CARGO
to match nml. -
Don't write redundant actions for railtypes without fallbacks in railtype table.
-
Return cargo type ids in
NewGRF.set_cargo_table
. -
Remove all uses of spectra in favour of own colour submodule using OKLAB colour space.
-
Only replace .grf file when build succeeded.
-
lib: Fix
CallbackManager.make_switches
for non-vehicle features. -
lib: Fix incorrect 2cc colors for auto-articulated parts.
-
lib: Fix unicode vehicle names.
-
lib: Don't change callbacks passed to
CallbackMananger
. -
lib: Set correct flags and track_type on auto-articulated parts.
-
lib: Fix auto-articulation for vehicles without liveries.
-
lib: Fix: Make station availability a purchase callback.
-
lib: Add high-level
Industry
class. -
lib:
CallbackManager
rewrite:- Support all features (non-vehicles may still be incomplete).
- Make
CallbackManager
abstract class, usemake_callback_manager
function instead. - Support splitting callbacks for default and purchase branch with
DualCallback
. - Use
graphics.purchase
instead ofpurchase_graphics
attribute.
-
lib: Add
Ship.Flags
andRoadVehicle.Flags
for unified access to flags. -
lib: Add
EngineOverride
sprite generator. -
lib: Add
reverse_build_probability
vehicle callback. -
lib: Allow omitting
ids
inDisableDefault
to disable all items. -
lib: Support
HOUSE
,INDUSTRY
andCARGO
features inDisableDefault
. -
lib: Add
chunk_size
parameter tocombine_ranges
. -
grftopy: Fix missing sprite zoom
-
grftopy: Improve decoding of industry layouts.
-
grftopy: Fix decompilation of ActionB.
-
grftopy: Fix decompilation of action 7/9 with value > 4 bytes.
-
grftopy: Add -p/--palette cli option to set output palette for 8bpp images.
-
grftopy: Decompile
cargo_(dis)allow_refit
properties as a tuple of cargo indexes. -
dev: Add new
dev
submodule for extending newgrf spec support. -
dev: Add
dev.add_feature
function.