OpenClonk
C4SLandscape Class Reference

#include <C4Scenario.h>

Collaboration diagram for C4SLandscape:
[legend]

Public Member Functions

void Default ()
 
void GetMapSize (int32_t &rWdt, int32_t &rHgt, int32_t iPlayerNum)
 
void CompileFunc (StdCompiler *pComp)
 

Public Attributes

bool ExactLandscape
 
C4SVal VegLevel
 
C4IDList Vegetation
 
C4SVal InEarthLevel
 
C4IDList InEarth
 
int32_t BottomOpen
 
int32_t TopOpen
 
int32_t LeftOpen
 
int32_t RightOpen
 
int32_t AutoScanSideOpen
 
std::string SkyDef
 
int32_t SkyDefFade [6]
 
bool NoScan
 
C4SVal Gravity
 
C4SVal MapWdt
 
C4SVal MapHgt
 
C4SVal MapZoom
 
C4SVal Amplitude
 
C4SVal Phase
 
C4SVal Period
 
C4SVal Random
 
C4SVal LiquidLevel
 
int32_t MapPlayerExtend
 
C4NameList Layers
 
std::string Material
 
std::string Liquid
 
bool KeepMapCreator
 
int32_t SkyScrollMode
 
int32_t MaterialZoom
 
bool FlatChunkShapes
 
bool Secret
 

Detailed Description

Definition at line 162 of file C4Scenario.h.

Member Function Documentation

◆ CompileFunc()

void C4SLandscape::CompileFunc ( StdCompiler pComp)

Definition at line 328 of file C4Scenario.cpp.

References C4SVal::C4SVal(), mkArrayAdaptDM, mkNamingAdapt(), mkStringAdaptA(), Random(), and StdCompiler::Value().

