Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nml for openSUSE:Factory checked in at 2022-12-12 17:39:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nml (Old) and /work/SRC/openSUSE:Factory/.nml.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nml" Mon Dec 12 17:39:30 2022 rev:20 rq:1042221 version:0.7.1 Changes: -------- --- /work/SRC/openSUSE:Factory/nml/nml.changes 2022-11-16 15:43:49.415931855 +0100 +++ /work/SRC/openSUSE:Factory/.nml.new.1835/nml.changes 2022-12-12 17:41:33.445745013 +0100 @@ -1,0 +2,16 @@ +Sun Dec 11 18:17:20 UTC 2022 - Dirk Müller <dmuel...@suse.com> + +- update to 0.7.1: + * Fix action0properties.py + * Minor improvements to examples + * Change: use an array of cargoes for cargo_random_triggers + * Change: disabled_platforms/length is now bitmask(1-8)>>1 + * Change: replace nearby_tile_platform_type with nearby_tile_tile_type. + * Fix: Station animation triggers every 250 ticks, not 256. + * Fix #256: Objects have a 'colour' in var 47. + * Change: allow any expression for station (purchase_)prepare_layout + * Update: changelog for 0.7.1 + * Fix: [Actions] release workflow issues + * More issues in release workflow + +------------------------------------------------------------------- Old: ---- nml-0.7.0.tar.gz New: ---- nml-0.7.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nml.spec ++++++ --- /var/tmp/diff_new_pack.sMM2d6/_old 2022-12-12 17:41:34.553751244 +0100 +++ /var/tmp/diff_new_pack.sMM2d6/_new 2022-12-12 17:41:34.561751289 +0100 @@ -17,7 +17,7 @@ Name: nml -Version: 0.7.0 +Version: 0.7.1 Release: 0 Summary: NewGRF Meta Language License: GPL-2.0-or-later ++++++ nml-0.7.0.tar.gz -> nml-0.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/PKG-INFO new/nml-0.7.1/PKG-INFO --- old/nml-0.7.0/PKG-INFO 2022-08-29 21:39:56.014056700 +0200 +++ new/nml-0.7.1/PKG-INFO 2022-12-03 23:04:11.822486400 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: nml -Version: 0.7.0 +Version: 0.7.1 Summary: An OpenTTD NewGRF compiler for the nml language Home-page: https://github.com/OpenTTD/nml Author: NML Development Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/docs/changelog.txt new/nml-0.7.1/docs/changelog.txt --- old/nml-0.7.0/docs/changelog.txt 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/docs/changelog.txt 2022-12-03 23:03:42.000000000 +0100 @@ -1,3 +1,21 @@ +0.7.1 (2022-12-03) +------------------------------------------------------------------------ +While writing documentation for stations, we made some small changes to the syntax. + +Stations changes: +- Codechange: always use intermediate registers for station sprite layouts +- Change: allow any expression for station (purchase_)prepare_layout +- Fix: Station animation triggers every 250 ticks, not 256. (#266) +- Change: replace nearby_tile_platform_type with nearby_tile_tile_type. (#265) +- Change: disabled_platforms/length is now bitmask(1-8) (#264) +- Change: use an array of cargoes for cargo_random_triggers (#263) +- Fix 16eb0035: disabled_platforms and disabled_length properties used a wrong number + +Other changes and fixes: +- Fix #256: Objects have a 'colour' in var 47. (#267) +- Fix: Versioning of NewGRF is supposed to start at 1. + + 0.7.0 (2022-08-29) ------------------------------------------------------------------------ This release adds the long awaited support for stations. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/industry/example_industry.nml new/nml-0.7.1/examples/industry/example_industry.nml --- old/nml-0.7.0/examples/industry/example_industry.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/industry/example_industry.nml 2022-12-03 23:03:42.000000000 +0100 @@ -27,14 +27,15 @@ grfid : "NML\04"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); - version : 0; // must be numeric - min_compatible_version : 0; + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; } /* this example assumes we're just matching to the default temperate cargos, this wouldn't be the usual case */ cargotable { - PASS, COAL, MAIL, OIL_, LVST, GOOD, GRAI, WOOD, IORE, STEL, VALU + PASS, COAL, MAIL, OIL_, LVST, GOOD, GRAI, WOOD, IORE, STEL, VALU } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/object/example_object.nml new/nml-0.7.1/examples/object/example_object.nml --- old/nml-0.7.0/examples/object/example_object.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/object/example_object.nml 2022-12-03 23:03:42.000000000 +0100 @@ -21,26 +21,26 @@ /* This grf is part of NML, therefore "NML" is chosen as the first three * characters of the GRFID. It is the second real grf defined as part of * NML (the first is the train example), therefore the last character is - * set to 1. Successive grfs will have 2, 3, etc. there, to make sure each - * example grf has a unique GRFID. + * set to 1. Successive grfs will have 2, 3, etc. there, to make sure each + * example grf has a unique GRFID. */ grfid: "NML\01"; /* GRF name and description strings are defined in the lang files */ name: string(STR_GRF_NAME); desc: string(STR_GRF_DESCRIPTION); - /* This is the first version, start numbering at 0. */ - version: 0; - min_compatible_version: 0; - /* This NewGRF has no parameters. See the train example NewGRF for parameter - * usage - */ + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; + /* This NewGRF has no parameters. See the train example NewGRF for parameter + * usage + */ } /* Using parametrized sprite layouts are only valid in OpenTTD r22723 or later. * Earlier versions will choke on those and otherwise disable the NewGRF. */ if (version_openttd(1,2,0,22723) > openttd_version) { - error(FATAL, REQUIRES_OPENTTD, string(STR_VERSION_22723)); + error(FATAL, REQUIRES_OPENTTD, string(STR_VERSION_22723)); } @@ -75,80 +75,80 @@ spriteset (cc_frame, "cc_grid.png") { tmpl_groundsprites(1, 1) } spritelayout company_land_layout { - ground { - /* normal ground sprite - always draw */ - sprite: LOAD_TEMP(0) + LOAD_TEMP(1); - } - childsprite { - /* company-coloured border - always draw */ - sprite: cc_frame(LOAD_TEMP(0)); - always_draw: 1; - recolour_mode: RECOLOUR_REMAP; - palette: PALETTE_USE_DEFAULT; - } - childsprite { - /* again the normal ground sprite. Thus in non-transparent view - * only the normal ground sprite is shown. In transparent view - * this acts as sprite which darkens the other two sprites via - * a translation to transparency. - */ - sprite: LOAD_TEMP(0) + LOAD_TEMP(1); - } + ground { + /* normal ground sprite - always draw */ + sprite: LOAD_TEMP(0) + LOAD_TEMP(1); + } + childsprite { + /* company-coloured border - always draw */ + sprite: cc_frame(LOAD_TEMP(0)); + always_draw: 1; + recolour_mode: RECOLOUR_REMAP; + palette: PALETTE_USE_DEFAULT; + } + childsprite { + /* again the normal ground sprite. Thus in non-transparent view + * only the normal ground sprite is shown. In transparent view + * this acts as sprite which darkens the other two sprites via + * a translation to transparency. + */ + sprite: LOAD_TEMP(0) + LOAD_TEMP(1); + } } /* A pseudo-switch which sets the temporary parameters for the sprite layout */ switch (FEAT_OBJECTS, SELF, company_land_terrain_switch, [ - /* We store the offset into the spriteset due to the tile slope into the 1st temporary variable - * (= storage register 0) - */ - STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), - - /* We store the offset to the flat groundsprite we use into the 2nd temporary variable - * (= storage register 1) - */ - STORE_TEMP(GROUNDSPRITE_NORMAL, 1), - STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), - STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), - ]) { - company_land_layout; + /* We store the offset into the spriteset due to the tile slope into the 1st temporary variable + * (= storage register 0) + */ + STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), + + /* We store the offset to the flat groundsprite we use into the 2nd temporary variable + * (= storage register 1) + */ + STORE_TEMP(GROUNDSPRITE_NORMAL, 1), + STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), + STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), + ]) { + company_land_layout; } /* Pseudo switch for the purchase list branch: we want to display the flat ground tile */ switch (FEAT_OBJECTS, SELF, company_land_purchase_switch, [ - STORE_TEMP(0, 0), - STORE_TEMP(GROUNDSPRITE_NORMAL, 1), + STORE_TEMP(0, 0), + STORE_TEMP(GROUNDSPRITE_NORMAL, 1), - 1 - ]) { - company_land_layout; + 1 + ]) { + company_land_layout; } /* Define the object itself */ item(FEAT_OBJECTS, company_land) { - property { - /* The class allows to sort objects into categories. This is 'infrastructure' */ - class: "INFR"; - /* If no other NewGRF provides this class before us, we have to name it */ - classname: string(STR_NAME_OBJCLASS_INFRASTRUCTURE); - /* Name of this particular object */ - name: string(STR_NAME_COMPANY_LAND); - climates_available: ALL_CLIMATES; - size: [1, 1]; - build_cost_multiplier: 1; - remove_cost_multiplier: 1; - introduction_date: date(1,1,1); // available from day 1 - end_of_life_date: date(10000,1,1); // available till year 10000 - /* Anything can overbuild the object, removing returns the money, we don't want foundations and we want to allow bridges */ - object_flags: bitmask(OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME, OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE); - height: 0; // it's only a ground tile - num_views: 1; - } - graphics { - purchase: company_land_purchase_switch; - // Allow placement on any land tile (the default prevents building on 'steep' slopes). - // The object cannot be placed on water despite this, because OBJ_FLAG_ON_WATER isn't set. - tile_check: return CB_RESULT_LOCATION_ALLOW; - additional_text: return string(STR_NAME_COMPANY_LAND); - company_land_terrain_switch; - } + property { + /* The class allows to sort objects into categories. This is 'infrastructure' */ + class: "INFR"; + /* If no other NewGRF provides this class before us, we have to name it */ + classname: string(STR_NAME_OBJCLASS_INFRASTRUCTURE); + /* Name of this particular object */ + name: string(STR_NAME_COMPANY_LAND); + climates_available: ALL_CLIMATES; + size: [1, 1]; + build_cost_multiplier: 1; + remove_cost_multiplier: 1; + introduction_date: date(1,1,1); // available from day 1 + end_of_life_date: date(10000,1,1); // available till year 10000 + /* Anything can overbuild the object, removing returns the money, we don't want foundations and we want to allow bridges */ + object_flags: bitmask(OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME, OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE); + height: 0; // it's only a ground tile + num_views: 1; + } + graphics { + purchase: company_land_purchase_switch; + // Allow placement on any land tile (the default prevents building on 'steep' slopes). + // The object cannot be placed on water despite this, because OBJ_FLAG_ON_WATER isn't set. + tile_check: return CB_RESULT_LOCATION_ALLOW; + additional_text: return string(STR_NAME_COMPANY_LAND); + company_land_terrain_switch; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/railtype/example_railtype.nml new/nml-0.7.1/examples/railtype/example_railtype.nml --- old/nml-0.7.0/examples/railtype/example_railtype.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/railtype/example_railtype.nml 2022-12-03 23:03:42.000000000 +0100 @@ -12,7 +12,7 @@ * graphics and snow support has been removed to keep this example within * reasonable size. Due to the large quantity of sprites required for a * railtype grf, the number of lines of code is still relatively high. - * + * * All real sprites have been templated, even if the template is used only * once. This allows adding e.g. snowed graphics fairly easily. * @@ -39,8 +39,9 @@ grfid : "NML\02"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); - version : 0; // must be numeric - min_compatible_version : 0; + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; } /* Check for NuTracks and disable, if we're not active _after_ NuTracks */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/road_vehicle/example_road_vehicle.nml new/nml-0.7.1/examples/road_vehicle/example_road_vehicle.nml --- old/nml-0.7.0/examples/road_vehicle/example_road_vehicle.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/road_vehicle/example_road_vehicle.nml 2022-12-03 23:03:42.000000000 +0100 @@ -34,9 +34,9 @@ /* GRF name and description strings are defined in the lang files */ name: string(STR_GRF_NAME); desc: string(STR_GRF_DESC); - /* This is the first version, start numbering at 0. */ - version: 0; - min_compatible_version: 0; + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; } /* Check for engine pool */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/roadtype_and_tramtype/example_roadtype_and_tramtype.nml new/nml-0.7.1/examples/roadtype_and_tramtype/example_roadtype_and_tramtype.nml --- old/nml-0.7.0/examples/roadtype_and_tramtype/example_roadtype_and_tramtype.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/roadtype_and_tramtype/example_roadtype_and_tramtype.nml 2022-12-03 23:03:42.000000000 +0100 @@ -21,8 +21,9 @@ grfid : "NML\04"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); - version : 0; // must be numeric - min_compatible_version : 0; + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; } /* Default ground tile template (re-use as needed) */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/station/example_station.nml new/nml-0.7.1/examples/station/example_station.nml --- old/nml-0.7.0/examples/station/example_station.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/station/example_station.nml 2022-12-03 23:03:42.000000000 +0100 @@ -19,104 +19,104 @@ /* This grf is part of NML, therefore "NML" is chosen as the first three * characters of the GRFID. It is the seventh real grf defined as part of * NML (the first is the train example), therefore the last character is - * set to 6. Successive grfs will have 7, 8, etc. there, to make sure each - * example grf has a unique GRFID. + * set to 6. Successive grfs will have 7, 8, etc. there, to make sure each + * example grf has a unique GRFID. */ grfid: "NML\06"; /* GRF name and description strings are defined in the lang files */ name: string(STR_GRF_NAME); desc: string(STR_GRF_DESCRIPTION); - /* This is the first version, start numbering at 0. */ - version: 0; - min_compatible_version: 0; - /* This NewGRF has no parameters. See the train example NewGRF for parameter - * usage - */ + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; + /* This NewGRF has no parameters. See the train example NewGRF for parameter + * usage + */ } /* Using parametrized sprite layouts are only valid in OpenTTD r22723 or later. * Earlier versions will choke on those and otherwise disable the NewGRF. */ if (version_openttd(1,2,0,22723) > openttd_version) { - error(FATAL, REQUIRES_OPENTTD, string(STR_VERSION_22723)); + error(FATAL, REQUIRES_OPENTTD, string(STR_VERSION_22723)); } cargotable { - LVST + LVST } spriteset (cow_pen_empty, "cows_cargo.png") { - [ 10, 10, 64, 65, -31, -34 ] - [ 220, 10, 64, 65, -31, -34 ] + [ 10, 10, 64, 65, -31, -34 ] + [ 220, 10, 64, 65, -31, -34 ] } spriteset (cow_pen_half, "cows_cargo.png") { - [ 80, 10, 64, 65, -31, -34 ] - [ 290, 10, 64, 65, -31, -34 ] + [ 80, 10, 64, 65, -31, -34 ] + [ 290, 10, 64, 65, -31, -34 ] } spriteset (cow_pen_full, "cows_cargo.png") { - [ 150, 10, 64, 65, -31, -34 ] - [ 360, 10, 64, 65, -31, -34 ] + [ 150, 10, 64, 65, -31, -34 ] + [ 360, 10, 64, 65, -31, -34 ] } spritelayout cow_pen_X(a) { - ground { - sprite: 2022 + a; // prevent railtype offset - } - building { - sprite: DEFAULT(0); // first sprite in active spriteset - zextent: 36; - recolour_mode: RECOLOUR_REMAP; - palette: PALETTE_USE_DEFAULT; - } + ground { + sprite: 2022 + a; // prevent railtype offset + } + building { + sprite: DEFAULT(0); // first sprite in active spriteset + zextent: 36; + recolour_mode: RECOLOUR_REMAP; + palette: PALETTE_USE_DEFAULT; + } } spritelayout cow_pen_Y(a) { - ground { - sprite: 2022 + a; // prevent railtype offset - } - building { - sprite: DEFAULT(1); // second sprite in active spriteset - zextent: 36; - recolour_mode: RECOLOUR_REMAP; - palette: PALETTE_USE_DEFAULT; - } + ground { + sprite: 2022 + a; // prevent railtype offset + } + building { + sprite: DEFAULT(1); // second sprite in active spriteset + zextent: 36; + recolour_mode: RECOLOUR_REMAP; + palette: PALETTE_USE_DEFAULT; + } } spritegroup cow_pen_1 { - little: [cow_pen_empty, cow_pen_half]; - lots: cow_pen_full; + little: [cow_pen_empty, cow_pen_half]; + lots: cow_pen_full; } spritegroup cow_pen_2 { - little: [cow_pen_empty, cow_pen_half, cow_pen_full]; - lots: cow_pen_full; + little: [cow_pen_empty, cow_pen_half, cow_pen_full]; + lots: cow_pen_full; } random_switch(FEAT_STATIONS, TILE, random_cow_pen) { - 1: cow_pen_1; - 1: cow_pen_2; + 1: cow_pen_1; + 1: cow_pen_2; } /* Define the station itself */ item(FEAT_STATIONS, cow_pen) { - property { - /* The class allows to sort stations into categories. */ - class: "NML_"; - /* If no other NewGRF provides this class before us, we have to name it */ - classname: string(STR_NAME_STATCLASS); - /* Name of this particular station */ - name: string(STR_NAME_STATION); - cargo_threshold: 160; - draw_pylon_tiles: 0; - hide_wire_tiles: 0xFF; - non_traversable_tiles: 0xFF; - } - graphics { - sprite_layouts: [cow_pen_X(0), cow_pen_Y(0)]; - purchase: cow_pen_half; - LVST: random_cow_pen; - cow_pen_empty; - } + property { + /* The class allows to sort stations into categories. */ + class: "NML_"; + /* If no other NewGRF provides this class before us, we have to name it */ + classname: string(STR_NAME_STATCLASS); + /* Name of this particular station */ + name: string(STR_NAME_STATION); + cargo_threshold: 160; + draw_pylon_tiles: 0; + hide_wire_tiles: 0xFF; + non_traversable_tiles: 0xFF; + } + graphics { + sprite_layouts: [cow_pen_X(0), cow_pen_Y(0)]; + purchase: cow_pen_half; + LVST: random_cow_pen; + cow_pen_empty; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/examples/train/example_train.nml new/nml-0.7.1/examples/train/example_train.nml --- old/nml-0.7.0/examples/train/example_train.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/examples/train/example_train.nml 2022-12-03 23:03:42.000000000 +0100 @@ -39,9 +39,9 @@ /* GRF name and description strings are defined in the lang files */ name: string(STR_GRF_NAME); desc: string(STR_GRF_DESC); - /* This is the first version, start numbering at 0. */ - version: 0; - min_compatible_version: 0; + /* This is the first version, start numbering at 1. */ + version: 1; + min_compatible_version: 1; /* Define user-configurable parameters */ param { @@ -308,11 +308,11 @@ * Earlier versions will choke on those and otherwise disable the NewGRF. */ if (version_openttd(1,2,0,22713) < openttd_version) { - item(FEAT_TRAINS, icm) { - property { - cargo_age_period: 185; // default value - } - } + item(FEAT_TRAINS, icm) { + property { + cargo_age_period: 185; // default value + } + } } /* ------------------ Cargo Wagons Example ------------------ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/__version__.py new/nml-0.7.1/nml/__version__.py --- old/nml-0.7.0/nml/__version__.py 2022-08-29 21:39:54.000000000 +0200 +++ new/nml-0.7.1/nml/__version__.py 2022-12-03 23:04:11.000000000 +0100 @@ -1,2 +1,2 @@ # this file is autogenerated by setup.py -version = "0.7.0" +version = "0.7.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/actions/action0properties.py new/nml-0.7.1/nml/actions/action0properties.py --- old/nml-0.7.0/nml/actions/action0properties.py 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/nml/actions/action0properties.py 2022-12-03 23:03:42.000000000 +0100 @@ -19,6 +19,7 @@ from nml.expression import ( AcceptCargo, Array, + BitMask, ConstantFloat, ConstantNumeric, Identifier, @@ -655,6 +656,12 @@ # +def station_platforms_length(value): + # Writing bitmask(2) to disable platform/length 3 is not very intuitive. + # Instead we expect the user will write bitmask(3) and we shift the result. + return nmlop.SHIFT_RIGHT(value, 1, value.pos).reduce() + + def station_flags(value): # bit 4 (extended foundations) can't be set without bit 3 (custom foundations) cust_found = nmlop.SHIFT_RIGHT(value, 4, value.pos) @@ -663,19 +670,25 @@ return nmlop.OR(value, cust_found).reduce() +def cargo_bitmask(value): + if not isinstance(value, Array): + raise generic.ScriptError("Cargo list must be an array", value.pos) + return BitMask(value.values, value.pos).reduce() + + # fmt: off properties[0x04] = { "class": {"size": 4, "num": 0x08, "first": None, "string_literal": 4}, # 09 (sprite layout) is implemented elsewhere # 0A (copy sprite layout) is implemented elsewhere # 0B (callback flags) is not set by user - "disabled_platforms": {"size": 1, "num": 0x0B}, - "disabled_length": {"size": 1, "num": 0x0C}, + "disabled_platforms": {"size": 1, "num": 0x0C, "value_function": station_platforms_length}, + "disabled_length": {"size": 1, "num": 0x0D, "value_function": station_platforms_length}, # 0E (station layout) callback 24 should be enough # 0F (copy station layout) "cargo_threshold": {"size": 2, "num": 0x10}, "draw_pylon_tiles": {"size": 1, "num": 0x11}, - "cargo_random_triggers": {"size": 4, "num": 0x12}, + "cargo_random_triggers": {"size": 4, "num": 0x12, "value_function": cargo_bitmask}, "general_flags": {"size": 1, "num": 0x13, "value_function": station_flags}, "hide_wire_tiles": {"size": 1, "num": 0x14}, "non_traversable_tiles": {"size": 1, "num": 0x15}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/actions/action2layout.py new/nml-0.7.1/nml/actions/action2layout.py --- old/nml-0.7.0/nml/actions/action2layout.py 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/nml/actions/action2layout.py 2022-12-03 23:03:42.000000000 +0100 @@ -208,7 +208,9 @@ def create_register(self, name, value): if ( - isinstance(value, expression.StorageOp) + # Always copy values from "prepare_layout" into new registers, to prevent "default" from modifying them. + self.feature != 0x04 + and isinstance(value, expression.StorageOp) and value.name == "LOAD_TEMP" and isinstance(value.register, expression.ConstantNumeric) ): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/actions/action2var_variables.py new/nml-0.7.1/nml/actions/action2var_variables.py --- old/nml-0.7.0/nml/actions/action2var_variables.py 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/nml/actions/action2var_variables.py 2022-12-03 23:03:42.000000000 +0100 @@ -358,7 +358,7 @@ 'nearby_tile_original_gfx' : {'var': 0x68, 'start': 8, 'size': 2, 'param_function': signed_tile_offset, 'value_function': value_equals(2)}, 'nearby_tile_same_station' : {'var': 0x68, 'start': 10, 'size': 1, 'param_function': signed_tile_offset}, 'nearby_tile_perpendicular' : {'var': 0x68, 'start': 11, 'size': 1, 'param_function': signed_tile_offset}, - 'nearby_tile_platform_type' : {'var': 0x68, 'start': 12, 'size': 2, 'param_function': signed_tile_offset}, + 'nearby_tile_tile_type' : {'var': 0x68, 'start': 11, 'size': 3, 'param_function': signed_tile_offset}, 'nearby_tile_grfid' : {'var': 0x6A, 'start': 0, 'size': 32, 'param_function': signed_tile_offset}, # 'var' will be set in the value_function, depending on parameter 'platform_length' : {'var': 0x00, 'start': 16, 'size': 4, 'param_function': platform_info_param, 'value_function': platform_info_fix_var}, @@ -655,16 +655,14 @@ 'tile_slope' : {'var': 0x41, 'start': 8, 'size': 5}, 'build_date' : {'var': 0x42, 'start': 0, 'size': 32}, - 'animation_frame' : {'var': 0x43, 'start': 0, 'size': 8}, - 'company_colour' : {'var': 0x43, 'start': 0, 'size': 8}, - 'owner' : {'var': 0x44, 'start': 0, 'size': 8}, 'town_manhattan_dist' : {'var': 0x45, 'start': 0, 'size': 16}, 'town_zone' : {'var': 0x45, 'start': 16, 'size': 8}, 'town_euclidean_dist' : {'var': 0x46, 'start': 0, 'size': 16}, + 'colour' : {'var': 0x47, 'start': 0, 'size': 8}, 'view' : {'var': 0x48, 'start': 0, 'size': 8}, 'random_bits' : {'var': 0x5F, 'start': 8, 'size': 8}, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/actions/action3.py new/nml-0.7.1/nml/actions/action3.py --- old/nml-0.7.0/nml/actions/action3.py 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/nml/actions/action3.py 2022-12-03 23:03:42.000000000 +0100 @@ -423,10 +423,15 @@ varact2parser = action2var.Varaction2Parser(feature) # Prepare registers for sprite layout if cargo == 0xFF and purchase_prepare_layout: - varact2parser.parse(purchase_prepare_layout) + varact2parser.parse_expr(purchase_prepare_layout) varact2parser.var_list.append(nmlop.VAL2) varact2parser.var_list_size += 1 elif prepare_layout: + if not isinstance(prepare_layout, expression.SpriteGroupRef): + actions, prepare_layout = action2var.create_return_action( + prepare_layout, feature, "Station Layout@prepare - Id {:02X}".format(id.value), 0x89 + ) + prepend_action_list.extend(actions) varact2parser.parse(prepare_layout) varact2parser.var_list.append(nmlop.VAL2) varact2parser.var_list_size += 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml/global_constants.py new/nml-0.7.1/nml/global_constants.py --- old/nml-0.7.0/nml/global_constants.py 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/nml/global_constants.py 2022-12-03 23:03:42.000000000 +0100 @@ -374,7 +374,7 @@ "STAT_ANIM_TRAIN_ENTERS" : 3, "STAT_ANIM_TRAIN_LEAVES" : 4, "STAT_ANIM_TRAIN_LOAD_UNLOAD" : 5, - "STAT_ANIM_256_TICKS" : 6, + "STAT_ANIM_250_TICKS" : 6, # house flags "HOUSE_FLAG_NOT_SLOPED" : 1, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/nml.egg-info/PKG-INFO new/nml-0.7.1/nml.egg-info/PKG-INFO --- old/nml-0.7.0/nml.egg-info/PKG-INFO 2022-08-29 21:39:55.000000000 +0200 +++ new/nml-0.7.1/nml.egg-info/PKG-INFO 2022-12-03 23:04:11.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: nml -Version: 0.7.0 +Version: 0.7.1 Summary: An OpenTTD NewGRF compiler for the nml language Home-page: https://github.com/OpenTTD/nml Author: NML Development Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/009_replace.nml new/nml-0.7.1/regression/009_replace.nml --- old/nml-0.7.0/regression/009_replace.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/009_replace.nml 2022-12-03 23:03:42.000000000 +0100 @@ -21,11 +21,10 @@ /* Sprites / code from opengfx (slightly modified) */ replacenew(ONE_WAY_ROAD, "oneway.png") { - [ 18, 8, 24, 16, -12, -8] - [ 50, 8, 24, 16, -12, -8] - [ 82, 8, 28, 16, -14, -8] - [ 114, 8, 24, 16, -10, -8] - [ 146, 8, 24, 16, -10, -8] - [ 178, 8, 28, 16, -12, -8] + [ 18, 8, 24, 16, -12, -8] + [ 50, 8, 24, 16, -12, -8] + [ 82, 8, 28, 16, -14, -8] + [ 114, 8, 24, 16, -10, -8] + [ 146, 8, 24, 16, -10, -8] + [ 178, 8, 28, 16, -12, -8] } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/024_conditional.nml new/nml-0.7.1/regression/024_conditional.nml --- old/nml-0.7.0/regression/024_conditional.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/024_conditional.nml 2022-12-03 23:03:42.000000000 +0100 @@ -1,11 +1,11 @@ if (param[0]) { - param[1] = 1; + param[1] = 1; } if (0) { - param[2] = 1; + param[2] = 1; } if (1) { - param[3] = 1; -} \ No newline at end of file + param[3] = 1; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/027_airport_layout.nml new/nml-0.7.1/regression/027_airport_layout.nml --- old/nml-0.7.0/regression/027_airport_layout.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/027_airport_layout.nml 2022-12-03 23:03:42.000000000 +0100 @@ -1,43 +1,43 @@ -spriteset(small_airport_tile_set) { [] } +spriteset(small_airport_tile_set) { [] } spritelayout small_airport_tile_layout { - ground { sprite: small_airport_tile_set; } - childsprite { - sprite: small_airport_tile_set; - always_draw: 1; - xoffset: 32; - yoffset: 16; - recolour_mode: RECOLOUR_REMAP; - palette: PALETTE_USE_DEFAULT; - } - building { - sprite: small_airport_tile_set; - } + ground { sprite: small_airport_tile_set; } + childsprite { + sprite: small_airport_tile_set; + always_draw: 1; + xoffset: 32; + yoffset: 16; + recolour_mode: RECOLOUR_REMAP; + palette: PALETTE_USE_DEFAULT; + } + building { + sprite: small_airport_tile_set; + } } item(FEAT_AIRPORTTILES, small_airport_tiles) { - property { - substitute: 0; - animation_info: [1, 4]; // loop, 4 frames - animation_speed: 1; - animation_triggers: 1; - } - graphics { - small_airport_tile_layout; - } + property { + substitute: 0; + animation_info: [1, 4]; // loop, 4 frames + animation_speed: 1; + animation_triggers: 1; + } + graphics { + small_airport_tile_layout; + } } tilelayout small_airport_layout_north { - rotation: DIRECTION_NORTH; - 0, 0: small_airport_tiles; - 1, 0: small_airport_tiles; - 2, 0: small_airport_tiles; - 3, 0: 70; // original airport tile + rotation: DIRECTION_NORTH; + 0, 0: small_airport_tiles; + 1, 0: small_airport_tiles; + 2, 0: small_airport_tiles; + 3, 0: 70; // original airport tile } item(FEAT_AIRPORTS, small_airport) { - property { - override: 0; - layouts: [small_airport_layout_north]; - } + property { + override: 0; + layouts: [small_airport_layout_north]; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/028_font.nml new/nml-0.7.1/regression/028_font.nml --- old/nml-0.7.0/regression/028_font.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/028_font.nml 2022-12-03 23:03:42.000000000 +0100 @@ -14,21 +14,20 @@ // U+007D: Right Curly Bracket // U+007E: Tilde font_glyph(NORMAL, 0x007B, "font_addl.png") { - tmpl_normal(10, 10, 5) - tmpl_normal(30, 10, 3) - tmpl_normal(50, 10, 5) - tmpl_normal(70, 10, 7) + tmpl_normal(10, 10, 5) + tmpl_normal(30, 10, 3) + tmpl_normal(50, 10, 5) + tmpl_normal(70, 10, 7) } font_glyph(SMALL, 0x007B, "font_addl.png") { - tmpl_small(10, 30, 3) - tmpl_small(30, 30, 1) - tmpl_small(50, 30, 3) - tmpl_small(70, 30, 4) + tmpl_small(10, 30, 3) + tmpl_small(30, 30, 1) + tmpl_small(50, 30, 3) + tmpl_small(70, 30, 4) } font_glyph(LARGE, 0x007B, "font_addl.png") { - tmpl_large(10, 40, 7) - tmpl_large(30, 40, 2) - tmpl_large(50, 40, 7) - tmpl_large(70, 40, 11) + tmpl_large(10, 40, 7) + tmpl_large(30, 40, 2) + tmpl_large(50, 40, 7) + tmpl_large(70, 40, 11) } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/029_base_graphics.nml new/nml-0.7.1/regression/029_base_graphics.nml --- old/nml-0.7.0/regression/029_base_graphics.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/029_base_graphics.nml 2022-12-03 23:03:42.000000000 +0100 @@ -1,40 +1,40 @@ // Source: OpenGFX base_graphics(0, "") { - // PALETTE_TILE_RED_PULSATING (red tile border pulsating) - recolour_sprite { - 0x00..0xD6: 0x00; - 0xE3..0xFF: 0x00; - 0x0A..0x0C: 0xF0; - 0x0D..0x0F: 0xEF; - 0x10: 0x0F; - 0x06: 0xF0; - 0x07: 0xF0; - 0x08: 0xF0; - 0x04: 0xF0; - 0x05: 0xF0; - 0x03: 0xF0; - 0x01: 0xF0; - 0x02: 0xF0; - 0x09: 0xF0; - } - // PALETTE_SEL_TILE_RED (red tile border) - recolour_sprite { - 0x00..0xD6: 0x00; - 0xE3..0xFF: 0x00; - 0x0A..0x0D: 0xA3; - 0x0E..0x0F: 0xA4; - 0x10: 0x0F; - 0x06: 0xB4; - 0x07: 0xB4; - 0x08: 0xB5; - 0x04: 0xB3; - 0x05: 0xB3; - 0x03: 0xB3; - 0x01: 0xB2; - 0x02: 0xB3; - 0x09: 0xB5; - } + // PALETTE_TILE_RED_PULSATING (red tile border pulsating) + recolour_sprite { + 0x00..0xD6: 0x00; + 0xE3..0xFF: 0x00; + 0x0A..0x0C: 0xF0; + 0x0D..0x0F: 0xEF; + 0x10: 0x0F; + 0x06: 0xF0; + 0x07: 0xF0; + 0x08: 0xF0; + 0x04: 0xF0; + 0x05: 0xF0; + 0x03: 0xF0; + 0x01: 0xF0; + 0x02: 0xF0; + 0x09: 0xF0; + } + // PALETTE_SEL_TILE_RED (red tile border) + recolour_sprite { + 0x00..0xD6: 0x00; + 0xE3..0xFF: 0x00; + 0x0A..0x0D: 0xA3; + 0x0E..0x0F: 0xA4; + 0x10: 0x0F; + 0x06: 0xB4; + 0x07: 0xB4; + 0x08: 0xB5; + 0x04: 0xB3; + 0x05: 0xB3; + 0x03: 0xB3; + 0x01: 0xB2; + 0x02: 0xB3; + 0x09: 0xB5; + } } base_graphics( 2, "fonts.png") { [ 10, 10, 2, 1, 0, -2, NOCROP] } @@ -46,4 +46,3 @@ base_graphics( 8, "fonts.png") { [ 130, 10, 9, 13, 0, -2] } base_graphics( 9, "fonts.png") { [ 150, 10, 3, 13, 0, -2] } base_graphics( 10, "fonts.png") { [ 170, 10, 5, 13, 0, -2] } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/030_house.nml new/nml-0.7.1/regression/030_house.nml --- old/nml-0.7.0/regression/030_house.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/030_house.nml 2022-12-03 23:03:42.000000000 +0100 @@ -24,7 +24,7 @@ /* Sprite templates for both ground and building sprites */ template tmpl_ground_tile(x, y, filename) { - [x, y, 64, 31, -31, 0, filename] + [x, y, 64, 31, -31, 0, filename] } template tmpl_building_sprite(x, y, h, dy, filename) { @@ -54,7 +54,7 @@ /* Generic sprite layout that is used for all tiles of the building. Parmaeters: * - building_sprite: offset in the brewery_spriteset_building spriteset to use. -1 to skip building sprite. * - with_smoke: Show smoke above the tile (also depends on animation state) */ -spritelayout brewery_sprite_layout(building_sprite, with_smoke) { +spritelayout brewery_sprite_layout(building_sprite, with_smoke) { /* First: Draw the normal ground sprite as a base layer */ ground { sprite: GROUNDSPRITE_NORMAL; @@ -67,21 +67,21 @@ always_draw: 1; // Draw this sprite even in transparent mode } /* Now draw the building sprite, assuming the building is fully constructed */ - building { - sprite: brewery_spriteset_building((terrain_type == TILETYPE_SNOW) * 3 + building_sprite); + building { + sprite: brewery_spriteset_building((terrain_type == TILETYPE_SNOW) * 3 + building_sprite); /* Enable recolouring for the flag on top, it will get a random colour */ recolour_mode: RECOLOUR_REMAP; palette: default_palette; zextent: 48; hide_sprite: building_sprite == -1 || construction_state != 3; } - building { + building { /* 3079 .. 3083 are steam smoke sprites * Draw one of them, assuming the animation frame != 0 */ sprite: 3079 + (animation_frame - 1) / 4; xoffset: 8; - yoffset: 0; - zoffset: 55 + (animation_frame - 1); + yoffset: 0; + zoffset: 55 + (animation_frame - 1); xextent: 11; zextent: 7; hide_sprite: !with_smoke || animation_frame == 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/031_aircraft.nml new/nml-0.7.1/regression/031_aircraft.nml --- old/nml-0.7.0/regression/031_aircraft.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/031_aircraft.nml 2022-12-03 23:03:42.000000000 +0100 @@ -9,15 +9,15 @@ item (FEAT_AIRCRAFT, Boeing_2707, 0x14) { - property - { - name: string(STR_NAME_PLANE); - introduction_date: date(1978,01,01); // Introduction two years after Concorde - model_life: 30; - vehicle_life: 30; - climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL); - speed: 805 km/h; - range: 1024; // same as concorde with typical max payload - passenger_capacity: 277; // would have cruised 6480 km at M2.7 with this load - } -} \ No newline at end of file + property + { + name: string(STR_NAME_PLANE); + introduction_date: date(1978,01,01); // Introduction two years after Concorde + model_life: 30; + vehicle_life: 30; + climates_available: bitmask(CLIMATE_TEMPERATE, CLIMATE_ARCTIC, CLIMATE_TROPICAL); + speed: 805 km/h; + range: 1024; // same as concorde with typical max payload + passenger_capacity: 277; // would have cruised 6480 km at M2.7 with this load + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/032_simple_house.nml new/nml-0.7.1/regression/032_simple_house.nml --- old/nml-0.7.0/regression/032_simple_house.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/032_simple_house.nml 2022-12-03 23:03:42.000000000 +0100 @@ -1,41 +1,41 @@ grf { - grfid: "NML\32"; - name: string(STR_REGRESSION_NAME); - desc: string(STR_REGRESSION_DESC); - version: 0; - min_compatible_version: 0; + grfid: "NML\32"; + name: string(STR_REGRESSION_NAME); + desc: string(STR_REGRESSION_DESC); + version: 0; + min_compatible_version: 0; } spriteset (spriteset_townhouse, "nlhs.png") { - [98, 8, 44, 36, -22, 0, NOCROP] + [98, 8, 44, 36, -22, 0, NOCROP] } spritelayout spritelayout_townhouse { - ground { - sprite: GROUNDSPRITE_NORMAL; - } - building { - sprite: spriteset_townhouse; - recolour_mode: RECOLOUR_REMAP; - palette: PALETTE_USE_DEFAULT; - xextent: 8; - yextent: 16; - zextent: 27; - xoffset: 4; - yoffset: 2; - zoffset: 0; - hide_sprite: 0; - } + ground { + sprite: GROUNDSPRITE_NORMAL; + } + building { + sprite: spriteset_townhouse; + recolour_mode: RECOLOUR_REMAP; + palette: PALETTE_USE_DEFAULT; + xextent: 8; + yextent: 16; + zextent: 27; + xoffset: 4; + yoffset: 2; + zoffset: 0; + hide_sprite: 0; + } } item (FEAT_HOUSES, item_townhouse, -1, HOUSE_SIZE_1X1) { - property { - substitute: 2; - override: 2; - probability: 10; - name: string(STR_032_HOUSE); - } + property { + substitute: 2; + override: 2; + probability: 10; + name: string(STR_032_HOUSE); + } - graphics { - default: spritelayout_townhouse; - } + graphics { + default: spritelayout_townhouse; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/040_station.nml new/nml-0.7.1/regression/040_station.nml --- old/nml-0.7.0/regression/040_station.nml 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/040_station.nml 2022-12-03 23:03:42.000000000 +0100 @@ -6,6 +6,10 @@ min_compatible_version: 0; } +cargotable { + COAL, LVST +} + spriteset(station_spriteset, "station.png") { lbl:[ 1, 1, 5, 5, -2, -2] [ 7, 1, 5, 5, -2, -2] @@ -105,16 +109,21 @@ classname: string(STR_STATION_TEST_CLASS); name : string(STR_STATION_BASIC); general_flags: bitmask(STAT_FLAG_EXTENDED_FOUNDATIONS); + cargo_random_triggers: [LVST]; + disabled_platforms: bitmask(5, 6, 7, 8); + } graphics { foundations: 0; + prepare_layout: [STORE_TEMP(0,0), STORE_TEMP(1,1)]; + purchase_prepare_layout: STORE_TEMP(3,3); sprite_layouts: [ station_sprite_layout_0, station_sprite_layout_1(1) ]; anim_speed: company_colour1 + company_colour2; - 1: station_spriteset; - 0: station_spriteset2; + LVST: station_spriteset; + COAL: station_spriteset2; station_spriteset; } } Binary files old/nml-0.7.0/regression/expected/040_station.grf and new/nml-0.7.1/regression/expected/040_station.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/040_station.nfo new/nml-0.7.1/regression/expected/040_station.nfo --- old/nml-0.7.0/regression/expected/040_station.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/040_station.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -5,7 +5,7 @@ // Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% // Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags -0 * 4 \d33 +0 * 4 \d36 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -16,33 +16,38 @@ 00 00 2 * 52 08 08 "NML\40" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 14 00 04 \b2 01 FF \wx0000 +3 * 16 00 08 \b1 02 FF \wx0000 +09 "COAL" "LVST" + +4 * 21 00 04 \b4 01 FF \wx0000 08 "TEST" 13 18 +12 \dx00000002 +0C F0 -4 * 11 04 04 FF 01 \wxC400 "Test" 00 +5 * 11 04 04 FF 01 \wxC400 "Test" 00 -5 * 20 04 04 FF 01 \wxC500 "Basic station" 00 +6 * 20 04 04 FF 01 \wxC500 "Basic station" 00 -6 * 6 01 04 \b2 FF \wx0002 +7 * 6 01 04 \b2 FF \wx0002 -7 station.png 8bpp 1 1 5 5 -2 -2 normal -8 station.png 8bpp 7 1 5 5 -2 -2 normal +8 station.png 8bpp 1 1 5 5 -2 -2 normal +9 station.png 8bpp 7 1 5 5 -2 -2 normal -9 station.png 8bpp 2 2 3 3 -1 -1 normal -10 station.png 8bpp 8 2 3 3 -1 -1 normal +10 station.png 8bpp 2 2 3 3 -1 -1 normal +11 station.png 8bpp 8 2 3 3 -1 -1 normal // Name: station_spriteset - feature 04 -11 * 7 02 04 FF \b0 \b1 +12 * 7 02 04 FF \b0 \b1 \w0 // Name: station_spriteset2 - feature 04 -12 * 7 02 04 FE \b0 \b1 +13 * 7 02 04 FE \b0 \b1 \w1 -13 * 114 00 04 \b1 01 FF \wx0000 +14 * 114 00 04 \b1 01 FF \wx0000 1A \b2 \b68 \dx000003F4 \wx0000 \dx0000842E \wx0000 \b0 \b0 \b0 \b16 \b5 \b2 @@ -57,7 +62,7 @@ // Name: Station Layout@registers - Id 00 // a : register 80 -14 * 77 02 04 FD 89 +15 * 77 02 04 FD 89 1A 20 \dx00000000 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 @@ -71,9 +76,19 @@ \b0 \wx8000 // Return computed value +// Name: Station Layout@prepare - Id 00 +16 * 34 02 04 FC 89 +1A 20 \dx00000000 +\2sto 1A 20 \dx00000000 +\2r 1A 20 \dx00000001 +\2sto 1A 00 \dx00000001 +\b0 +\wx8000 // Return computed value + // Name: @action3_0 -15 * 41 02 04 FC 89 -7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +17 * 49 02 04 FB 89 +7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id 00 +\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF \b2 \wx8000 \dx00000002 \dx00000002 // return 0; @@ -81,8 +96,9 @@ \wx00FF // station_spriteset; // Name: @action3_1 -16 * 41 02 04 FB 89 -7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +18 * 49 02 04 FA 89 +7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id 00 +\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF \b2 \wx00FF \dx00000001 \dx00000001 // station_spriteset; @@ -90,97 +106,110 @@ \wx00FE // station_spriteset2; // Name: @action3_2 -17 * 41 02 04 FA 89 -7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +19 * 49 02 04 FC 89 +7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id 00 +\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF \b2 \wx8000 \dx00000002 \dx00000002 // return 0; \wx00FE \dx00000003 \dx00000003 // station_spriteset2; \wx00FF // station_spriteset; -18 * 9 00 04 \b1 01 FF \wx0000 +// Name: @action3_3 +20 * 55 02 04 F9 89 +1A 20 \dx00000003 +\2sto 1A 20 \dx00000003 +\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +\2r 10 00 \dx000000FF +\b2 +\wx8000 \dx00000002 \dx00000002 // return 0; +\wx00FE \dx00000003 \dx00000003 // station_spriteset2; +\wx00FF // station_spriteset; + +21 * 9 00 04 \b1 01 FF \wx0000 0B 08 // Name: @return_action_0 -19 * 20 02 04 F9 89 +22 * 20 02 04 F8 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F \b0 \wx8000 // Return computed value -// Name: @action3_3 -20 * 23 02 04 F9 89 +// Name: @action3_4 +23 * 23 02 04 F8 89 0C 00 \dx0000FFFF \b1 -\wx00F9 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FC // @action3_0; +\wx00F8 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx00FB // @action3_0; // Name: @return_action_1 -21 * 20 02 04 F8 89 +24 * 20 02 04 F7 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F \b0 \wx8000 // Return computed value -// Name: @action3_4 -22 * 33 02 04 F8 89 +// Name: @action3_5 +25 * 33 02 04 F7 89 0C 00 \dx0000FFFF \b2 -\wx00FB \dx00000000 \dx00000000 // @action3_1; -\wx00F8 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FC // @action3_0; +\wx00FA \dx00000000 \dx00000000 // @action3_1; +\wx00F7 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx00FB // @action3_0; // Name: @return_action_2 -23 * 20 02 04 FB 89 +26 * 20 02 04 FA 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F \b0 \wx8000 // Return computed value -// Name: @action3_5 -24 * 33 02 04 FC 89 +// Name: @action3_6 +27 * 33 02 04 FB 89 0C 00 \dx0000FFFF \b2 -\wx00FA \dx00000000 \dx00000000 // @action3_2; -\wx00FB \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FC // @action3_0; - -25 * 13 03 04 01 00 \b2 -00 \wx00F8 // @action3_4; -01 \wx00FC // @action3_5; -\wx00F9 // @action3_3; +\wx00FC \dx00000000 \dx00000000 // @action3_2; +\wx00FA \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx00FB // @action3_0; + +28 * 16 03 04 01 00 \b3 +00 \wx00F7 // @action3_5; +01 \wx00FB // @action3_6; +FF \wx00F9 // @action3_3; +\wx00F8 // @action3_4; -26 * 12 00 04 \b1 01 FF \wx0001 +29 * 12 00 04 \b1 01 FF \wx0001 08 "TEST" -27 * 11 04 04 FF 01 \wxC401 "Test" 00 +30 * 11 04 04 FF 01 \wxC401 "Test" 00 -28 * 22 04 04 FF 01 \wxC501 "Basic station 2" 00 +31 * 22 04 04 FF 01 \wxC501 "Basic station 2" 00 -29 * 9 00 04 \b1 01 FF \wx0001 +32 * 9 00 04 \b1 01 FF \wx0001 0A 00 // Name: @CB_FAILED_REAL04 -30 * 7 02 04 F9 \b0 \b1 +33 * 7 02 04 F8 \b0 \b1 \w0 // Name: @CB_FAILED04 -31 * 23 02 04 F9 89 +34 * 23 02 04 F8 89 0C 00 \dx0000FFFF \b1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00F9 // Non-graphics callback, return graphics result +\wx00F8 // Non-graphics callback, return graphics result -// Name: @action3_6 -32 * 41 02 04 F9 89 +// Name: @action3_7 +35 * 41 02 04 F8 89 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF \b2 \wx00FF \dx00000001 \dx00000001 // station_spriteset; \wx00FE \dx00000003 \dx00000003 // station_spriteset2; -\wx00F9 // @CB_FAILED04; +\wx00F8 // @CB_FAILED04; -33 * 7 03 04 01 01 \b0 -\wx00F9 // @action3_6; +36 * 7 03 04 01 01 \b0 +\wx00F8 // @action3_7; Binary files old/nml-0.7.0/regression/expected/example_industry.grf and new/nml-0.7.1/regression/expected/example_industry.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_industry.nfo new/nml-0.7.1/regression/expected/example_industry.nfo --- old/nml-0.7.0/regression/expected/example_industry.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_industry.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d22 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "A" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_object.grf and new/nml-0.7.1/regression/expected/example_object.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_object.nfo new/nml-0.7.1/regression/expected/example_object.nfo --- old/nml-0.7.0/regression/expected/example_object.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_object.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d37 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "D" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_railtype.grf and new/nml-0.7.1/regression/expected/example_railtype.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_railtype.nfo new/nml-0.7.1/regression/expected/example_railtype.nfo --- old/nml-0.7.0/regression/expected/example_railtype.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_railtype.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d171 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "W" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_road_vehicle.grf and new/nml-0.7.1/regression/expected/example_road_vehicle.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_road_vehicle.nfo new/nml-0.7.1/regression/expected/example_road_vehicle.nfo --- old/nml-0.7.0/regression/expected/example_road_vehicle.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_road_vehicle.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d146 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "W" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_roadtype_and_tramtype.grf and new/nml-0.7.1/regression/expected/example_roadtype_and_tramtype.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_roadtype_and_tramtype.nfo new/nml-0.7.1/regression/expected/example_roadtype_and_tramtype.nfo --- old/nml-0.7.0/regression/expected/example_roadtype_and_tramtype.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_roadtype_and_tramtype.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d196 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "W" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_station.grf and new/nml-0.7.1/regression/expected/example_station.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_station.nfo new/nml-0.7.1/regression/expected/example_station.nfo --- old/nml-0.7.0/regression/expected/example_station.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_station.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -8,8 +8,8 @@ 0 * 4 \d29 1 * 54 14 "C" "INFO" -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 00 "B" "PALS" \w1 "D" "B" "BLTR" \w1 "8" Binary files old/nml-0.7.0/regression/expected/example_train.grf and new/nml-0.7.1/regression/expected/example_train.grf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nml-0.7.0/regression/expected/example_train.nfo new/nml-0.7.1/regression/expected/example_train.nfo --- old/nml-0.7.0/regression/expected/example_train.nfo 2022-08-29 21:39:16.000000000 +0200 +++ new/nml-0.7.1/regression/expected/example_train.nfo 2022-12-03 23:03:42.000000000 +0100 @@ -10,8 +10,8 @@ 1 * 665 14 "C" "INFO" "T" "NAME" 1F "NML Voorbeeld NewGRF: Trein" 00 "T" "DESC" 1F "\8ENML Voorbeeld NewGRF: Trein\0D\98Deze NewGRF is bedoeld als voorbeeld van de hogere NewGRF-programmeertaal NML.\0DOriginele graphics door \89Purno, \98geprogrammeerd door \89DJNekkid.\0D\98Deze NewGRF voegt een Nederlands treinstel toe, de ICM 'Koploper'." 00 -"B" "VRSN" \w4 \dx00000000 -"B" "MINV" \w4 \dx00000000 +"B" "VRSN" \w4 \dx00000001 +"B" "MINV" \w4 \dx00000001 "B" "NPAR" \w1 01 "C" "PARA" "C" \d0