diff options
author | rubidium <rubidium@openttd.org> | 2008-05-13 10:17:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-13 10:17:04 +0000 |
commit | d0c79e1164b912644bc0260910bffd88cf2d0cf5 (patch) | |
tree | 5c7ccb204d4278fc86a352be079b38923bb69dab /src/news_gui.cpp | |
parent | d0033bfb077a961d8d7bf6bc9f29b1251643201c (diff) | |
download | openttd-d0c79e1164b912644bc0260910bffd88cf2d0cf5.tar.xz |
(svn r13065) -Codechange: remove the need for the news string callbacks. Patch by Cirdan.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r-- | src/news_gui.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 7a9ecb289..509d058b9 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -78,20 +78,11 @@ void DrawNewsNewVehicleAvail(Window *w, const NewsItem *ni); void DrawNewsBankrupcy(Window *w, const NewsItem *ni); static void MoveToNextItem(); -StringID GetNewsStringNewVehicleAvail(const NewsItem *ni); -StringID GetNewsStringBankrupcy(const NewsItem *ni); - static DrawNewsCallbackProc * const _draw_news_callback[] = { DrawNewsNewVehicleAvail, ///< DNC_VEHICLEAVAIL DrawNewsBankrupcy, ///< DNC_BANKRUPCY }; -extern GetNewsStringCallbackProc * const _get_news_string_callback[]; -GetNewsStringCallbackProc * const _get_news_string_callback[] = { - GetNewsStringNewVehicleAvail, ///< DNC_VEHICLEAVAIL - GetNewsStringBankrupcy, ///< DNC_BANKRUPCY -}; - /** Initialize the news-items data structures */ void InitNewsItemStructs() { @@ -607,12 +598,8 @@ static void DrawNewsString(int x, int y, uint16 color, const NewsItem *ni, uint char buffer[512], buffer2[512]; StringID str; - if (ni->display_mode == NM_CALLBACK) { - str = _get_news_string_callback[ni->callback](ni); - } else { - CopyInDParam(0, ni->params, lengthof(ni->params)); - str = ni->string_id; - } + CopyInDParam(0, ni->params, lengthof(ni->params)); + str = ni->string_id; GetString(buffer, str, lastof(buffer)); /* Copy the just gotten string to another buffer to remove any formatting |