OpenTTD
news_type.h
Go to the documentation of this file.
1 /* $Id: news_type.h 24843 2012-12-23 21:07:12Z frosch $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef NEWS_TYPE_H
13 #define NEWS_TYPE_H
14 
15 #include "core/enum_type.hpp"
16 #include "date_type.h"
17 #include "strings_type.h"
18 #include "sound_type.h"
19 
23 
28 
31 };
32 
36 enum NewsType {
53 };
54 
72 };
73 
78 enum NewsFlag {
81  NFB_SHADE = 2,
85 
90 
96 };
98 
99 
100 
107 };
108 
112 struct NewsTypeData {
113  const char * const name;
114  const byte age;
115  const SoundFx sound;
116 
123  NewsTypeData(const char *name, byte age, SoundFx sound) :
124  name(name),
125  age(age),
126  sound(sound)
127  {
128  }
129 
130  NewsDisplay GetDisplay() const;
131 };
132 
134 struct NewsItem {
141 
144  uint32 ref1;
145  uint32 ref2;
146 
147  void *free_data;
148 
149  ~NewsItem()
150  {
151  free(this->free_data);
152  }
153 
154  uint64 params[10];
155 };
156 
164  char company_name[64];
165  char president_name[64];
167 
168  uint32 face;
169  byte colour;
170 
171  void FillData(const struct Company *c, const struct Company *other = NULL);
172 };
173 
174 #endif /* NEWS_TYPE_H */