OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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
 
bool 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 160 of file C4Scenario.h.

Member Function Documentation

void C4SLandscape::CompileFunc ( StdCompiler pComp)

Definition at line 326 of file C4Scenario.cpp.

References Amplitude, AutoScanSideOpen, BottomOpen, ExactLandscape, FlatChunkShapes, Gravity, InEarth, InEarthLevel, KeepMapCreator, Layers, LeftOpen, Liquid, LiquidLevel, MapHgt, MapPlayerExtend, MapWdt, MapZoom, Material, MaterialZoom, mkArrayAdaptDM, mkNamingAdapt(), NoScan, Period, Phase, Random, RightOpen, Secret, SkyDef, SkyDefFade, SkyScrollMode, TopOpen, StdCompiler::Value(), Vegetation, and VegLevel.

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

Here is the call graph for this function:

void C4SLandscape::Default ( )

Definition at line 284 of file C4Scenario.cpp.

References Amplitude, AutoScanSideOpen, BottomOpen, C4NameList::Clear(), C4SVal::Default(), C4IDList::Default(), ExactLandscape, FlatChunkShapes, Gravity, InEarth, InEarthLevel, KeepMapCreator, Layers, LeftOpen, Liquid, LiquidLevel, MapHgt, MapPlayerExtend, MapWdt, MapZoom, Material, MaterialZoom, NoScan, Period, Phase, Random, RightOpen, Secret, C4SVal::Set(), SkyDef, SkyDefFade, SkyScrollMode, TopOpen, Vegetation, and VegLevel.

Referenced by c4_mapgen_handle_new(), c4_mapgen_handle_new_script(), and C4Scenario::Default().

285 {
286  BottomOpen=0; TopOpen=1;
287  LeftOpen=0; RightOpen=0;
289  SkyDef[0]=0;
290  for (int32_t cnt=0; cnt<6; cnt++) SkyDefFade[cnt]=0;
291  VegLevel.Set(50,30,0,100);
293  InEarthLevel.Set(50,0,0,100);
294  InEarth.Default();
295  MapWdt.Set(100,0,64,250);
296  MapHgt.Set(50,0,40,250);
297  MapZoom.Set(8,0,1,15);
298  Amplitude.Set(0,0);
299  Phase.Set(50);
300  Period.Set(15);
301  Random.Set(0);
303  MapPlayerExtend=0;
304  Layers.Clear();
305  Material = "Earth";
306  Liquid = "Water";
307  ExactLandscape=0;
308  Gravity.Set(100,0,10,200);
309  NoScan=0;
310  KeepMapCreator=0;
311  SkyScrollMode=0;
312  MaterialZoom=4;
313  FlatChunkShapes=false;
314  Secret=false;
315 }
std::string Liquid
Definition: C4Scenario.h:182
void Default()
Definition: C4Scenario.cpp:55
std::string Material
Definition: C4Scenario.h:181
int32_t MapPlayerExtend
Definition: C4Scenario.h:179
int32_t MaterialZoom
Definition: C4Scenario.h:185
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:174
C4IDList Vegetation
Definition: C4Scenario.h:165
C4SVal MapWdt
Definition: C4Scenario.h:176
int32_t TopOpen
Definition: C4Scenario.h:168
int32_t SkyScrollMode
Definition: C4Scenario.h:184
bool ExactLandscape
Definition: C4Scenario.h:163
C4SVal InEarthLevel
Definition: C4Scenario.h:166
void Default()
Definition: stub-handle.cpp:63
C4SVal MapZoom
Definition: C4Scenario.h:176
C4SVal Period
Definition: C4Scenario.h:177
int32_t BottomOpen
Definition: C4Scenario.h:168
int32_t LeftOpen
Definition: C4Scenario.h:169
int32_t SkyDefFade[6]
Definition: C4Scenario.h:172
C4SVal Phase
Definition: C4Scenario.h:177
bool FlatChunkShapes
Definition: C4Scenario.h:186
C4SVal Random
Definition: C4Scenario.h:177
C4IDList InEarth
Definition: C4Scenario.h:167
C4SVal MapHgt
Definition: C4Scenario.h:176
int32_t RightOpen
Definition: C4Scenario.h:169
C4SVal Amplitude
Definition: C4Scenario.h:177
C4SVal VegLevel
Definition: C4Scenario.h:164
C4NameList Layers
Definition: C4Scenario.h:180
bool KeepMapCreator
Definition: C4Scenario.h:183
std::string SkyDef
Definition: C4Scenario.h:171
C4SVal LiquidLevel
Definition: C4Scenario.h:178
bool AutoScanSideOpen
Definition: C4Scenario.h:170
void Clear()
Definition: C4NameList.cpp:23

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 317 of file C4Scenario.cpp.

