Free Hero Mesh

Check-in [0d3d6e6a53]
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:Some corrections dealing with (Order) block; still does not quite work properly, yet.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0d3d6e6a535200c394502647212ffed1c1187eea
User & Date: user on 2022-03-03 21:40:59
Other Links: manifest | tags
Context
2022-03-04
01:56
If new messages are added, then instruc.h must be rewritten, too. check-in: b08bf22096 user: user tags: trunk
2022-03-03
21:40
Some corrections dealing with (Order) block; still does not quite work properly, yet. check-in: 0d3d6e6a53 user: user tags: trunk
02:33
If Node.js is not installed, do not attempt to overwrite instruc.h, names.h, and quarks.h. check-in: 9a7b2de351 user: user tags: trunk
Changes

Modified class.c from [e38cb33701] to [a2182d0a94].

2167
2168
2169
2170
2171
2172
2173
2174

2175
2176
2177
2178
2179
2180
2181
2167
2168
2169
2170
2171
2172
2173

2174
2175
2176
2177
2178
2179
2180
2181







-
+







}

static void parse_order_block(void) {
  // OP_MISC1, OP_MISC1_C, etc = properties (_C=reverse)
  // 0x1000...0x10FF = Have flag
  // OP_RET = end of block
  Uint16 beg,ptr;
  ParseError("(Not implemented yet)\n"); //TODO: remove this when it is implemented in exec.c too
  ParseError("(Not implemented yet)\n"); //TODO: remove this when it is implemented properly in exec.c too
  orders=malloc(0x4000*sizeof(Uint16));
  if(!orders) fatal("Allocation failed\n");
  nxttok();
  if(tokent==TF_INT) {
    if(tokenv<1 || tokenv>254) ParseError("Order number out of range\n");
    beg=ptr=tokenv;
    nxttok();
2215
2216
2217
2218
2219
2220
2221

2222
2223
2224
2225
2226
2227
2228

2229
2230
2231
2232








2233
2234


2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246

2247



2248
2249
2250
2251
2252
2253
2254
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242


2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257

2258
2259
2260
2261
2262
2263
2264
2265
2266
2267







+







+




+
+
+
+
+
+
+
+
-
-
+
+












+
-
+
+
+







        case OP_TEMPERATURE: case OP_TEMPERATURE_C:
        case OP_DENSITY: case OP_DENSITY_C:
        case OP_XLOC: case OP_XLOC_C:
        case OP_YLOC: case OP_YLOC_C:
        case OP_IMAGE: case OP_IMAGE_C:
          orders[ptr++]=tokenv;
          break;
        default: ParseError("Unexpected token in (Order) block\n");
      }
      nxttok();
    }
    orders[ptr++]=OP_RET;
  }
  if(!norders) ParseError("Empty (Order) block\n");
  orders=realloc(orders,ptr*sizeof(Uint16))?:orders;
  nxttok();
}

static void set_class_orders(void) {
  int i,j,k;
  if(main_options['C']) {
    for(j=1;j<=norders;j++) {
      printf("Order %d =",j);
      k=orders[j];
      while(orders[k]!=OP_RET) printf(" %04X",orders[k++]);
      putchar('\n');
    }
  }
  for(i=1;i<undef_class;i++) if(classes[i] && (classes[i]->nmsg || classes[0]->nmsg) || !(classes[i]->cflags&(CF_GROUP|CF_NOCLASS2))) {
    for(j=1;j<norders;j++) {
  for(i=1;i<undef_class;i++) if(classes[i] && (classes[i]->nmsg || classes[0]->nmsg) && !(classes[i]->cflags&(CF_GROUP|CF_NOCLASS2))) {
    for(j=1;j<=norders;j++) {
      k=orders[orders[j]];
      switch(k) {
        case 0x1000 ... 0x101F: if(classes[i]->misc4&(1UL<<(k&0x1F))) goto found; break;
        case 0x1020 ... 0x103F: if(classes[i]->misc5&(1UL<<(k&0x1F))) goto found; break;
        case 0x1040 ... 0x105F: if(classes[i]->misc6&(1UL<<(k&0x1F))) goto found; break;
        case 0x1060 ... 0x107F: if(classes[i]->misc7&(1UL<<(k&0x1F))) goto found; break;
        case 0x1080 ... 0x1087: if(classes[i]->collisionLayers&(1L<<(k&0x07))) goto found; break;
        case OP_PLAYER: if(classes[i]->cflags&CF_PLAYER) goto found; break;
        case OP_INPUT: if(classes[i]->cflags&CF_INPUT) goto found; break;
        case OP_CONTROL: if(i==control_class) goto found; break;
      }
      continue;
      found:
      found: classes[i]->order=j; break;
      classes[i]->order=j;
      if(main_options['C']) printf("Order %d : Class %d\n",j,i);
      break;
    }
  }
}

static int level_table_code(int ptr,Hash*hash) {
  int flowdepth=0;
  Uint16 flowptr[64];