Project

General

Profile

Feature #1395 ยป 0049-tiledef.-ch-Add-mostly-dummy-module.patch

Marko Lindqvist, 05/17/2025 03:03 AM

View differences:

common/Makefile.am
terrain.h \
tile.c \
tile.h \
tiledef.c \
tiledef.h \
traderoutes.c \
traderoutes.h \
traits.h \
common/extras.h
}
#endif /* __cplusplus */
#endif /* FC__EXTRAS_H */
#endif /* FC__EXTRAS_H */
common/fc_types.h
#define MAX_ACHIEVEMENT_TYPES 40
#define MAX_NUM_ACTION_AUTO_PERFORMERS 12
#define MAX_NUM_MULTIPLIERS 50
#define MAX_TILEDEFS 8
#define MAX_NUM_LEADERS MAX_NUM_ITEMS /* Used in the network protocol. */
#define MAX_NUM_NATION_SETS 32 /* Used in the network protocol.
* RULESET_NATION_SETS packet may become too big
common/game.c
#include "style.h"
#include "tech.h"
#include "terrain.h"
#include "tiledef.h"
#include "traderoutes.h"
#include "unit.h"
#include "unitlist.h"
......
trade_route_types_init();
terrains_init();
extras_init();
tiledefs_init();
goods_init();
improvements_init();
techs_init();
......
role_unit_precalcs_free();
improvements_free();
goods_free();
tiledefs_free();
extras_free();
music_styles_free();
city_styles_free();
common/tiledef.c
/****************************************************************************
Freeciv - Copyright (C) 2004 - The Freeciv Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
****************************************************************************/
#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif
#include "tiledef.h"
static struct tiledef tiledefs[MAX_TILEDEFS];
/************************************************************************//**
Initialize tiledef structures.
****************************************************************************/
void tiledefs_init(void)
{
int i;
for (i = 0; i < MAX_TILEDEFS; i++) {
tiledefs[i].id = i;
tiledefs[i].extras = extra_type_list_new();
}
}
/************************************************************************//**
Free the memory associated with tiledef
****************************************************************************/
void tiledefs_free(void)
{
int i;
for (i = 0; i < MAX_TILEDEFS; i++) {
extra_type_list_destroy(tiledefs[i].extras);
}
}
common/tiledef.h
/***********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef FC__TILEDEF_H
#define FC__TILEDEF_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* common */
#include "extras.h"
struct tiledef
{
int id;
struct name_translation name;
struct extra_type_list *extras;
};
void tiledefs_init(void);
void tiledefs_free(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FC__TILEDEF_H */
meson.build
'common/tech.c',
'common/terrain.c',
'common/tile.c',
'common/tiledef.c',
'common/traderoutes.c',
'common/unit.c',
'common/unitlist.c',
    (1-1/1)