Skip to content

Commit cb98ce1

Browse files
committed
Add: Regression test for 32bpp-only spriteset().
1 parent d4e3f97 commit cb98ce1

4 files changed

+146
-0
lines changed
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
A simple articulated tram, graphics from OpenGFX+rv
3+
Code is modified in some places for testing reasons.
4+
*/
5+
6+
grf {
7+
grfid: "NML\41";
8+
name: string(STR_REGRESSION_NAME);
9+
desc: string(STR_REGRESSION_DESC);
10+
version: 0;
11+
min_compatible_version: 0;
12+
}
13+
14+
template tmpl_tram(x, y) {
15+
[ x, y, 8, 18, -3, -10]
16+
[ 16 + x, y, 20, 18, -14, -5]
17+
[ 48 + x, y, 28, 15, -14, -8]
18+
[ 96 + x, y, 20, 18, -6, -7]
19+
[128 + x, y, 8, 18, -3, -10]
20+
[144 + x, y, 20, 18, -14, -9]
21+
[176 + x, y, 28, 15, -14, -8]
22+
[224 + x, y, 20, 18, -6, -7]
23+
}
24+
spriteset(foster_express_set, ZOOM_LEVEL_NORMAL, BIT_DEPTH_32BPP, "tram_foster_express.32.png") {
25+
tmpl_tram(48,1)
26+
}
27+
28+
switch(FEAT_ROADVEHS, SELF, foster_express_articulated_parts, extra_callback_info1) {
29+
1..3: return foster_express_tram;
30+
return 0xFF;
31+
}
32+
33+
34+
item(FEAT_ROADVEHS, foster_express_tram, 88) {
35+
property {
36+
name: string(STR_NAME_FOSTER_TURBO_TRAM);
37+
climates_available: ALL_CLIMATES;
38+
model_life: 40; // years
39+
vehicle_life: 30; // years
40+
introduction_date: date(1965,1,1);
41+
reliability_decay: 1;
42+
running_cost_base: RUNNING_COST_ROADVEH; // Default road vehicle running cost base
43+
running_cost_factor: 135;
44+
cost_factor: 143;
45+
speed: 317 mph;
46+
power: 220 hp;
47+
weight: 22 ton;
48+
sprite_id: SPRITE_ID_NEW_ROADVEH; // We have our own sprites
49+
loading_speed: 16; // loading speed
50+
tractive_effort_coefficient: 0.3;
51+
air_drag_coefficient: 0.5;
52+
cargo_capacity: 45; // passengers
53+
refittable_cargo_classes: bitmask(CC_PASSENGERS); // Allow passengers (and tourists)
54+
non_refittable_cargo_classes: NO_CARGO_CLASS; // Disallow other cargos
55+
cargo_allow_refit: [];
56+
default_cargo_type: DEFAULT_CARGO_FIRST_REFITTABLE;
57+
misc_flags: bitmask(ROADVEH_FLAG_TRAM); // This is a tram
58+
}
59+
graphics {
60+
articulated_part: foster_express_articulated_parts;
61+
foster_express_set;
62+
}
63+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Automatically generated by GRFCODEC. Do not modify!
2+
// (Info version 32)
3+
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>>
4+
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C
5+
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
6+
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags
7+
8+
0 * 4 \d18
9+
10+
1 * 54 14 "C" "INFO"
11+
"B" "VRSN" \w4 \dx00000000
12+
"B" "MINV" \w4 \dx00000000
13+
"B" "NPAR" \w1 00
14+
"B" "PALS" \w1 "A"
15+
"B" "BLTR" \w1 "3"
16+
00
17+
00
18+
2 * 52 08 08 "NML\41" "NML regression test" 00 "A test newgrf testing NML" 00
19+
// Name: foster_express_articulated_parts
20+
3 * 23 02 01 FF 89
21+
10 00 \dxFFFFFFFF
22+
\b1
23+
\wx8058 \dx00000001 \dx00000003 // 1 .. 3: return 88;
24+
\wx80FF // default: return 255;
25+
26+
4 * 74 00 01 \b25 01 FF \wx0058
27+
06 0F
28+
04 28
29+
03 1E
30+
1F \dx000AF386
31+
02 01
32+
0A \dx00004C48
33+
09 87
34+
11 8F
35+
08 FF
36+
15 FE
37+
13 16
38+
14 58
39+
0E FF
40+
07 10
41+
18 4D
42+
19 80
43+
0F 2D
44+
1D \wx0001
45+
16 \dx00000000
46+
1E \wx0000
47+
16 \dx00000000
48+
24 \b0
49+
16 \dx00000000
50+
10 FF
51+
1C 01
52+
53+
5 * 25 04 01 7F 01 FF \wx0058 "Foster Turbo Tram" 00
54+
55+
6 * 6 01 01 \b1 FF \wx0008
56+
57+
7 tram_foster_express.32.png 32bpp 48 1 8 18 -3 -10 normal
58+
8 tram_foster_express.32.png 32bpp 64 1 20 18 -14 -5 normal
59+
9 tram_foster_express.32.png 32bpp 96 1 28 15 -14 -8 normal
60+
10 tram_foster_express.32.png 32bpp 144 1 20 18 -6 -7 normal
61+
11 tram_foster_express.32.png 32bpp 176 1 8 18 -3 -10 normal
62+
12 tram_foster_express.32.png 32bpp 192 1 20 18 -14 -9 normal
63+
13 tram_foster_express.32.png 32bpp 224 1 28 15 -14 -8 normal
64+
14 tram_foster_express.32.png 32bpp 272 1 20 18 -6 -7 normal
65+
66+
// Name: foster_express_set - feature 01
67+
15 * 9 02 01 FE \b1 \b1
68+
\w0
69+
\w0
70+
71+
16 * 9 00 01 \b1 01 FF \wx0058
72+
17 10
73+
74+
// Name: @action3_0
75+
17 * 23 02 01 FE 89
76+
0C 00 \dx0000FFFF
77+
\b1
78+
\wx00FF \dx00000016 \dx00000016 // foster_express_articulated_parts;
79+
\wx00FE // foster_express_set;
80+
81+
18 * 9 03 01 01 FF \wx0058 \b0
82+
\wx00FE // @action3_0;
83+

regression/tram_foster_express.32.png

7.53 KB
Loading

0 commit comments

Comments
 (0)