Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra-tracks #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# -C: preserve comments
# -x c: treat the input file as C code
# -o: output file
gcc -E -P -C -x c sprites/jptracks-wemod.pyagl > sprites/jptracks-wemod.yagl &&
yagl -e jptracks-wemod.grf &&
gcc -E -x c sprites/jptracks-wemod.pyagl > sprites/jptracks-wemod.yagl &&
#yagl -e jptracks-wemod.grf &&
/d/Data/Documents/GitHub/yagl/build/Debug/yagl.exe -e jptracks-wemod.grf &&
echo "done!"
Binary file modified jptracks-wemod.grf
Binary file not shown.
Binary file modified jptracks-wemod.grf.bak
Binary file not shown.
24 changes: 24 additions & 0 deletions sprites/defines.pyagl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// rail sprite ids used in action03
#define SPRITE_RAILTYPE_GUI 0x00
#define SPRITE_RAILTYPE_OVERLAY 0x01
#define SPRITE_RAILTYPE_UNDERLAY 0x02
Expand All @@ -11,3 +12,26 @@
#define SPRITE_RAILTYPE_TUNNEL_OVERLAY 0x0A
#define SPRITE_RAILTYPE_SIGNAL 0x0B
#define SPRITE_RAILTYPE_PRECOMBINED 0x0C

// action03 ids, we don't want each of them to be identical
#define TRACK_NARROW_URBAN 0x10
#define TRACK_STANDARD_URBAN_3RD 0x11
#define TRACK_TRACKLESS_REINFORCED 0x12
#define TRACK_TRACKLESS_DIRT 0x13
#define TRACK_FENCE_COUNTRY 0x14
#define TRACK_TRACKLESS_GRAVEL 0x15
#define GUI_RAILTYPE 0x16
#define TRACK_TRACKLESS_URBAN 0x17
#define TRACK_DUAL_NORMAL 0x18
#define TRACK_DUAL_OVERLAY 0x19
#define TRACK_DUAL_URBAN 0x1A

// railtype ids
#define RAILTYPE_NARROW_URBAN 0x0010
#define RAILTYPE_TRACKLESS_DIRT 0x0011
#define RAILTYPE_TRACKLESS_REINFORCED 0x0012
#define RAILTYPE_TRACKLESS_GRAVEL 0x0013
#define RAILTYPE_TRACKLESS_URBAN 0x0014
#define RAILTYPE_DUAL_NORMAL 0x0015
#define RAILTYPE_DUAL_ELECTRIFIED 0x0016
#define RAILTYPE_DUAL_URBAN_ELECTRIFIED 0x0017
Binary file added sprites/extra-tracks-trackless.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprites/extra-tracks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
557 changes: 527 additions & 30 deletions sprites/extra_tracks.pyagl

Large diffs are not rendered by default.