329 {
330  pComp->Value(mkNamingAdapt(ExactLandscape, "ExactLandscape", false));
331  pComp->Value(mkNamingAdapt(Vegetation, "Vegetation", C4IDList()));
332  pComp->Value(mkNamingAdapt(VegLevel, "VegetationLevel", C4SVal(50,30,0,100), true));
333  pComp->Value(mkNamingAdapt(InEarth, "InEarth", C4IDList()));
334  pComp->Value(mkNamingAdapt(InEarthLevel, "InEarthLevel", C4SVal(50,0,0,100), true));
335  pComp->Value(mkNamingAdapt(mkStringAdaptA(SkyDef), "Sky", ""));
336  pComp->Value(mkNamingAdapt(mkArrayAdaptDM(SkyDefFade,0),"SkyFade" ));
337  pComp->Value(mkNamingAdapt(BottomOpen, "BottomOpen", 0));
338  pComp->Value(mkNamingAdapt(TopOpen, "TopOpen", 1));
339  pComp->Value(mkNamingAdapt(LeftOpen, "LeftOpen", 0));
340  pComp->Value(mkNamingAdapt(RightOpen, "RightOpen", 0));
341  pComp->Value(mkNamingAdapt(AutoScanSideOpen, "AutoScanSideOpen", 1));
342  pComp->Value(mkNamingAdapt(MapWdt, "MapWidth", C4SVal(100,0,64,250), true));
343  pComp->Value(mkNamingAdapt(MapHgt, "MapHeight", C4SVal(50,0,40,250), true));
344  pComp->Value(mkNamingAdapt(MapZoom, "MapZoom", C4SVal(8,0,1,15), true));
345  pComp->Value(mkNamingAdapt(Amplitude, "Amplitude", C4SVal(0)));
346  pComp->Value(mkNamingAdapt(Phase, "Phase", C4SVal(50)));
347  pComp->Value(mkNamingAdapt(Period, "Period", C4SVal(15)));
348  pComp->Value(mkNamingAdapt(Random, "Random", C4SVal(0)));
349  pComp->Value(mkNamingAdapt(mkStringAdaptA(Material),"Material", "Earth"));
350  pComp->Value(mkNamingAdapt(mkStringAdaptA(Liquid), "Liquid", "Water"));
351  pComp->Value(mkNamingAdapt(LiquidLevel, "LiquidLevel", C4SVal()));
352  pComp->Value(mkNamingAdapt(MapPlayerExtend, "MapPlayerExtend", 0));
353  pComp->Value(mkNamingAdapt(Layers, "Layers", C4NameList()));
354  pComp->Value(mkNamingAdapt(Gravity, "Gravity", C4SVal(100,0,10,200), true));
355  pComp->Value(mkNamingAdapt(NoScan, "NoScan", false));
356  pComp->Value(mkNamingAdapt(KeepMapCreator, "KeepMapCreator", false));
357  pComp->Value(mkNamingAdapt(SkyScrollMode, "SkyScrollMode", 0));
358  pComp->Value(mkNamingAdapt(MaterialZoom, "MaterialZoom", 4));
359  pComp->Value(mkNamingAdapt(FlatChunkShapes, "FlatChunkShapes", false));
360  pComp->Value(mkNamingAdapt(Secret, "Secret", false));
361 }
std::string Liquid
Definition: C4Scenario.h:184
std::string Material
Definition: C4Scenario.h:183
int32_t MapPlayerExtend
Definition: C4Scenario.h:181
int32_t MaterialZoom
Definition: C4Scenario.h:187
C4SVal Gravity
Definition: C4Scenario.h:176
C4IDList Vegetation
Definition: C4Scenario.h:167
C4SVal MapWdt
Definition: C4Scenario.h:178
int32_t TopOpen
Definition: C4Scenario.h:170
int32_t SkyScrollMode
Definition: C4Scenario.h:186
bool ExactLandscape
Definition: C4Scenario.h:165
StdStdStringAdapt mkStringAdaptA(std::string &string)
Definition: StdAdaptors.h:209
C4SVal InEarthLevel
Definition: C4Scenario.h:168
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
int32_t AutoScanSideOpen
Definition: C4Scenario.h:172
C4SVal MapZoom
Definition: C4Scenario.h:178
C4SVal Period
Definition: C4Scenario.h:179
int32_t BottomOpen
Definition: C4Scenario.h:170
int32_t LeftOpen
Definition: C4Scenario.h:171
int32_t SkyDefFade[6]
Definition: C4Scenario.h:174
void Value(const T &rStruct)
Definition: StdCompiler.h:161
C4SVal Phase
Definition: C4Scenario.h:179
#define mkArrayAdaptDM(A, D)
Definition: StdAdaptors.h:381
bool FlatChunkShapes
Definition: C4Scenario.h:188
C4SVal Random
Definition: C4Scenario.h:179
C4IDList InEarth
Definition: C4Scenario.h:169
C4SVal MapHgt
Definition: C4Scenario.h:178
int32_t RightOpen
Definition: C4Scenario.h:171
C4SVal Amplitude
Definition: C4Scenario.h:179
C4SVal VegLevel
Definition: C4Scenario.h:166
C4NameList Layers
Definition: C4Scenario.h:182
bool KeepMapCreator
Definition: C4Scenario.h:185
std::string SkyDef
Definition: C4Scenario.h:173
C4SVal LiquidLevel
Definition: C4Scenario.h:180
Here is the call graph for this function:

◆ Default()

void C4SLandscape::Default ( )

Definition at line 286 of file C4Scenario.cpp.

References Random().

Referenced by c4_mapgen_handle_new(), and c4_mapgen_handle_new_script().

