Free Hero Mesh

Check-in [7b28d8159e]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Implement "(DefaultImage <number> mod <number>)".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7b28d8159e86a01c36ef26fe4b307e7fe895c393
User & Date: user on 2022-04-06 18:46:21
Other Links: manifest | tags
Context
2022-04-07
06:44
Some additions to FAQ check-in: 9b1262140c user: user tags: trunk
2022-04-06
18:46
Implement "(DefaultImage <number> mod <number>)". check-in: 7b28d8159e user: user tags: trunk
2022-04-03
17:21
Improve file format documentation check-in: 8179bf273f user: user tags: trunk
Changes

Modified class.c from [9d875090a8] to [f3ec4cf1a4].

1888
1889
1890
1891
1892
1893
1894





1895
1896
1897
1898
1899
1900
1901
        ParseError("Number expected\n");
      }
    } else if(tokent==TF_CLOSE) {
      break;
    } else if(tokent==TF_INT) {
      if(tokenv<0 || tokenv>=cl->nimages) ParseError("Image number out of range\n");
      cl->images[tokenv]|=0x8000;





    } else {
      ParseError("Expected ( or ) or number\n");
    }
  }
}

static void class_user_flag(Class*cl) {







>
>
>
>
>







1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
        ParseError("Number expected\n");
      }
    } else if(tokent==TF_CLOSE) {
      break;
    } else if(tokent==TF_INT) {
      if(tokenv<0 || tokenv>=cl->nimages) ParseError("Image number out of range\n");
      cl->images[tokenv]|=0x8000;
    } else if(Tokenf(TF_NAME) && !Tokenf(TF_MACRO) && tokenv==OP_MOD) {
      nxttok();
      if(tokent!=TF_INT) ParseError("Expected ( or ) or number\n");
      if(tokenv<=0) ParseError("Zero or negative modulus is not allowed\n");
      for(i=0;i<cl->nimages-tokenv;i++) if(cl->images[i]&0x8000) cl->images[i+tokenv]|=0x8000;
    } else {
      ParseError("Expected ( or ) or number\n");
    }
  }
}

static void class_user_flag(Class*cl) {

Modified class.doc from [a0b21321f2] to [817305dd66].

414
415
416
417
418
419
420





421
422
423
424
425
426
427
  Each entry is either a number of an image in this class, or two
  numbers in parentheses giving a range of images, or () to indicate
  that there are no default images. This specifies which images can
  be used in objects of this class which are initially present on
  the level (placed in the editor). If () is used, then this class
  is not available in the editor. If there is no (DefaultImage) block,
  all images are available. The (Image) block must come before this one.






(Density <number>)
  Define the Density variable for this class. If you want the Density to
  be different in the editor, specify the value to use in the editor here,
  and then change the Density value in the INIT block.

(Departures InPlace)







>
>
>
>
>







414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
  Each entry is either a number of an image in this class, or two
  numbers in parentheses giving a range of images, or () to indicate
  that there are no default images. This specifies which images can
  be used in objects of this class which are initially present on
  the level (placed in the editor). If () is used, then this class
  is not available in the editor. If there is no (DefaultImage) block,
  all images are available. The (Image) block must come before this one.
  The list can also contain the token "mod" followed by a positive number;
  in this case, it will also add any images whose numbers are that many
  more than the ones already specified and will repeat; for example, if
  you write "(DefaultImage 1 mod 5)" then images 1, 6, 11, 16, 21, etc
  are added to the list of default images.

(Density <number>)
  Define the Density variable for this class. If you want the Density to
  be different in the editor, specify the value to use in the editor here,
  and then change the Density value in the INIT block.

(Departures InPlace)