mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 15:41:15 +00:00
(svn r9994) -Codechange: Add pointers for Industry and Industry Tiles in the grf file.
This commit is contained in:
parent
8d82deffa1
commit
86abe1b229
@ -4304,6 +4304,43 @@ static void ResetCustomHouses()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ResetCustomIndustries()
|
||||||
|
{
|
||||||
|
GRFFile *file;
|
||||||
|
|
||||||
|
for (file = _first_grffile; file != NULL; file = file->next) {
|
||||||
|
uint i;
|
||||||
|
/* We are verifiying both tiles and industries specs loaded from the grf file
|
||||||
|
* First, let's deal with industryspec */
|
||||||
|
if (file->industryspec != NULL) {
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_INDUSTRYTYPES; i++) {
|
||||||
|
IndustrySpec *ind = file->industryspec[i];
|
||||||
|
|
||||||
|
if (ind != NULL) {
|
||||||
|
free(ind);
|
||||||
|
ind = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(file->industryspec);
|
||||||
|
file->industryspec = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file->indtspec != NULL) {
|
||||||
|
for (i = 0; i < NUM_INDUSTRYTILES; i++) {
|
||||||
|
if (file->indtspec[i] != NULL) {
|
||||||
|
free(file->indtspec[i]);
|
||||||
|
file->indtspec[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
free(file->indtspec);
|
||||||
|
file->indtspec = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ResetNewGRF()
|
static void ResetNewGRF()
|
||||||
{
|
{
|
||||||
GRFFile *next;
|
GRFFile *next;
|
||||||
@ -4370,6 +4407,7 @@ static void ResetNewGRFData()
|
|||||||
ResetHouses();
|
ResetHouses();
|
||||||
|
|
||||||
/* Reset the industries structures*/
|
/* Reset the industries structures*/
|
||||||
|
ResetCustomIndustries();
|
||||||
ResetIndustries();
|
ResetIndustries();
|
||||||
|
|
||||||
/* Reset station classes */
|
/* Reset station classes */
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "newgrf_config.h"
|
#include "newgrf_config.h"
|
||||||
#include "helpers.hpp"
|
#include "helpers.hpp"
|
||||||
#include "cargotype.h"
|
#include "cargotype.h"
|
||||||
|
#include "industry.h"
|
||||||
|
|
||||||
enum GrfLoadingStage {
|
enum GrfLoadingStage {
|
||||||
GLS_FILESCAN,
|
GLS_FILESCAN,
|
||||||
@ -69,6 +70,8 @@ struct GRFFile {
|
|||||||
|
|
||||||
StationSpec **stations;
|
StationSpec **stations;
|
||||||
HouseSpec **housespec;
|
HouseSpec **housespec;
|
||||||
|
IndustrySpec **industryspec;
|
||||||
|
IndustryTileSpec **indtspec;
|
||||||
|
|
||||||
uint32 param[0x80];
|
uint32 param[0x80];
|
||||||
uint param_end; ///< one more than the highest set parameter
|
uint param_end; ///< one more than the highest set parameter
|
||||||
|
Loading…
Reference in New Issue
Block a user