Skip to content
Permalink
Browse files

Fix Sky definition not working (#1910)

  • Loading branch information
lluchs committed Jan 11, 2018
1 parent 0945890 commit 54e5c6de3811f2ac9d89b67f3302cf808c3a76eb
Showing with 17 additions and 1 deletion.
  1. +1 −1 src/landscape/C4Scenario.cpp
  2. +16 −0 src/lib/StdAdaptors.h
@@ -330,7 +330,7 @@ void C4SLandscape::CompileFunc(StdCompiler *pComp)
pComp->Value(mkNamingAdapt(VegLevel, "VegetationLevel", C4SVal(50,30,0,100), true));
pComp->Value(mkNamingAdapt(InEarth, "InEarth", C4IDList()));
pComp->Value(mkNamingAdapt(InEarthLevel, "InEarthLevel", C4SVal(50,0,0,100), true));
pComp->Value(mkNamingAdapt(SkyDef, "Sky", ""));
pComp->Value(mkNamingAdapt(mkStringAdapt(SkyDef, StdCompiler::RCT_All),"Sky",""));
pComp->Value(mkNamingAdapt(mkArrayAdaptDM(SkyDefFade,0),"SkyFade" ));
pComp->Value(mkNamingAdapt(BottomOpen, "BottomOpen", 0));
pComp->Value(mkNamingAdapt(TopOpen, "TopOpen", 1));
@@ -191,6 +191,22 @@ inline StdStringAdapt mkStringAdapt(char *szString, int iMaxLength, StdCompiler:
#define mkStringAdaptMI(szString) mkStringAdapt(szString, (sizeof(szString) / sizeof(*szString)) - 1, StdCompiler::RCT_Idtf)
#define mkStringAdaptMIE(szString) mkStringAdapt(szString, (sizeof(szString) / sizeof(*szString)) - 1, StdCompiler::RCT_IdtfAllowEmpty)

// * std::string adaptor
struct StdStdStringAdapt
{
std::string& string; StdCompiler::RawCompileType eRawType;
StdStdStringAdapt(std::string& string, StdCompiler::RawCompileType eRawType = StdCompiler::RCT_Escaped)
: string(string), eRawType(eRawType) { }
inline void CompileFunc(StdCompiler *pComp) const
{
pComp->String(string, eRawType);
}
inline bool operator == (const char *szDefault) const { return string == szDefault; }
inline StdStdStringAdapt &operator = (const char *szDefault) { string = szDefault; return *this; }
};
inline StdStdStringAdapt mkStringAdapt(std::string& string, StdCompiler::RawCompileType eRawType = StdCompiler::RCT_Escaped)
{ return StdStdStringAdapt(string, eRawType); }

// * Raw adaptor
struct StdRawAdapt
{

0 comments on commit 54e5c6d

Please sign in to comment.
You can’t perform that action at this time.