References C4S_MaxMapPlayerExtend, C4SVal::Evaluate(), MapHgt, MapPlayerExtend, MapWdt, and C4SVal::Max.

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

318 {
319  rWdt = MapWdt.Evaluate();
320  rHgt = MapHgt.Evaluate();
321  iPlayerNum = std::max<int32_t>( iPlayerNum, 1 );
322  if (MapPlayerExtend)
323  rWdt = std::min(rWdt * std::min(iPlayerNum, C4S_MaxMapPlayerExtend), MapWdt.Max);
324 }
int32_t Max
Definition: C4Scenario.h:31
int32_t MapPlayerExtend
Definition: C4Scenario.h:179
C4SVal MapWdt
Definition: C4Scenario.h:176
C4SVal MapHgt
Definition: C4Scenario.h:176
int32_t Evaluate()
Definition: C4Scenario.cpp:50
const int32_t C4S_MaxMapPlayerExtend
Definition: C4Scenario.h:137

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

C4SVal C4SLandscape::Amplitude

Definition at line 177 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

bool C4SLandscape::AutoScanSideOpen

Definition at line 170 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Landscape::ScenarioInit().

int32_t C4SLandscape::BottomOpen
bool C4SLandscape::ExactLandscape
bool C4SLandscape::FlatChunkShapes
C4SVal C4SLandscape::Gravity

Definition at line 174 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Landscape::ScenarioInit().

C4IDList C4SLandscape::InEarth

Definition at line 167 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitInEarth().

C4SVal C4SLandscape::InEarthLevel

Definition at line 166 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitInEarth().

bool C4SLandscape::KeepMapCreator

Definition at line 183 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), C4Landscape::Init(), and C4Landscape::PostInitMap().

C4NameList C4SLandscape::Layers

Definition at line 180 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

int32_t C4SLandscape::LeftOpen

Definition at line 169 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Landscape::ScenarioInit().

std::string C4SLandscape::Liquid

Definition at line 182 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

C4SVal C4SLandscape::LiquidLevel

Definition at line 178 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

int32_t C4SLandscape::MapPlayerExtend
C4SVal C4SLandscape::MapZoom

Definition at line 176 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), C4Landscape::Init(), and C4Player::ScenarioInit().

std::string C4SLandscape::Material
int32_t C4SLandscape::MaterialZoom

Definition at line 185 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4LandscapeRenderGL::Draw().

bool C4SLandscape::NoScan

Definition at line 173 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Landscape::Init().

C4SVal C4SLandscape::Period

Definition at line 177 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

C4SVal C4SLandscape::Phase

Definition at line 177 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

C4SVal C4SLandscape::Random

Definition at line 177 of file C4Scenario.h.

Referenced by CompileFunc(), C4MapCreator::Create(), and Default().

int32_t C4SLandscape::RightOpen

Definition at line 169 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Landscape::ScenarioInit().

bool C4SLandscape::Secret

Definition at line 187 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Viewport::Execute().

std::string C4SLandscape::SkyDef

Definition at line 171 of file C4Scenario.h.

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

int32_t C4SLandscape::SkyDefFade[6]

Definition at line 172 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Sky::Init().

int32_t C4SLandscape::SkyScrollMode

Definition at line 184 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Sky::Init().

int32_t C4SLandscape::TopOpen
C4IDList C4SLandscape::Vegetation

Definition at line 165 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitVegetation().

C4SVal C4SLandscape::VegLevel

Definition at line 164 of file C4Scenario.h.

Referenced by CompileFunc(), Default(), and C4Game::InitVegetation().


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