27 changes: 20 additions & 7 deletions sprites/header.pyagl
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ optional_info // Action14
";
VRSN: [ 0x01 0x00 0x00 0x00 ];
MINV: [ 0x01 0x00 0x00 0x00 ];
NPAR: [ 0x0C ];
NPAR: [ 0x0B ];
PALS: [ 0x44 ];
PARA:
{
0x00000000:
{
DFLT: [ 0x00 0x00 0x00 0x00 ];
LIMI: [ 0x00 0x00 0x00 0x00 0x04 0x00 0x00 0x00 ];
LIMI: [ 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 ];
NAME: default, "Mode"; // Default
DESC: default, "Choose between generic or country-specific modes. When set to 'automatic', the Japanese mode is used only if the Japanese train set is used."; // Default
NAME: zh_CN, "轨道模式"; // Chinese (Simplified)
Expand All @@ -60,16 +60,19 @@ optional_info // Action14
0x00000002: default, "German"; // Default
0x00000003: default, "British"; // Default
0x00000004: default, "North American"; // Default
0x00000005: default, "Japanese"; // Default
0x00000000: zh_CN, "自动(日本/通用)"; // Chinese (Simplified)
0x00000001: zh_CN, "通用"; // Chinese (Simplified)
0x00000002: zh_CN, "德国"; // Chinese (Simplified)
0x00000003: zh_CN, "英国"; // Chinese (Simplified)
0x00000004: zh_CN, "北美"; // Chinese (Simplified)
0x00000005: zh_CN, "日本"; // Chinese (Simplified)
0x00000000: zh_TW, "自動(日本/通用)"; // Chinese (Traditional)
0x00000001: zh_TW, "通用"; // Chinese (Traditional)
0x00000002: zh_TW, "德國"; // Chinese (Traditional)
0x00000003: zh_TW, "英國"; // Chinese (Traditional)
0x00000004: zh_TW, "北美"; // Chinese (Traditional)
0x00000005: zh_TW, "日本"; // Chinese (Traditional)
}
}
0x00000001:
Expand Down Expand Up @@ -176,15 +179,24 @@ optional_info // Action14
}
0x00000006:
{
DFLT: [ 0x01 0x00 0x00 0x00 ];
LIMI: [ 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ];
TYPE: [ 0x01 ];
DFLT: [ 0x00 0x00 0x00 0x00 ];
LIMI: [ 0x00 0x00 0x00 0x00 0x02 0x00 0x00 0x00 ];
NAME: default, "Use custom catenary"; // Default
DESC: default, "If this setting is disabled, the default graphics for catenary wire and poles will be used instead of the ones provided by this set."; // Default
NAME: zh_CN, "使用自定义接触网"; // Chinese (Simplified)
DESC: zh_CN, "如果禁用此设置,则将使用接触网和杆的默认图形,而不是此设置提供的图形。"; // Chinese (Simplified)
NAME: zh_TW, "使用自定義電車線"; // Chinese (Traditional)
DESC: zh_TW, "如果禁用此設置,則將使用電車線和電車線柱的默認圖形,而不是此設置提供的圖形。"; // Chinese (Traditional)
VALU:
{
0x00000000: default, "{ext push-colour}{red}Disabled{ext pop-colour}";
0x00000001: default, "JP3 Tracks";
0x00000002: default, "{ext push-colour}{lt-gray}Qatenary (weMOD){ext pop-colour}";
0x00000000: zh_CN, "{ext push-colour}{red}禁用{ext pop-colour}";
0x00000001: zh_CN, "JP3 轨道";
0x00000000: zh_TW, "{ext push-colour}{red}禁用{ext pop-colour}";
0x00000001: zh_TW, "JP3 軌道";
}
}
0x00000007:
{
Expand Down Expand Up @@ -235,7 +247,7 @@ optional_info // Action14
DESC: zh_CN, "如果启用此选项,则车辆段和围栏将使用公司颜色。"; // Chinese (Simplified)
NAME: zh_TW, "使用公司顏色"; // Chinese (Traditional)
DESC: zh_TW, "如果啟用此選項,则車廠和圍欄將使用公司顏色。"; // Chinese (Traditional)
}
}/*
0x0000000A:
{
DFLT: [ 0x01 0x00 0x00 0x00 ];
Expand All @@ -252,7 +264,8 @@ optional_info // Action14
0x00000001: default, "{red}OpenGFX"; // Default
}
}
0x0000000B:
0x0000000B:*/
0x0000000A:
{
DFLT: [ 0x01 0x00 0x00 0x00 ];
LIMI: [ 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ];
Expand Down
33 changes: 31 additions & 2 deletions sprites/jptracks-wemod.pyagl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
yagl_version: "v1.2.2-0-g679a0ca";
//yagl_version: "v1.2.2-0-g679a0ca";
yagl_version: "v1.2.2-16-g903c367";
grf_format: Container1;
ignore // Action0C
{
Expand All @@ -12,6 +13,8 @@ ignore // Action0C
#include "./defines.pyagl"
#include "./checks.pyagl"
#include "./header.pyagl"
ignore{"inforce use of Japanese Tracks";}
if_act9 (is_equal(param[0x00] & 0xFF, 0x05)){skip_sprites: 0x03;}
if_act9 (is_not_equal(param[0x00] & 0xFF, 0x00)) // Action09
{
skip_sprites: 0x01;
Expand Down Expand Up @@ -8391,6 +8394,11 @@ sprite_groups<RailTypes, 0xC0> // Action02 basic
{
primary_spritesets: [ 0x0000 ];
}
//TODO replace this with better gui
sprite_groups<RailTypes, GUI_RAILTYPE>
{
primary_spritesets:[ 0x0000 ];
}
// Record #594
sprite_sets<RailTypes, 0x0000> // <feature, first_set> Action01
{
Expand Down Expand Up @@ -13977,6 +13985,13 @@ switch<RailTypes, 0xCA, PrimaryByte> // Action02 variable
};
default: 0x00AB;
}
ignore{"persistant action02 storage for extra railtypes";}
switch<RailTypes, TRACK_STANDARD_URBAN_3RD, PrimaryByte> // Action02 variable
{
expression:{value1 = variable[0x40] & 0x000000FF;};
ranges:{0x00000004: 0x00B8;};
default: 0x00AB;
}
// Record #866
sprite_sets<RailTypes, 0x0000> // <feature, first_set> Action01
{
Expand Down Expand Up @@ -14561,6 +14576,15 @@ switch<RailTypes, 0xD4, PrimaryByte> // Action02 variable
};
default: 0x00AB;
}
ignore{"persistant action02 storage for extra railtypes";}
switch<RailTypes, TRACK_NARROW_URBAN, PrimaryByte> // Action02 variable
{
expression:{value1 = variable[0x40] & 0x000000FF;};// for snow
ranges:{0x00000004: 0x00B9;};
default: 0x00AB;
}


// Record #884
sprite_sets<RailTypes, 0x0000> // <feature, first_set> Action01
{
Expand Down Expand Up @@ -38286,7 +38310,7 @@ feature_graphics<RailTypes> // Action03
};
}
// Record #2174
if_act9 (is_equal(param[0x06] & 0xFF, 0x00)) // Action09
if_act9 (is_not_equal(param[0x06] & 0xFF, 0x01)) // Action09
{
skip_sprites: 0xF8;
// Or skip to the next label (Action10) with this value - search wraps at end of GRF.
Expand Down Expand Up @@ -41048,6 +41072,10 @@ sprite_groups<RailTypes, 0xA0> // Action02 basic
{
primary_spritesets: [ 0x0000 ];
}
sprite_groups<RailTypes, TRACK_FENCE_COUNTRY>
{
primary_spritesets: [ 0x0000 ];
}
// Record #2382
if_act9 (is_less_than(param[0x08] & 0xFF, 0x03)) // Action09
{
Expand Down Expand Up @@ -43550,3 +43578,4 @@ label<0xD0> // Action10 - target for Action07 or Action09
}

#include "./extra_tracks.pyagl"
#include "./qatenary.pyagl"
Binary file added sprites/nothing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions sprites/qatenary.pyagl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
if_act9 (is_not_equal(param[0x06] & 0xFF, 0x02)) // Action09
{
skip_sprites: 1;
// Or skip to the next label (Action10) with this value - search wraps at end of GRF.
// 0x00 means skip to end of GRF file - may disable the GRF.
}

replace_sprites<Catenary, 0x0000> // <new_feature_type, offset> Action05
{
sprite_id<0xFF000005>{[64, 50, -45, -15], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [10, 10];}
sprite_id<0xFF000006>{[32, 18, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [84, 10];}
sprite_id<0xFF000007>{[32, 3, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [126, 10];}
sprite_id<0xFF000008>{[1, 16, 0, -3], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [168, 10];}
sprite_id<0xFF000009>{[32, 26, -29, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [179, 10];}
sprite_id<0xFF00000A>{[32, 11, -1, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [221, 10];}
sprite_id<0xFF00000B>{[32, 11, -29, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [263, 10];}
sprite_id<0xFF00000C>{[32, 26, -1, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [305, 10];}
sprite_id<0xFF00000D>{[64, 46, -45, -24], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [347, 10];}
sprite_id<0xFF00000E>{[32, 18, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [421, 10];}
sprite_id<0xFF00000F>{[32, 3, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [463, 10];}
sprite_id<0xFF000010>{[1, 16, 0, -3], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [505, 10];}
sprite_id<0xFF000011>{[32, 26, -29, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [516, 10];}
sprite_id<0xFF000012>{[32, 11, -1, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [558, 10];}
sprite_id<0xFF000013>{[32, 11, -29, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [600, 10];}
sprite_id<0xFF000014>{[32, 26, -1, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [642, 10];}
sprite_id<0xFF000015>{[64, 46, -45, -24], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [684, 10];}
sprite_id<0xFF000016>{[32, 18, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [758, 10];}
sprite_id<0xFF000017>{[32, 3, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [10, 70];}
sprite_id<0xFF000018>{[1, 16, 0, -3], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [52, 70];}
sprite_id<0xFF000019>{[32, 26, -29, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [63, 70];}
sprite_id<0xFF00001A>{[32, 11, -1, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [105, 70];}
sprite_id<0xFF00001B>{[32, 11, -29, 5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [147, 70];}
sprite_id<0xFF00001C>{[32, 26, -1, -5], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [189, 70];}
sprite_id<0xFF00001D>{[16, 10, -29, 4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [231, 70];}
sprite_id<0xFF00001E>{[16, 10, -1, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [257, 70];}
sprite_id<0xFF00001F>{[16, 10, -13, -4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [283, 70];}
sprite_id<0xFF000020>{[16, 10, 15, 4], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [309, 70];}
sprite_id<0xFF000021>{[11, 21, -8, -19], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [335, 70];}
sprite_id<0xFF000022>{[10, 25, 1, -23], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [356, 70];}
sprite_id<0xFF000023>{[64, 46, -21, -27], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [376, 70];}
sprite_id<0xFF000024>{[64, 46, -39, -35], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [450, 70];}
sprite_id<0xFF000025>{[2, 21, 0, -20], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [524, 70];}
sprite_id<0xFF000026>{[2, 21, 0, -19], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [536, 70];}
sprite_id<0xFF000027>{[11, 21, 0, -20], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [548, 70];}
sprite_id<0xFF000028>{[11, 21, -10, -20], normal, c8bpp, "qatenary_v0_1-8bpp-normal-0.png", [569, 70];}
}
Binary file added sprites/qatenary_v0_1-8bpp-normal-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.