287 {
288  BottomOpen=0; TopOpen=1;
289  LeftOpen=0; RightOpen=0;
291  SkyDef[0]=0;
292  for (int & cnt : SkyDefFade) cnt=0;
293  VegLevel.Set(50,30,0,100);
295  InEarthLevel.Set(50,0,0,100);
296  InEarth.Default();
297  MapWdt.Set(100,0,64,250);
298  MapHgt.Set(50,0,40,250);
299  MapZoom.Set(8,0,1,15);
300  Amplitude.Set(0,0);
301  Phase.Set(50);
302  Period.Set(15);
303  Random.Set(0);
305  MapPlayerExtend=0;
306  Layers.Clear();
307  Material = "Earth";
308  Liquid = "Water";
309  ExactLandscape=false;
310  Gravity.Set(100,0,10,200);
311  NoScan=false;
312  KeepMapCreator=false;
313  SkyScrollMode=0;
314  MaterialZoom=4;
315  FlatChunkShapes=false;
316  Secret=false;
317 }
std::string Liquid
Definition: C4Scenario.h:184
void Default()
Definition: C4Scenario.cpp:55
std::string Material
Definition: C4Scenario.h:183
int32_t MapPlayerExtend
Definition: C4Scenario.h:181
int32_t MaterialZoom
Definition: C4Scenario.h:187
void Set(int32_t std=0, int32_t rnd=0, int32_t min=0, int32_t max=100)
Definition: C4Scenario.cpp:36
C4SVal Gravity
Definition: C4Scenario.h:176
C4IDList Vegetation
Definition: C4Scenario.h:167
C4SVal MapWdt
Definition: C4Scenario.h:178
int32_t TopOpen
Definition: C4Scenario.h:170
int32_t SkyScrollMode
Definition: C4Scenario.h:186
bool ExactLandscape
Definition: C4Scenario.h:165
C4SVal InEarthLevel
Definition: C4Scenario.h:168
int32_t AutoScanSideOpen
Definition: C4Scenario.h:172
void Default()
Definition: stub-handle.cpp:63
C4SVal MapZoom
Definition: C4Scenario.h:178
C4SVal Period
Definition: C4Scenario.h:179
int32_t BottomOpen
Definition: C4Scenario.h:170
int32_t LeftOpen
Definition: C4Scenario.h:171
int32_t SkyDefFade[6]
Definition: C4Scenario.h:174
C4SVal Phase
Definition: C4Scenario.h:179
bool FlatChunkShapes
Definition: C4Scenario.h:188
C4SVal Random
Definition: C4Scenario.h:179
C4IDList InEarth
Definition: C4Scenario.h:169
C4SVal MapHgt
Definition: C4Scenario.h:178
int32_t RightOpen
Definition: C4Scenario.h:171
C4SVal Amplitude
Definition: C4Scenario.h:179
C4SVal VegLevel
Definition: C4Scenario.h:166
C4NameList Layers
Definition: C4Scenario.h:182
bool KeepMapCreator
Definition: C4Scenario.h:185
std::string SkyDef
Definition: C4Scenario.h:173
C4SVal LiquidLevel
Definition: C4Scenario.h:180
void Clear()
Definition: C4NameList.cpp:23
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMapSize()

void C4SLandscape::GetMapSize ( int32_t &  rWdt,
int32_t &  rHgt,
int32_t  iPlayerNum 
)

Definition at line 319 of file C4Scenario.cpp.

References C4S_MaxMapPlayerExtend.

Referenced by C4Landscape::P::CreateMap(), C4MCMap::Default(), and C4MapScriptHost::InitializeMap().

320 {
321  rWdt = MapWdt.Evaluate();
322  rHgt = MapHgt.Evaluate();
323  iPlayerNum = std::max<int32_t>( iPlayerNum, 1 );
324  if (MapPlayerExtend)
325  rWdt = std::min(rWdt * std::min(iPlayerNum, C4S_MaxMapPlayerExtend), MapWdt.Max);
326 }
int32_t Max
Definition: C4Scenario.h:31
int32_t MapPlayerExtend
Definition: C4Scenario.h:181
C4SVal MapWdt
Definition: C4Scenario.h:178
C4SVal MapHgt
Definition: C4Scenario.h:178
int32_t Evaluate()
Definition: C4Scenario.cpp:50
const int32_t C4S_MaxMapPlayerExtend
Definition: C4Scenario.h:139
Here is the caller graph for this function:

Member Data Documentation

◆ Amplitude

C4SVal C4SLandscape::Amplitude

Definition at line 179 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ AutoScanSideOpen

int32_t C4SLandscape::AutoScanSideOpen

Definition at line 172 of file C4Scenario.h.

Referenced by C4Landscape::P::InitBorderPix().

◆ BottomOpen

int32_t C4SLandscape::BottomOpen

