news_func.h

Go to the documentation of this file.
00001 /* $Id: news_func.h 18597 2009-12-21 21:14:40Z frosch $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef NEWS_FUNC_H
00013 #define NEWS_FUNC_H
00014 
00015 #include "news_type.h"
00016 #include "vehicle_type.h"
00017 #include "station_type.h"
00018 #include "industry_type.h"
00019 
00020 void AddNewsItem(StringID string, NewsSubtype subtype, NewsReferenceType reftype1 = NR_NONE, uint32 ref1 = UINT32_MAX, NewsReferenceType reftype2 = NR_NONE, uint32 ref2 = UINT32_MAX, void *free_data = NULL);
00021 
00022 static inline void AddCompanyNewsItem(StringID string, NewsSubtype subtype, CompanyNewsInformation *cni)
00023 {
00024   AddNewsItem(string, subtype, NR_NONE, UINT32_MAX, NR_NONE, UINT32_MAX, cni);
00025 }
00026 
00036 static inline void AddVehicleNewsItem(StringID string, NewsSubtype subtype, VehicleID vehicle, StationID station = INVALID_STATION)
00037 {
00038   AddNewsItem(string, subtype, NR_VEHICLE, vehicle, station == INVALID_STATION ? NR_NONE : NR_STATION, station);
00039 }
00040 
00041 static inline void AddIndustryNewsItem(StringID string, NewsSubtype subtype, IndustryID industry)
00042 {
00043   AddNewsItem(string, subtype, NR_INDUSTRY, industry);
00044 }
00045 
00046 void NewsLoop();
00047 void InitNewsItemStructs();
00048 
00049 extern const NewsItem *_statusbar_news_item;
00050 extern bool _news_ticker_sound;
00051 
00052 extern NewsTypeData _news_type_data[];
00053 
00059 void DeleteVehicleNews(VehicleID vid, StringID news);
00060 
00062 void DeleteStationNews(StationID sid);
00063 
00065 void DeleteIndustryNews(IndustryID iid);
00066 
00067 #endif /* NEWS_FUNC_H */

Generated on Sun Jan 9 16:01:58 2011 for OpenTTD by  doxygen 1.6.1