Index: PORTING ================================================================== --- PORTING +++ PORTING @@ -249,5 +249,23 @@ === Mac OS X === (TODO) + +=== Sandboxing === + +Many sandbox systems have problems, such as: + +* Assumes all text is Unicode. + +* Cannot request a command to use with popen (or from configuration files). + +* When asking for a file, cannot also include certain other files whose +names are done by adding additional text onto the end of the name (this is +needed for SQLite to work, and also for non-composite puzzle sets in Free +Hero Mesh). + +* Assumes a desktop environment. + +Therefore, if it is to be used, a better one should be made up. + Index: class.c ================================================================== --- class.c +++ class.c @@ -123,10 +123,11 @@ static InputStack*inpstack; static MacroStack*macstack; static TokenList**macros; static LabelStack*labelstack; static Uint16*labelptr; +static Uint8 dense[8]; #define ParseError(a,...) fatal("On line %d: " a,linenum,##__VA_ARGS__) static const unsigned char chkind[256]={ ['$']=1, ['!']=1, ['\'']=1, ['#']=1, ['@']=1, ['%']=1, ['&']=1, [':']=1, ['^']=1, @@ -2152,10 +2153,16 @@ ParseError("Invalid directly inside of a class definition\n"); } } end_label_stack(cl->codes,hash); if(!cl->nimages && !(cl->cflags&CF_GROUP)) cl->oflags|=OF_INVISIBLE; + if(cl->collisionLayers && *dense && !cl->density) { + for(i=0;i<8;i++) if(dense[i] && ((1<collisionLayers)) { + cl->density=dense[i]; + break; + } + } if(main_options['C']) dump_class(cla,ptr,hash); if(main_options['H']) { for(i=0;i255) ParseError("Number 1-255 or close parenthesis expected\n"); + dense[i]=tokenv; + } + ParseError("Too many global density numbers are specified\n"); +} void load_classes(void) { int i; int gloptr=0; Hash*glolocalhash; @@ -2692,10 +2710,13 @@ case OP_INPUTXY: has_xy_input=1; nxttok(); if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n"); break; + case OP_DENSITY: + parse_density_block(); + break; default: ParseError("Invalid top level definition: %s\n",tokenstr); } } else { ParseError("Invalid top level definition\n"); Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -287,10 +287,16 @@ (CollisionLayers ) Define user flags as CollisionLayers bits; the first defined flag is bit0. Up to 8 flags can be defined in this way. +(Density ) + Define the default Density settings for classes that use the collision + layers. Each number must be in range 1 to 255, and there cannot be more + than eight density numbers defined. Their order is the same as the order + of the user flags in the (CollisionLayers) block. + (InputXY ) Enables coordinate input. Currently there are no options, so the options must be left blank. See the documentation about the CLICK message for more details about coordinate input.