Changeset - r11464:d0a348843230
[Not reviewed]
master
0 3 0
smatz - 15 years ago 2009-03-23 11:48:05
smatz@openttd.org
(svn r15830) -Codechange: don't use fixed size of array in news_gui.cpp and news_func.h
3 files changed with 10 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/news_func.h
Show inline comments
 
@@ -16,7 +16,7 @@ void InitNewsItemStructs();
 
extern NewsItem _statusbar_news_item;
 
extern bool _news_ticker_sound;
 

	
 
extern NewsTypeData _news_type_data[NT_END];
 
extern NewsTypeData _news_type_data[];
 

	
 
/**
 
 * Delete a news item type about a vehicle
src/news_gui.cpp
Show inline comments
 
@@ -104,7 +104,7 @@ struct NewsSubtypeData {
 
/**
 
 * Data common to all news items of a given subtype (actual data)
 
 */
 
static const struct NewsSubtypeData _news_subtype_data[NS_END] = {
 
static const NewsSubtypeData _news_subtype_data[] = {
 
	/* type,               display_mode, flags,                  callback */
 
	{ NT_ARRIVAL_COMPANY,  NM_THIN,     NF_VIEWPORT|NF_VEHICLE, NULL                    }, ///< NS_ARRIVAL_COMPANY
 
	{ NT_ARRIVAL_OTHER,    NM_THIN,     NF_VIEWPORT|NF_VEHICLE, NULL                    }, ///< NS_ARRIVAL_OTHER
 
@@ -127,10 +127,12 @@ static const struct NewsSubtypeData _new
 
	{ NT_GENERAL,          NM_NORMAL,   NF_TILE,                NULL                    }, ///< NS_GENERAL
 
};
 

	
 
assert_compile(lengthof(_news_subtype_data) == NS_END);
 

	
 
/**
 
 * Per-NewsType data
 
 */
 
NewsTypeData _news_type_data[NT_END] = {
 
NewsTypeData _news_type_data[] = {
 
	/* name,              age, sound,           display */
 
	{ "arrival_player",    60, SND_1D_APPLAUSE, ND_FULL },  ///< NT_ARRIVAL_COMPANY
 
	{ "arrival_other",     60, SND_1D_APPLAUSE, ND_FULL },  ///< NT_ARRIVAL_OTHER
 
@@ -149,6 +151,8 @@ NewsTypeData _news_type_data[NT_END] = {
 
	{ "general",           60, SND_BEGIN,       ND_FULL },  ///< NT_GENERAL
 
};
 

	
 
assert_compile(lengthof(_news_type_data) == NT_END);
 

	
 
struct NewsWindow : Window {
 
	uint16 chat_height;
 
	NewsItem *ni;
src/news_type.h
Show inline comments
 
@@ -95,9 +95,9 @@ enum NewsDisplay {
 
 */
 
struct NewsTypeData {
 
	const char * const name; ///< Name
 
	const byte age;         ///< Maximum age of news items (in days)
 
	const SoundFx sound;    ///< Sound
 
	NewsDisplay display;    ///< Display mode (off, summary, full)
 
	const byte age;          ///< Maximum age of news items (in days)
 
	const SoundFx sound;     ///< Sound
 
	NewsDisplay display;     ///< Display mode (off, summary, full)
 
};
 

	
 
struct NewsItem {
0 comments (0 inline, 0 general)