ext_action1.diff

Hirundo, 2012-06-29 14:11

Download (26.2 KB)

View differences:

nml/actions/action1.py
23 23
    @ivar feature: Feature of this action1
24 24
    @type feature: C{int}
25 25

  
26
    @ivar first_set: Number of the first sprite set in this action 1
27
    @type first_set: C{int}
28

  
26 29
    @ivar num_sets: Number of (sprite) sets that follow this action 1.
27 30
    @type num_sets: C{int}
28 31

  
29 32
    @ivar num_ent: Number of sprites per set (e.g. (usually) 8 for vehicles)
30 33
    @type num_ent: C{int}
31 34
    """
32
    def __init__(self, feature, num_sets, num_ent):
35
    def __init__(self, feature, first_set, num_sets, num_ent):
33 36
        self.feature = feature
37
        self.first_set = first_set
34 38
        self.num_sets = num_sets
35 39
        self.num_ent = num_ent
36 40

  
37 41
    def write(self, file):
38
        #<Sprite-number> * <Length> 01 <feature> <num-sets> <num-ent>
39
        file.start_sprite(6)
42
        #<Sprite-number> * <Length> 01 <feature> 00 <first-set> <num-sets> <num-ent>
43
        file.start_sprite(12)
40 44
        file.print_bytex(1)
41 45
        file.print_bytex(self.feature)
42
        file.print_byte(self.num_sets)
46
        file.print_bytex(0)
47
        file.print_varx(self.first_set, 3)
48
        file.print_varx(self.num_sets, 3)
43 49
        file.print_varx(self.num_ent, 3)
44 50
        file.newline()
45 51
        file.end_sprite()
......
132 138
        @return: A list of actions needed to represet this collection in a GRF.
133 139
        @rtype: C{list} of L{BaseAction}
134 140
        """
135
        actions = [Action1(self.feature, len(self.spritesets), self.num_sprites_per_spriteset)]
141
        actions = [Action1(self.feature, 0, len(self.spritesets), self.num_sprites_per_spriteset)]
136 142
        for idx in range(len(self.spritesets)):
137 143
            for spriteset, spriteset_offset in self.spritesets.iteritems():
138 144
                if idx == spriteset_offset:
regression/expected/006_vehicle.nfo
58 58

  
59 59
10 * 23 04 01 1F 01 FF \wx0059 "Foster Sneltram" 00 
60 60

  
61
11 * 6 01 01 \b1 FF \wx0008 
61
11 * 12 01 01 00 FF \wx0000 FF \wx0001 FF \wx0008 
62 62

  
63 63
12 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 -10 normal 
64 64
|	opengfx_generic_trams1.png 32bpp 48 56 8 18 -3 -10 normal 
regression/expected/010_liveryoverride.nfo
16 16
00 
17 17
00 
18 18
2 * 52 08 08 "test" "NML regression test" 00 "A test newgrf testing NML" 00 
19
3 * 6 01 00 \b3 FF \wx0008 
19
3 * 12 01 00 00 FF \wx0000 FF \wx0003 FF \wx0008 
20 20

  
21 21
4 opengfx_trains_start.pcx 8bpp 142 112 8 22 -3 -10 normal 
22 22
5 opengfx_trains_start.pcx 8bpp 158 112 21 15 -14 -7 normal 
regression/expected/013_train_callback.nfo
31 31
4 * 26 00 08 \b1 05 00 
32 32
12 "RAIL" "ELRL" "MONO" "MGLV" "TRPD" 
33 33

  
34
5 * 6 01 00 \b8 FF \wx0004 
34
5 * 12 01 00 00 FF \wx0000 FF \wx0008 FF \wx0004 
35 35

  
36 36
6 temperate_railwagons.png 8bpp 0 25 8 24 -3 -12 normal 
37 37
7 temperate_railwagons.png 8bpp 16 25 22 17 -14 -9 normal 
regression/expected/016_basic_airporttiles.nfo
5 5
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
6 6
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags
7 7

  
8
0 * 6 01 11 \b1 FF \wx0001 
8
0 * 12 01 11 00 FF \wx0000 FF \wx0001 FF \wx0001 
9 9

  
10 10
1 opengfx_trains_start.pcx 8bpp 142 112 8 22 -3 -10 normal 
11 11

  
regression/expected/017_articulated_tram.nfo
50 50

  
51 51
6 * 23 04 01 1F 01 FF \wx0058 "Foster Sneltram" 00 
52 52

  
53
7 * 6 01 01 \b1 FF \wx0008 
53
7 * 12 01 01 00 FF \wx0000 FF \wx0001 FF \wx0008 
54 54

  
55 55
8 tram_foster_express.png 8bpp 48 1 8 18 -3 -10 normal 
56 56
9 tram_foster_express.png 8bpp 64 1 20 18 -14 -5 normal 
regression/expected/020_recolour.nfo
77 77
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF 
78 78
F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF 
79 79

  
80
9 * 6 01 01 \b1 FF \wx0008 
80
9 * 12 01 01 00 FF \wx0000 FF \wx0001 FF \wx0008 
81 81

  
82 82
10 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 -10 normal 
83 83
11 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal 
regression/expected/026_asl.nfo
20 20
2 * 7 03 11 01 00 \b0 
21 21
\wx00FF 	// layout1;
22 22

  
23
3 * 6 01 0F \b2 FF \wx0003 
23
3 * 12 01 0F 00 FF \wx0000 FF \wx0002 FF \wx0003 
24 24

  
25 25
4 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal 
26 26
5 * 1 00 
......
82 82
\wx00FF \dx00000000 \dx00000000 
83 83
\wx00FF // 
84 84

  
85
12 * 6 01 11 \b2 FF \wx0003 
85
12 * 12 01 11 00 FF \wx0000 FF \wx0002 FF \wx0003 
86 86

  
87 87
13 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal 
88 88
14 * 1 00 
regression/expected/027_airport_layout.nfo
5 5
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
6 6
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags
7 7

  
8
0 * 6 01 11 \b1 FF \wx0001 
8
0 * 12 01 11 00 FF \wx0000 FF \wx0001 FF \wx0001 
9 9

  
10 10
1 * 1 00 
11 11