src/newgrf_config.cpp
changeset 7882 308cab08d2f3
parent 7805 7ab20f94cc80
child 7928 63e18de69e50
equal deleted inserted replaced
7881:7838dbc8bbab 7882:308cab08d2f3
    67 
    67 
    68 	/* Find and load the Action 8 information */
    68 	/* Find and load the Action 8 information */
    69 	LoadNewGRFFile(config, CONFIG_SLOT, GLS_FILESCAN);
    69 	LoadNewGRFFile(config, CONFIG_SLOT, GLS_FILESCAN);
    70 
    70 
    71 	/* Skip if the grfid is 0 (not read) or 0xFFFFFFFF (ttdp system grf) */
    71 	/* Skip if the grfid is 0 (not read) or 0xFFFFFFFF (ttdp system grf) */
    72 	if (config->grfid == 0 || config->grfid == 0xFFFFFFFF) return false;
    72 	if (config->grfid == 0 || config->grfid == 0xFFFFFFFF || config->IsOpenTTDBaseGRF()) return false;
    73 
    73 
    74 	if (is_static) {
    74 	if (is_static) {
    75 		/* Perform a 'safety scan' for static GRFs */
    75 		/* Perform a 'safety scan' for static GRFs */
    76 		LoadNewGRFFile(config, 62, GLS_SAFETYSCAN);
    76 		LoadNewGRFFile(config, 62, GLS_SAFETYSCAN);
    77 
    77 
   520 		dst += snprintf(dst, last - dst, "%d", c->param[i]);
   520 		dst += snprintf(dst, last - dst, "%d", c->param[i]);
   521 	}
   521 	}
   522 	return dst;
   522 	return dst;
   523 }
   523 }
   524 
   524 
       
   525 /** Base GRF ID for OpenTTD's base graphics GRFs. */
       
   526 static const uint32 OPENTTD_GRAPHICS_BASE_GRF_ID = BSWAP32(0xFF4F5400);
       
   527 
       
   528 /**
       
   529  * Checks whether this GRF is a OpenTTD base graphic GRF.
       
   530  * @return true if and only if it is a base GRF.
       
   531  */
       
   532 bool GRFConfig::IsOpenTTDBaseGRF() const
       
   533 {
       
   534 	return (this->grfid & 0x00FFFFFF) == OPENTTD_GRAPHICS_BASE_GRF_ID;
       
   535 }
       
   536 
   525 
   537 
   526 static const SaveLoad _grfconfig_desc[] = {
   538 static const SaveLoad _grfconfig_desc[] = {
   527 	SLE_STR(GRFConfig, filename,   SLE_STR, 0x40),
   539 	SLE_STR(GRFConfig, filename,   SLE_STR, 0x40),
   528 	SLE_VAR(GRFConfig, grfid,      SLE_UINT32),
   540 	SLE_VAR(GRFConfig, grfid,      SLE_UINT32),
   529 	SLE_ARR(GRFConfig, md5sum,     SLE_UINT8, 16),
   541 	SLE_ARR(GRFConfig, md5sum,     SLE_UINT8, 16),