1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

(svn r24276) -Codechange: Enhance GRFFile with constructor and destructor.

This commit is contained in:
frosch
2012-05-25 20:54:54 +00:00
parent e1617a3d10
commit b8f6b300d6
2 changed files with 36 additions and 24 deletions

View File

@@ -16,6 +16,7 @@
#include "rail_type.h"
#include "fileio_type.h"
#include "core/bitmath_func.hpp"
#include "core/alloc_type.hpp"
/**
* List of different canal 'features'.
@@ -98,7 +99,7 @@ struct GRFLabel {
};
/** Dynamic data of a loaded NewGRF */
struct GRFFile {
struct GRFFile : ZeroedMemoryAllocator {
char *filename;
bool is_ottdfile;
uint32 grfid;
@@ -138,6 +139,9 @@ struct GRFFile {
uint32 grf_features; ///< Bitset of GrfSpecFeature the grf uses
PriceMultipliers price_base_multipliers; ///< Price base multipliers as set by the grf.
GRFFile(const struct GRFConfig *config);
~GRFFile();
/** Get GRF Parameter with range checking */
uint32 GetParam(uint number) const
{