Free Hero Mesh

Check-in [33f8d50d24]
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 -+ switch to load level by ID number instead of by order number.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 33f8d50d24dc14a9a62cd31fe2e972565615a2ae
User & Date: user on 2022-04-20 04:36:47
Other Links: manifest | tags
Context
2022-04-21
22:53
A change in the implementation of ordered objects (currently not in use nor tested) check-in: 52e9907daf user: user tags: trunk
2022-04-20
04:36
Implement -+ switch to load level by ID number instead of by order number. check-in: 33f8d50d24 user: user tags: trunk
2022-04-07
06:44
Some additions to FAQ check-in: 9b1262140c user: user tags: trunk
Changes

Modified commandline.doc from [53fc4d0825] to [cba290834a].

71
72
73
74
75
76
77



78
79
80
81
82
83
84
  the results to stdout. See sql.doc for the fuunctions and tables that
  may be used. Dot commands are also possible; see the below section.

-z
  Load a composite puzzle set. In this case, the <basename> should be the
  full file name of the puzzle, including the suffix.





=== Dot commands ===

.b0
  Disable terminate on errors.

.b1







>
>
>







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  the results to stdout. See sql.doc for the fuunctions and tables that
  may be used. Dot commands are also possible; see the below section.

-z
  Load a composite puzzle set. In this case, the <basename> should be the
  full file name of the puzzle, including the suffix.

-+
  Load the level whose ID number is specified by the "level" resource.


=== Dot commands ===

.b0
  Disable terminate on errors.

.b1

Modified config.doc from [dfb6c74832] to [67613eb1cc].

85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
  not work, then it is an error.

.keyRepeat
  The keyboard repeat rate, which are two numbers, first the key repeating
  delay and then the key repeating interval.

.level
  Specifies the 1-based order number of the level to start at.


.listColumns
  Number of columns in the wide mode of the list of levels. If zero or not
  specified, determines automatically by the screen width.

.listMode
  Mode for list of levels, in hexadecimal, where bit0 is set for tall mode







|
>







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  not work, then it is an error.

.keyRepeat
  The keyboard repeat rate, which are two numbers, first the key repeating
  delay and then the key repeating interval.

.level
  Specifies the 1-based order number of the level to start at. If the -+
  switch is specified, then it is a 0-based ID number instead.

.listColumns
  Number of columns in the wide mode of the list of levels. If zero or not
  specified, determines automatically by the screen width.

.listMode
  Mode for list of levels, in hexadecimal, where bit0 is set for tall mode

Modified game.c from [6c6e1550de] to [3e921952d6].

1460
1461
1462
1463
1464
1465
1466




1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478

1479
1480
1481
1482
1483
1484
1485
  no_dead_anim=1;
  setbuf(stdout,0);
  solution_replay=1;
  optionquery[1]=Q_progress;
  t=xrm_get_resource(resourcedb,optionquery,optionquery,2);
  pro=t?strtol(t,0,10):0;
  if(main_options['t']) pro=0;




  optionquery[1]=Q_level;
  t=xrm_get_resource(resourcedb,optionquery,optionquery,2);
  if(n=lvl=t?strtol(t,0,10):0) goto start;
  for(n=1;n<=level_nindex;n++) {
    if(lvl) break;
    start:
    if(pro<0) sqlite3_sleep(-pro);
    if(main_options['t']) printf("*** Level %d\n",n); else printf("Level %d",n);
    if(t=load_level(-n)) {
      printf(": Error during loading: %s\n",t);
      rc=1; continue;
    }

    load_replay();
    if(!replay_count) {
      printf(": Solution is absent, invalid, or for wrong version of this level\n");
      rc=1; continue;
    }
    if(t=init_level()) {
      printf(": Error during initialization: %s\n",t);







>
>
>
>












>







1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
  no_dead_anim=1;
  setbuf(stdout,0);
  solution_replay=1;
  optionquery[1]=Q_progress;
  t=xrm_get_resource(resourcedb,optionquery,optionquery,2);
  pro=t?strtol(t,0,10):0;
  if(main_options['t']) pro=0;
  if(main_options['+']) {
    lvl=1;
    goto start2;
  }
  optionquery[1]=Q_level;
  t=xrm_get_resource(resourcedb,optionquery,optionquery,2);
  if(n=lvl=t?strtol(t,0,10):0) goto start;
  for(n=1;n<=level_nindex;n++) {
    if(lvl) break;
    start:
    if(pro<0) sqlite3_sleep(-pro);
    if(main_options['t']) printf("*** Level %d\n",n); else printf("Level %d",n);
    if(t=load_level(-n)) {
      printf(": Error during loading: %s\n",t);
      rc=1; continue;
    }
    start2:
    load_replay();
    if(!replay_count) {
      printf(": Solution is absent, invalid, or for wrong version of this level\n");
      rc=1; continue;
    }
    if(t=init_level()) {
      printf(": Error during initialization: %s\n",t);

Modified main.c from [c4bffb80c2] to [97954d3e50].

1129
1130
1131
1132
1133
1134
1135



1136
1137
1138
1139
1140
1141
1142
1143
  load_key_bindings();
  load_level_index();
  optionquery[1]=Q_maxObjects;
  max_objects=strtoll(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,0)?:0xFFFF0000L;
  set_tracing();
  annihilate();
  optionquery[1]=Q_level;



  if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) {
    if(level_ord>level_nindex) level_ord=level_nindex;
    log_if_error(load_level(-level_ord));
  }
  optionquery[1]=Q_maxTrigger;
  max_trigger=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10);
  if(main_options['a']) run_auto_test();
  if(main_options['x']) {







>
>
>
|







1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
  load_key_bindings();
  load_level_index();
  optionquery[1]=Q_maxObjects;
  max_objects=strtoll(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,0)?:0xFFFF0000L;
  set_tracing();
  annihilate();
  optionquery[1]=Q_level;
  if(main_options['+']) {
    level_id=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10);
    if(log_if_error(load_level(level_id))) fatal("Cannot load level with specified ID\n");
  } else if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) {
    if(level_ord>level_nindex) level_ord=level_nindex;
    log_if_error(load_level(-level_ord));
  }
  optionquery[1]=Q_maxTrigger;
  max_trigger=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10);
  if(main_options['a']) run_auto_test();
  if(main_options['x']) {

Modified man6/heromesh.6 from [be6820057b] to [165725924f].

49
50
51
52
53
54
55


56
57
58
59
60
61
62
.IP -v
More verbose error logging.
.IP -x
Does not start the GUI; instead, accepts SQL statements from stdin.
.IP -z
Load a composite puzzle set.
In this case, pass the full file name instead only the base name.


.SH FILES
A puzzle set consists of four files, with filename suffixes
.BR ".class" ", " ".xclass" ", " ".level" ", and " ".solution" "."
A composite puzzle set consists of a single file.
.TP
.I ~/.heromeshrc
The configuration file, in X resource manager format.







>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.IP -v
More verbose error logging.
.IP -x
Does not start the GUI; instead, accepts SQL statements from stdin.
.IP -z
Load a composite puzzle set.
In this case, pass the full file name instead only the base name.
.IP -+
Load the level whose ID number is specified by the "level" resource.
.SH FILES
A puzzle set consists of four files, with filename suffixes
.BR ".class" ", " ".xclass" ", " ".level" ", and " ".solution" "."
A composite puzzle set consists of a single file.
.TP
.I ~/.heromeshrc
The configuration file, in X resource manager format.