summaryrefslogtreecommitdiff
path: root/src/news_func.h
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-06-16 17:50:18 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-07-01 19:04:38 +0200
commitaa9818db90b910b1b3d62d080f4a670a6a9d14af (patch)
treed3e76cefe6872f5c0b0b8edebef6cfed99f6bcab /src/news_func.h
parentdf601b8559b3d5de179b5b9e65ab9674fbd8bf5e (diff)
downloadopenttd-aa9818db90b910b1b3d62d080f4a670a6a9d14af.tar.xz
Codechange: create a type for the "free_data" of NewsItems and (de)allocate it with new and delete
Diffstat (limited to 'src/news_func.h')
-rw-r--r--src/news_func.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/news_func.h b/src/news_func.h
index 2131c8a74..3f21f3dca 100644
--- a/src/news_func.h
+++ b/src/news_func.h
@@ -15,7 +15,7 @@
#include "station_type.h"
#include "industry_type.h"
-void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1 = NR_NONE, uint32 ref1 = UINT32_MAX, NewsReferenceType reftype2 = NR_NONE, uint32 ref2 = UINT32_MAX, void *free_data = nullptr);
+void AddNewsItem(StringID string, NewsType type, NewsFlag flags, NewsReferenceType reftype1 = NR_NONE, uint32 ref1 = UINT32_MAX, NewsReferenceType reftype2 = NR_NONE, uint32 ref2 = UINT32_MAX, const NewsAllocatedData *data = nullptr);
static inline void AddCompanyNewsItem(StringID string, CompanyNewsInformation *cni)
{
@@ -42,9 +42,9 @@ static inline void AddVehicleAdviceNewsItem(StringID string, VehicleID vehicle)
AddNewsItem(string, NT_ADVICE, NF_INCOLOUR | NF_SMALL | NF_VEHICLE_PARAM0, NR_VEHICLE, vehicle);
}
-static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, void *free_data = nullptr, StationID station = INVALID_STATION)
+static inline void AddTileNewsItem(StringID string, NewsType type, TileIndex tile, const NewsAllocatedData *data = nullptr, StationID station = INVALID_STATION)
{
- AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, station == INVALID_STATION ? NR_NONE : NR_STATION, station, free_data);
+ AddNewsItem(string, type, NF_NO_TRANSPARENT | NF_SHADE | NF_THIN, NR_TILE, tile, station == INVALID_STATION ? NR_NONE : NR_STATION, station, data);
}
static inline void AddIndustryNewsItem(StringID string, NewsType type, IndustryID industry)