summaryrefslogtreecommitdiff
path: root/src/newgrf_config.h
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-03-03 18:47:46 +0000
committeryexo <yexo@openttd.org>2011-03-03 18:47:46 +0000
commit93533b603abf5423cadc0dd02b0ae31ec5b95f7b (patch)
tree00aa791096d399a24d36ab2078d93c6153a9b975 /src/newgrf_config.h
parent21cc2da71a4c0679c8ba31b5fc90c3850838ec34 (diff)
downloadopenttd-93533b603abf5423cadc0dd02b0ae31ec5b95f7b.tar.xz
(svn r22162) -Fix [FS#4533]: No update of NewGRF window when unknown GRF name becomes available
Diffstat (limited to 'src/newgrf_config.h')
-rw-r--r--src/newgrf_config.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/newgrf_config.h b/src/newgrf_config.h
index f6c97c42c..ad406a9e1 100644
--- a/src/newgrf_config.h
+++ b/src/newgrf_config.h
@@ -15,6 +15,7 @@
#include "strings_type.h"
#include "core/alloc_type.hpp"
#include "core/smallmap_type.hpp"
+#include "misc/countedptr.hpp"
/** GRF config bit flags */
enum GCF_Flags {
@@ -129,6 +130,14 @@ struct GRFParameterInfo {
void SetValue(struct GRFConfig *config, uint32 value);
};
+/** Reference counted wrapper around a GRFText pointer. */
+struct GRFTextWrapper : public SimpleCountedObject {
+ struct GRFText *text; ///< The actual text
+
+ GRFTextWrapper();
+ ~GRFTextWrapper();
+};
+
/** Information about GRF, used in the game and (part of it) in savegames */
struct GRFConfig : ZeroedMemoryAllocator {
GRFConfig(const char *filename = NULL);
@@ -138,8 +147,8 @@ struct GRFConfig : ZeroedMemoryAllocator {
GRFIdentifier ident; ///< grfid and md5sum to uniquely identify newgrfs
uint8 original_md5sum[16]; ///< MD5 checksum of original file if only a 'compatible' file was loaded
char *filename; ///< Filename - either with or without full path
- struct GRFText *name; ///< NOSAVE: GRF name (Action 0x08)
- struct GRFText *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08)
+ GRFTextWrapper *name; ///< NOSAVE: GRF name (Action 0x08)
+ GRFTextWrapper *info; ///< NOSAVE: GRF info (author, copyright, ...) (Action 0x08)
GRFError *error; ///< NOSAVE: Error/Warning during GRF loading (Action 0x0B)
uint32 version; ///< NOSAVE: Version a NewGRF can set so only the newest NewGRF is shown
@@ -198,7 +207,7 @@ void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFC
#ifdef ENABLE_NETWORK
/* For communication about GRFs over the network */
#define UNKNOWN_GRF_NAME_PLACEHOLDER "<Unknown>"
-char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create);
+GRFTextWrapper *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create);
#endif /* ENABLE_NETWORK */
#endif /* NEWGRF_CONFIG_H */