summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-10-05 15:07:34 +0000
committerpeter1138 <peter1138@openttd.org>2006-10-05 15:07:34 +0000
commit0815ce3cd97644e32da3524a1a000335e8b157f2 (patch)
tree419846e310a6d94a77247408efacb0066870ba6c /newgrf.c
parent5def2bc8d74a6b65051122a46aa43a322555131b (diff)
downloadopenttd-0815ce3cd97644e32da3524a1a000335e8b157f2.tar.xz
(svn r6654) - Codechange: If no 2cc vehicles are available, hide the secondary colour choice.
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/newgrf.c b/newgrf.c
index 99f70d37e..b34292109 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -59,6 +59,9 @@ static uint32 _ttdpatch_flags[8];
/* Used by Action 0x06 to preload a pseudo sprite and modify its content */
static byte *_preload_sprite = NULL;
+/* Set if any vehicle is loaded which uses 2cc (two company colours) */
+bool _have_2cc = false;
+
typedef enum GrfDataType {
GDT_SOUND,
@@ -459,7 +462,10 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
break;
case 0x27: /* Miscellaneous flags */
- FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf);
+ FOR_EACH_OBJECT {
+ ei[i].misc_flags = grf_load_byte(&buf);
+ if (HASBIT(ei[i].misc_flags, EF_USES_2CC)) _have_2cc = true;
+ }
break;
case 0x28: /* Cargo classes allowed */
@@ -3055,6 +3061,7 @@ static void ResetNewGRFData(void)
_misc_grf_features = 0;
_traininfo_vehicle_pitch = 0;
_traininfo_vehicle_width = 29;
+ _have_2cc = false;
InitializeSoundPool();
InitializeSpriteGroupPool();