1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 02:15:22 +02:00

Various random code cleanups

This commit is contained in:
sfan5
2025-03-01 11:53:37 +01:00
parent 358658fa34
commit 7892541383
73 changed files with 216 additions and 285 deletions

View File

@@ -37,7 +37,7 @@
#include "cavegen.h"
#include "dungeongen.h"
FlagDesc flagdesc_mapgen[] = {
const FlagDesc flagdesc_mapgen[] = {
{"caves", MG_CAVES},
{"dungeons", MG_DUNGEONS},
{"light", MG_LIGHT},
@@ -47,7 +47,7 @@ FlagDesc flagdesc_mapgen[] = {
{NULL, 0}
};
FlagDesc flagdesc_gennotify[] = {
const FlagDesc flagdesc_gennotify[] = {
{"dungeon", 1 << GENNOTIFY_DUNGEON},
{"temple", 1 << GENNOTIFY_TEMPLE},
{"cave_begin", 1 << GENNOTIFY_CAVE_BEGIN},

View File

@@ -29,8 +29,8 @@ class Settings;
class MMVManip;
class NodeDefManager;
extern FlagDesc flagdesc_mapgen[];
extern FlagDesc flagdesc_gennotify[];
extern const FlagDesc flagdesc_mapgen[];
extern const FlagDesc flagdesc_gennotify[];
class Biome;
class BiomeGen;

View File

@@ -24,7 +24,7 @@
#include "mapgen_carpathian.h"
FlagDesc flagdesc_mapgen_carpathian[] = {
const FlagDesc flagdesc_mapgen_carpathian[] = {
{"caverns", MGCARPATHIAN_CAVERNS},
{"rivers", MGCARPATHIAN_RIVERS},
{NULL, 0}

View File

@@ -12,7 +12,7 @@
class BiomeManager;
extern FlagDesc flagdesc_mapgen_carpathian[];
extern const FlagDesc flagdesc_mapgen_carpathian[];
struct MapgenCarpathianParams : public MapgenParams

View File

@@ -23,7 +23,7 @@
#include "mapgen_flat.h"
FlagDesc flagdesc_mapgen_flat[] = {
const FlagDesc flagdesc_mapgen_flat[] = {
{"lakes", MGFLAT_LAKES},
{"hills", MGFLAT_HILLS},
{"caverns", MGFLAT_CAVERNS},

View File

@@ -14,7 +14,7 @@
class BiomeManager;
extern FlagDesc flagdesc_mapgen_flat[];
extern const FlagDesc flagdesc_mapgen_flat[];
struct MapgenFlatParams : public MapgenParams
{

View File

@@ -24,7 +24,7 @@
#include "mapgen_fractal.h"
FlagDesc flagdesc_mapgen_fractal[] = {
const FlagDesc flagdesc_mapgen_fractal[] = {
{"terrain", MGFRACTAL_TERRAIN},
{NULL, 0}
};

View File

@@ -12,7 +12,7 @@
class BiomeManager;
extern FlagDesc flagdesc_mapgen_fractal[];
extern const FlagDesc flagdesc_mapgen_fractal[];
struct MapgenFractalParams : public MapgenParams

View File

@@ -23,7 +23,7 @@
#include "mapgen_v5.h"
FlagDesc flagdesc_mapgen_v5[] = {
const FlagDesc flagdesc_mapgen_v5[] = {
{"caverns", MGV5_CAVERNS},
{NULL, 0}
};

View File

@@ -12,7 +12,7 @@
class BiomeManager;
extern FlagDesc flagdesc_mapgen_v5[];
extern const FlagDesc flagdesc_mapgen_v5[];
struct MapgenV5Params : public MapgenParams
{

View File

@@ -25,7 +25,7 @@
#include "mapgen_v6.h"
FlagDesc flagdesc_mapgen_v6[] = {
const FlagDesc flagdesc_mapgen_v6[] = {
{"jungles", MGV6_JUNGLES},
{"biomeblend", MGV6_BIOMEBLEND},
{"mudflow", MGV6_MUDFLOW},

View File

@@ -27,7 +27,7 @@
#define MGV6_TEMPLES 0x40
extern FlagDesc flagdesc_mapgen_v6[];
extern const FlagDesc flagdesc_mapgen_v6[];
enum BiomeV6Type

View File

@@ -24,7 +24,7 @@
#include "mapgen_v7.h"
FlagDesc flagdesc_mapgen_v7[] = {
const FlagDesc flagdesc_mapgen_v7[] = {
{"mountains", MGV7_MOUNTAINS},
{"ridges", MGV7_RIDGES},
{"floatlands", MGV7_FLOATLANDS},

View File

@@ -16,7 +16,7 @@
class BiomeManager;
extern FlagDesc flagdesc_mapgen_v7[];
extern const FlagDesc flagdesc_mapgen_v7[];
struct MapgenV7Params : public MapgenParams {

View File

@@ -32,7 +32,7 @@ Licensing changed by permission of Gael de Sailly.
#include <cmath>
FlagDesc flagdesc_mapgen_valleys[] = {
const FlagDesc flagdesc_mapgen_valleys[] = {
{"altitude_chill", MGVALLEYS_ALT_CHILL},
{"humid_rivers", MGVALLEYS_HUMID_RIVERS},
{"vary_river_depth", MGVALLEYS_VARY_RIVER_DEPTH},

View File

@@ -24,7 +24,7 @@ Licensing changed by permission of Gael de Sailly.
class BiomeManager;
class BiomeGenOriginal;
extern FlagDesc flagdesc_mapgen_valleys[];
extern const FlagDesc flagdesc_mapgen_valleys[];
struct MapgenValleysParams : public MapgenParams {

View File

@@ -15,7 +15,7 @@
#include "mapgen/treegen.h"
FlagDesc flagdesc_deco[] = {
const FlagDesc flagdesc_deco[] = {
{"place_center_x", DECO_PLACE_CENTER_X},
{"place_center_y", DECO_PLACE_CENTER_Y},
{"place_center_z", DECO_PLACE_CENTER_Z},

View File

@@ -33,7 +33,7 @@ enum DecorationType {
#define DECO_ALL_FLOORS 0x40
#define DECO_ALL_CEILINGS 0x80
extern FlagDesc flagdesc_deco[];
extern const FlagDesc flagdesc_deco[];
class Decoration : public ObjDef, public NodeResolver {

View File

@@ -13,7 +13,7 @@
#include <algorithm>
FlagDesc flagdesc_ore[] = {
const FlagDesc flagdesc_ore[] = {
{"absheight", OREFLAG_ABSHEIGHT}, // Non-functional
{"puff_cliffs", OREFLAG_PUFF_CLIFFS},
{"puff_additive_composition", OREFLAG_PUFF_ADDITIVE},
@@ -324,7 +324,7 @@ void OrePuff::generate(MMVManip *vm, int mapseed, u32 blockseed,
int y1 = ymid + ntop;
if ((flags & OREFLAG_PUFF_ADDITIVE) && (y0 > y1))
SWAP(int, y0, y1);
std::swap(y0, y1);
for (int y = y0; y <= y1; y++) {
u32 i = vm->m_area.index(x, y, z);

View File

@@ -33,7 +33,7 @@ enum OreType {
ORE_STRATUM,
};
extern FlagDesc flagdesc_ore[];
extern const FlagDesc flagdesc_ore[];
class Ore : public ObjDef, public NodeResolver {
public:

View File

@@ -127,7 +127,7 @@ void Schematic::blitToVManip(MMVManip *vm, v3s16 p, Rotation rot, bool force_pla
i_start = sx - 1;
i_step_x = zstride;
i_step_z = -xstride;
SWAP(s16, sx, sz);
std::swap(sx, sz);
break;
case ROTATE_180:
i_start = zstride * (sz - 1) + sx - 1;
@@ -138,7 +138,7 @@ void Schematic::blitToVManip(MMVManip *vm, v3s16 p, Rotation rot, bool force_pla
i_start = zstride * (sz - 1);
i_step_x = -zstride;
i_step_z = xstride;
SWAP(s16, sx, sz);
std::swap(sx, sz);
break;
default:
i_start = 0;
@@ -222,7 +222,6 @@ void Schematic::placeOnMap(ServerMap *map, v3s16 p, u32 flags,
Rotation rot, bool force_place)
{
std::map<v3s16, MapBlock *> modified_blocks;
std::map<v3s16, MapBlock *>::iterator it;
assert(map != NULL);
assert(schemdata != NULL);