Definition at line 170 of file C4Scenario.h.

Referenced by C4Landscape::P::InitBorderPix().

◆ ExactLandscape

bool C4SLandscape::ExactLandscape

Definition at line 165 of file C4Scenario.h.

Referenced by C4Landscape::Init().

◆ FlatChunkShapes

bool C4SLandscape::FlatChunkShapes

◆ Gravity

C4SVal C4SLandscape::Gravity

Definition at line 176 of file C4Scenario.h.

Referenced by C4Landscape::ScenarioInit().

◆ InEarth

C4IDList C4SLandscape::InEarth

Definition at line 169 of file C4Scenario.h.

Referenced by C4Game::InitInEarth().

◆ InEarthLevel

C4SVal C4SLandscape::InEarthLevel

Definition at line 168 of file C4Scenario.h.

Referenced by C4Game::InitInEarth().

◆ KeepMapCreator

bool C4SLandscape::KeepMapCreator

Definition at line 185 of file C4Scenario.h.

Referenced by C4Landscape::PostInitMap().

◆ Layers

C4NameList C4SLandscape::Layers

Definition at line 182 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ LeftOpen

int32_t C4SLandscape::LeftOpen

Definition at line 171 of file C4Scenario.h.

Referenced by C4Landscape::P::InitBorderPix().

◆ Liquid

std::string C4SLandscape::Liquid

Definition at line 184 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ LiquidLevel

C4SVal C4SLandscape::LiquidLevel

Definition at line 180 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ MapHgt

C4SVal C4SLandscape::MapHgt

◆ MapPlayerExtend

int32_t C4SLandscape::MapPlayerExtend

◆ MapWdt

C4SVal C4SLandscape::MapWdt

◆ MapZoom

C4SVal C4SLandscape::MapZoom

Definition at line 178 of file C4Scenario.h.

Referenced by C4Player::ScenarioInit().

◆ Material

std::string C4SLandscape::Material

Definition at line 183 of file C4Scenario.h.

Referenced by C4MapCreator::Create(), and C4Game::InitMaterialTexture().

◆ MaterialZoom

int32_t C4SLandscape::MaterialZoom

Definition at line 187 of file C4Scenario.h.

Referenced by C4LandscapeRenderGL::Draw().

◆ NoScan

bool C4SLandscape::NoScan

Definition at line 175 of file C4Scenario.h.

◆ Period

C4SVal C4SLandscape::Period

Definition at line 179 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ Phase

C4SVal C4SLandscape::Phase

Definition at line 179 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ Random

C4SVal C4SLandscape::Random

Definition at line 179 of file C4Scenario.h.

Referenced by C4MapCreator::Create().

◆ RightOpen

int32_t C4SLandscape::RightOpen

Definition at line 171 of file C4Scenario.h.

Referenced by C4Landscape::P::InitBorderPix().

◆ Secret

bool C4SLandscape::Secret

Definition at line 189 of file C4Scenario.h.

Referenced by C4Viewport::Execute().

◆ SkyDef

std::string C4SLandscape::SkyDef

Definition at line 173 of file C4Scenario.h.

Referenced by C4Sky::Init(), and C4Game::LoadScenarioSection().

◆ SkyDefFade

int32_t C4SLandscape::SkyDefFade[6]

Definition at line 174 of file C4Scenario.h.

Referenced by C4Sky::Init().

◆ SkyScrollMode

int32_t C4SLandscape::SkyScrollMode

Definition at line 186 of file C4Scenario.h.

Referenced by C4Sky::Init().

◆ TopOpen

int32_t C4SLandscape::TopOpen

Definition at line 170 of file C4Scenario.h.

Referenced by C4Landscape::P::InitBorderPix().

◆ Vegetation

C4IDList C4SLandscape::Vegetation

Definition at line 167 of file C4Scenario.h.

Referenced by C4Game::InitVegetation().

◆ VegLevel

C4SVal C4SLandscape::VegLevel

Definition at line 166 of file C4Scenario.h.

Referenced by C4Game::InitVegetation().


The documentation for this class was generated from the following files: