static C4ValueArray *FnLayerCreateMatTexMask(C4PropList * _this, const C4Value &mask_spec) { // layer script function: Generate an array 256 bools representing the given mask_spec C4MapScriptMatTexMask mat_mask(mask_spec); C4ValueArray *result = new C4ValueArray(C4M_MaxTexIndex + 1); for (int32_t i=0; i < C4M_MaxTexIndex + 1; ++i) { result->SetItem(i, C4VBool(mat_mask(uint8_t(i), C4M_MaxTexIndex))); } return result; }