# HG changeset patch # Parent e9d7bad7041d99f3cbe030838289260b2b2d4e72 diff --git a/src/news.cpp b/src/news.cpp --- a/src/news.cpp +++ b/src/news.cpp @@ -41,12 +41,11 @@ * in _forced_news. Otherwise, \a _forced_news variable is NULL. */ const NewsItem *_forced_news = NULL; -uint _total_news = 0; ///< current number of news items -NewsItem *_oldest_news = NULL; ///< head of news items queue -NewsItem *_latest_news = NULL; ///< tail of news items queue +uint _total_news = 0; ///< Current number of #NewsItems. +NewsItem *_oldest_news = NULL; ///< Head of #NewsItems queue. +NewsItem *_latest_news = NULL; ///< Tail of #NewsItems queue. -/** Current news item (last item shown regularly). */ -static const NewsItem *_current_news = NULL; +static const NewsItem *_current_news = NULL; ///< Current news item (last item shown regularly). /** * Get the position a news-reference is referencing. @@ -98,7 +97,7 @@ /** * Are we ready to show another news item? - * Only if nothing is in the newsticker and no newspaper is displayed + * @return True iff nothing is in the newsticker and no newspaper is displayed. */ static bool ReadyForNextItem() { @@ -116,7 +115,7 @@ return (NewsWindow::duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL); } -/** Move to the next news item */ +/** Move to the next news item. */ static void MoveToNextItem() { InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED); // Invalidate the statusbar. @@ -152,14 +151,14 @@ /** * Add a new newsitem to be shown. - * @param string String to display - * @param type news category - * @param flags display flags for the news - * @param reftype1 Type of ref1 + * @param string String to display. + * @param type News category. + * @param flags Display flags for the news. + * @param reftype1 Type of ref1. * @param ref1 Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted. - * @param reftype2 Type of ref2 + * @param reftype2 Type of ref2. * @param ref2 Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted. - * @param free_data Pointer to data that must be freed once the news message is cleared + * @param free_data Pointer to data that must be freed once the news message is cleared. * * @see NewsSubtype */ @@ -203,15 +202,15 @@ /** * Create a new custom news item. - * @param tile unused - * @param flags type of operation - * @param p1 various bitstuffed elements + * @param tile Unused. + * @param flags type of operation. + * @param p1 various bitstuffed elements. * - p1 = (bit 0 - 7) - NewsType of the message. * - p1 = (bit 8 - 15) - NewsReferenceType of first reference. * - p1 = (bit 16 - 23) - Company this news message is for. * @param p2 First reference of the news message. * @param text The text of the news message. - * @return the cost of this operation or an error + * @return The cost of this operation or an error. */ CommandCost CmdCustomNewsItem(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { @@ -265,7 +264,10 @@ return CommandCost(); } -/** Delete a news item from the queue */ +/** + * Delete a #NewsItem from the queue. + * @param ni NewsItem to delete. + */ static void DeleteNewsItem(NewsItem *ni) { /* Delete the news from the news queue. */ @@ -323,7 +325,7 @@ /** * Remove news regarding given station so there are no 'unknown station now accepts Mail' * or 'First train arrived at unknown station' news items. - * @param sid station to remove news about + * @param sid Station to remove news about. */ void DeleteStationNews(StationID sid) { @@ -339,8 +341,8 @@ } /** - * Remove news regarding given industry - * @param iid industry to remove news about + * Remove news regarding given industry. + * @param iid Industry to remove news about. */ void DeleteIndustryNews(IndustryID iid) { @@ -355,9 +357,7 @@ } } -/** - * Remove engine announcements for invalid engines. - */ +/** Remove engine announcements for invalid engines. */ void DeleteInvalidEngineNews() { NewsItem *ni = _oldest_news; @@ -372,6 +372,7 @@ } } +/** Remove outdated NewsItems from the queue */ static void RemoveOldNewsItems() { NewsItem *next; @@ -382,10 +383,10 @@ } /** - * Report a change in vehicle IDs (due to autoreplace) to affected vehicle news. - * @note Viewports of currently displayed news is changed via #ChangeVehicleViewports - * @param from_index the old vehicle ID - * @param to_index the new vehicle ID + * Report a change in VehicleIDs (due to autoreplace) to affected vehicle news. + * @note Viewports of currently displayed news is changed via #ChangeVehicleViewports. + * @param from_index The old VehicleID. + * @param to_index The new VehicleID. */ void ChangeVehicleNews(VehicleID from_index, VehicleID to_index) { @@ -396,6 +397,7 @@ } } +/** Main news loop. */ void NewsLoop() { /* no news item yet */ @@ -416,7 +418,7 @@ if (ReadyForNextItem()) MoveToNextItem(); } -/** Do a forced show of a specific message */ +/** Do a forced show of a specific message. */ void ShowNewsMessage(const NewsItem *ni) { assert(_total_news != 0); @@ -433,7 +435,7 @@ } } -/** Show previous news item */ +/** Show previous #NewsItem. */ void ShowLastNewsMessage() { const NewsItem *ni = NULL; @@ -475,14 +477,13 @@ } /** - * Draw an unformatted news message truncated to a maximum length. If - * length exceeds maximum length it will be postfixed by '...' - * @param left the left most location for the string - * @param right the right most location for the string - * @param y position of the string - * @param colour the colour the string will be shown in - * @param *ni NewsItem being printed - * @param maxw maximum width of string in pixels + * Draw an unformatted news message truncated to a maximum length. Will + * be postfixed by '...' if length exceeds maximum length. + * @param left The left most location for the string. + * @param right The right most location for the string. + * @param y Position of the string. + * @param colour The colour the string will be shown in. + * @param ni NewsItem being printed. */ void DrawNewsString(uint left, uint right, int y, TextColour colour, const NewsItem *ni) { diff --git a/src/news_func.h b/src/news_func.h --- a/src/news_func.h +++ b/src/news_func.h @@ -26,7 +26,7 @@ } /** - * Adds a newsitem referencing a vehicle. + * Adds a #NewsItem referencing a vehicle. * @warning The DParams may not reference the vehicle due to autoreplace stuff. See AddVehicleAdviceNewsItem for how that can be done. */ static inline void AddVehicleNewsItem(StringID string, NewsType type, VehicleID vehicle, StationID station = INVALID_STATION) @@ -43,11 +43,17 @@ AddNewsItem(string, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0, NR_VEHICLE, vehicle); } +/** + * Adds a #NewsItem referencing a tile. + */ static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, void *free_data = NULL) { AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, NR_NONE, UINT32_MAX, free_data); } +/** + * Adds a #NewsItem referencing an industry. + */ static inline void AddIndustryNewsItem(StringID string, NewsType type, IndustryID industry) { AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_INDUSTRY, industry); diff --git a/src/news_gui.cpp b/src/news_gui.cpp --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -33,9 +33,9 @@ #include "table/strings.h" -const NewsItem *_statusbar_news_item = NULL; +const NewsItem *_statusbar_news_item = NULL; ///< NewsItem in the status bar. -/* Normal news items. */ +/** Widget tree for normal #NewsItems. */ static const NWidgetPart _nested_normal_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1), @@ -50,6 +50,7 @@ EndContainer(), }; +/** Window description for normal #NewsItems. */ static WindowDesc _normal_news_desc( WDP_MANUAL, NULL, 0, 0, WC_NEWS_WINDOW, WC_NONE, @@ -57,7 +58,7 @@ _nested_normal_news_widgets, lengthof(_nested_normal_news_widgets) ); -/* New vehicles news items. */ +/** Widget tree for new vehicle #NewsItems. */ static const NWidgetPart _nested_vehicle_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1), @@ -77,6 +78,7 @@ EndContainer(), }; +/** Window description for new vehicle #NewsItems. */ static WindowDesc _vehicle_news_desc( WDP_MANUAL, NULL, 0, 0, WC_NEWS_WINDOW, WC_NONE, @@ -84,7 +86,7 @@ _nested_vehicle_news_widgets, lengthof(_nested_vehicle_news_widgets) ); -/* Company news items. */ +/** Widget tree for company #NewsItems. */ static const NWidgetPart _nested_company_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1), @@ -108,6 +110,7 @@ EndContainer(), }; +/** Window description for company #NewsItems. */ static WindowDesc _company_news_desc( WDP_MANUAL, NULL, 0, 0, WC_NEWS_WINDOW, WC_NONE, @@ -115,7 +118,7 @@ _nested_company_news_widgets, lengthof(_nested_company_news_widgets) ); -/* Thin news items. */ +/** Widget tree for thin #NewsItems. */ static const NWidgetPart _nested_thin_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_HORIZONTAL), SetPadding(1, 1, 0, 1), @@ -131,6 +134,7 @@ EndContainer(), }; +/** Window description for thin #NewsItems. */ static WindowDesc _thin_news_desc( WDP_MANUAL, NULL, 0, 0, WC_NEWS_WINDOW, WC_NONE, @@ -138,7 +142,7 @@ _nested_thin_news_widgets, lengthof(_nested_thin_news_widgets) ); -/* Small news items. */ +/** Widget tree for small #NewsItems. */ static const NWidgetPart _nested_small_news_widgets[] = { /* Caption + close box. The caption is no WWT_CAPTION as the window shall not be moveable and so on. */ NWidget(NWID_HORIZONTAL), @@ -155,6 +159,7 @@ EndContainer(), }; +/** Window description for small #NewsItems. */ static WindowDesc _small_news_desc( WDP_MANUAL, NULL, 0, 0, WC_NEWS_WINDOW, WC_NONE, @@ -162,9 +167,7 @@ _nested_small_news_widgets, lengthof(_nested_small_news_widgets) ); -/** - * Window layouts for news items. - */ +/** Window layouts for news items. */ static WindowDesc* _news_window_layout[] = { &_thin_news_desc, ///< NF_THIN &_small_news_desc, ///< NF_SMALL @@ -173,6 +176,11 @@ &_company_news_desc, ///< NF_COMPANY }; +/** + * Gets the relevant news window for the type of #NewsItem. + * @param flags The type of #NewsItem. + * @return Correct news window layout. + */ WindowDesc* GetNewsWindowLayout(NewsFlag flags) { uint layout = GB(flags, NFB_WINDOW_LAYOUT, NFB_WINDOW_LAYOUT_COUNT); @@ -180,7 +188,7 @@ return _news_window_layout[layout]; } -/** Window class displaying a news item. */ +/** Constructor for news windows. */ NewsWindow::NewsWindow(WindowDesc *desc, const NewsItem *ni) : Window(desc), ni(ni) { NewsWindow::duration = 555; @@ -212,6 +220,10 @@ PositionNewsMessage(this); } +/** + * Draw border for news window. + * @param r Size of border. + */ void NewsWindow::DrawNewsBorder(const Rect &r) const { GfxFillRect(r.left, r.top, r.right, r.bottom, PC_WHITE); @@ -224,7 +236,7 @@ /* virtual */ Point NewsWindow::OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) { - Point pt = { 0, _screen.height }; + Point pt = {0, _screen.height}; return pt; } @@ -400,7 +412,7 @@ /** * Moves the window so #newtop is new 'top' coordinate. Makes screen dirty where needed. - * @param newtop new top coordinate + * @param newtop new top coordinate. */ void NewsWindow::SetWindowTop(int newtop) { @@ -414,6 +426,10 @@ SetDirtyBlocks(this->left, mintop, this->left + this->width, maxtop + this->height); } +/** + * Gets formatted string for a company related #NewsItem. + * @return StringID of text. + */ StringID NewsWindow::GetCompanyMessageString() const { /* Company news with a face have a separate headline, so the normal message is shifted by two params */ @@ -421,6 +437,10 @@ return this->ni->params[1]; } +/** + * Gets formatted string for a new vehicle related #NewsItem. + * @return StringID of text. + */ StringID NewsWindow::GetNewVehicleMessageString(int widget) const { assert(this->ni->reftype1 == NR_ENGINE); @@ -442,7 +462,10 @@ /* static */ uint NewsWindow::duration = 0; // Instance creation. -/** Open up an own newspaper window for the news item */ +/** + * Open up an own newspaper window for the news item. + * @param ni News item to show. + */ void ShowNewspaper(const NewsItem *ni) { SoundFx sound = _news_type_data[ni->type].sound; @@ -451,7 +474,10 @@ new NewsWindow(GetNewsWindowLayout(ni->flags), ni); } -/** Show news item in the ticker */ +/** + * Show news item in the ticker. + * @param bi News item to show. + */ void ShowTicker(const NewsItem *ni) { if (_settings_client.sound.news_ticker) SndPlayFx(SND_16_MORSE); @@ -460,14 +486,15 @@ InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SHOW_TICKER); } +/** Window displaying message history. */ struct MessageHistoryWindow : Window { static const int top_spacing; ///< Additional spacing at the top of the #WID_MH_BACKGROUND widget. static const int bottom_spacing; ///< Additional spacing at the bottom of the #WID_MH_BACKGROUND widget. - int line_height; /// < Height of a single line in the news history window including spacing. - int date_width; /// < Width needed for the date part. + int line_height; ///< Height of a single line in the news history window including spacing. + int date_width; ///< Width needed for the date part. - Scrollbar *vscroll; + Scrollbar *vscroll; ///< Scrollbar for message history list. MessageHistoryWindow(WindowDesc *desc) : Window(desc) { @@ -560,10 +587,10 @@ this->vscroll->SetCapacityFromWidget(this, WID_MH_BACKGROUND); } }; - const int MessageHistoryWindow::top_spacing = WD_FRAMERECT_TOP + 4; const int MessageHistoryWindow::bottom_spacing = WD_FRAMERECT_BOTTOM; +/** Widget tree for message history window. */ static const NWidgetPart _nested_message_history[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -583,6 +610,7 @@ EndContainer(), }; +/** Window description for message history window. */ static WindowDesc _message_history_desc( WDP_AUTO, "list_news", 400, 140, WC_MESSAGE_HISTORY, WC_NONE, diff --git a/src/news_gui.h b/src/news_gui.h --- a/src/news_gui.h +++ b/src/news_gui.h @@ -18,7 +18,7 @@ /** Window class displaying a news item. */ struct NewsWindow : Window { uint16 chat_height; ///< Height of the chat window. - uint16 status_height; ///< Height of the status bar window + uint16 status_height; ///< Height of the status bar window. const NewsItem *ni; ///< News item to display. static uint duration; ///< Remaining time for showing current news message (may only be accessed while a news item is displayed). diff --git a/src/news_type.h b/src/news_type.h --- a/src/news_type.h +++ b/src/news_type.h @@ -30,34 +30,29 @@ MOS_BOTTOM_EDGE = 6, ///< Number of pixels between bottom edge of the window and bottom of the global options. }; -/** - * Type of news. - */ +/** Type of news. */ enum NewsType { - NT_ARRIVAL_COMPANY, ///< First vehicle arrived for company - NT_ARRIVAL_OTHER, ///< First vehicle arrived for competitor - NT_ACCIDENT, ///< An accident or disaster has occurred - NT_COMPANY_INFO, ///< Company info (new companies, bankruptcy messages) - NT_INDUSTRY_OPEN, ///< Opening of industries - NT_INDUSTRY_CLOSE, ///< Closing of industries - NT_ECONOMY, ///< Economic changes (recession, industry up/dowm) - NT_INDUSTRY_COMPANY,///< Production changes of industry serviced by local company - NT_INDUSTRY_OTHER, ///< Production changes of industry serviced by competitor(s) - NT_INDUSTRY_NOBODY, ///< Other industry production changes - NT_ADVICE, ///< Bits of news about vehicles of the company - NT_NEW_VEHICLES, ///< New vehicle has become available - NT_ACCEPTANCE, ///< A type of cargo is (no longer) accepted - NT_SUBSIDIES, ///< News about subsidies (announcements, expirations, acceptance) - NT_GENERAL, ///< General news (from towns) - NT_END, ///< end-of-array marker + NT_ARRIVAL_COMPANY, ///< First vehicle arrived for company. + NT_ARRIVAL_OTHER, ///< First vehicle arrived for competitor. + NT_ACCIDENT, ///< An accident or disaster has occurred. + NT_COMPANY_INFO, ///< Company info (new companies, bankruptcy messages). + NT_INDUSTRY_OPEN, ///< Opening of industries. + NT_INDUSTRY_CLOSE, ///< Closing of industries. + NT_ECONOMY, ///< Economic changes (recession, industry up/down). + NT_INDUSTRY_COMPANY,///< Production changes of industry serviced by local company. + NT_INDUSTRY_OTHER, ///< Production changes of industry serviced by competitor(s). + NT_INDUSTRY_NOBODY, ///< Other industry production changes. + NT_ADVICE, ///< Bits of news about vehicles of the company. + NT_NEW_VEHICLES, ///< New vehicle has become available. + NT_ACCEPTANCE, ///< A type of cargo is (no longer) accepted. + NT_SUBSIDIES, ///< News about subsidies (announcements, expirations, acceptance). + NT_GENERAL, ///< General news (from towns). + NT_END, ///< End-of-array marker. }; /** * References to objects in news. - * - * @warning - * Be careful! - * Vehicles are a special case, as news are kept when vehicles are autoreplaced/renewed. + * @warning Vehicles are a special case, as news are kept when vehicles are autoreplaced/renewed. * You have to make sure, #ChangeVehicleNews catches the DParams of your message. * This is NOT ensured by the references. */ @@ -97,22 +92,18 @@ DECLARE_ENUM_AS_BIT_SET(NewsFlag) -/** - * News display options - */ +/** News display options. */ enum NewsDisplay { - ND_OFF, ///< Only show a reminder in the status bar - ND_SUMMARY, ///< Show ticker - ND_FULL, ///< Show newspaper + ND_OFF, ///< Only show a reminder in the status bar. + ND_SUMMARY, ///< Show ticker. + ND_FULL, ///< Show newspaper. }; -/** - * Per-NewsType data - */ +/** Per-NewsType data. */ struct NewsTypeData { - const char * const name; ///< Name - const byte age; ///< Maximum age of news items (in days) - const SoundFx sound; ///< Sound + const char * const name; ///< Name. + const byte age; ///< Maximum age of news items (in days). + const SoundFx sound; ///< Sound. /** * Construct this entry. @@ -130,51 +121,49 @@ NewsDisplay GetDisplay() const; }; -/** - * Per-NewsType data - */ +/** Per-NewsType data. */ static NewsTypeData _news_type_data[] = { /* name, age, sound, */ - NewsTypeData("news_display.arrival_player", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_COMPANY - NewsTypeData("news_display.arrival_other", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_OTHER - NewsTypeData("news_display.accident", 90, SND_BEGIN ), ///< NT_ACCIDENT - NewsTypeData("news_display.company_info", 60, SND_BEGIN ), ///< NT_COMPANY_INFO - NewsTypeData("news_display.open", 90, SND_BEGIN ), ///< NT_INDUSTRY_OPEN - NewsTypeData("news_display.close", 90, SND_BEGIN ), ///< NT_INDUSTRY_CLOSE - NewsTypeData("news_display.economy", 30, SND_BEGIN ), ///< NT_ECONOMY - NewsTypeData("news_display.production_player", 30, SND_BEGIN ), ///< NT_INDUSTRY_COMPANY - NewsTypeData("news_display.production_other", 30, SND_BEGIN ), ///< NT_INDUSTRY_OTHER - NewsTypeData("news_display.production_nobody", 30, SND_BEGIN ), ///< NT_INDUSTRY_NOBODY - NewsTypeData("news_display.advice", 150, SND_BEGIN ), ///< NT_ADVICE - NewsTypeData("news_display.new_vehicles", 30, SND_1E_OOOOH ), ///< NT_NEW_VEHICLES - NewsTypeData("news_display.acceptance", 90, SND_BEGIN ), ///< NT_ACCEPTANCE - NewsTypeData("news_display.subsidies", 180, SND_BEGIN ), ///< NT_SUBSIDIES - NewsTypeData("news_display.general", 60, SND_BEGIN ), ///< NT_GENERAL + NewsTypeData("news_display.arrival_player", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_COMPANY + NewsTypeData("news_display.arrival_other", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_OTHER + NewsTypeData("news_display.accident", 90, SND_BEGIN ), ///< NT_ACCIDENT + NewsTypeData("news_display.company_info", 60, SND_BEGIN ), ///< NT_COMPANY_INFO + NewsTypeData("news_display.open", 90, SND_BEGIN ), ///< NT_INDUSTRY_OPEN + NewsTypeData("news_display.close", 90, SND_BEGIN ), ///< NT_INDUSTRY_CLOSE + NewsTypeData("news_display.economy", 30, SND_BEGIN ), ///< NT_ECONOMY + NewsTypeData("news_display.production_player", 30, SND_BEGIN ), ///< NT_INDUSTRY_COMPANY + NewsTypeData("news_display.production_other", 30, SND_BEGIN ), ///< NT_INDUSTRY_OTHER + NewsTypeData("news_display.production_nobody", 30, SND_BEGIN ), ///< NT_INDUSTRY_NOBODY + NewsTypeData("news_display.advice", 150, SND_BEGIN ), ///< NT_ADVICE + NewsTypeData("news_display.new_vehicles", 30, SND_1E_OOOOH ), ///< NT_NEW_VEHICLES + NewsTypeData("news_display.acceptance", 90, SND_BEGIN ), ///< NT_ACCEPTANCE + NewsTypeData("news_display.subsidies", 180, SND_BEGIN ), ///< NT_SUBSIDIES + NewsTypeData("news_display.general", 60, SND_BEGIN ), ///< NT_GENERAL }; assert_compile(lengthof(_news_type_data) == NT_END); /** Information about a single item of news. */ struct NewsItem { - NewsItem *prev; ///< Previous news item - NewsItem *next; ///< Next news item - StringID string_id; ///< Message text - Date date; ///< Date of the news - NewsType type; ///< Type of the news - NewsFlag flags; ///< NewsFlags bits @see NewsFlag + NewsItem *prev; ///< Previous news item. + NewsItem *next; ///< Next news item. + StringID string_id; ///< Message text. + Date date; ///< Date of the news. + NewsType type; ///< Type of the news. + NewsFlag flags; ///< NewsFlags bits. @see NewsFlag - NewsReferenceType reftype1; ///< Type of ref1 - NewsReferenceType reftype2; ///< Type of ref2 - uint32 ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted. - uint32 ref2; ///< Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted. + NewsReferenceType reftype1; ///< Type of ref1. + NewsReferenceType reftype2; ///< Type of ref2. + uint32 ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted. + uint32 ref2; ///< Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted. - void *free_data; ///< Data to be freed when the news item has reached its end. + void *free_data; ///< Data to be freed when the news item has reached its end. + + uint64 params[10]; ///< Parameters for string resolving. ~NewsItem() { free(this->free_data); } - - uint64 params[10]; ///< Parameters for string resolving. }; /** @@ -184,12 +173,12 @@ * resulting in wrong names and such. */ struct CompanyNewsInformation { - char company_name[64]; ///< The name of the company - char president_name[64]; ///< The name of the president - char other_company_name[64]; ///< The name of the company taking over this one + char company_name[64]; ///< The name of the company. + char president_name[64]; ///< The name of the president. + char other_company_name[64]; ///< The name of the company taking over this one. - uint32 face; ///< The face of the president - byte colour; ///< The colour related to the company + uint32 face; ///< The face of the president. + byte colour; ///< The colour related to the company. void FillData(const struct Company *c, const struct Company *other = NULL); };