Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [f32dcb1f64]:

To Artifact [1653acd7e0]:


121
122
123
124
125
126
127

128
129
130
131
132
133
134
static char pushback=0;
static Hash*glohash;
static InputStack*inpstack;
static MacroStack*macstack;
static TokenList**macros;
static LabelStack*labelstack;
static Uint16*labelptr;


#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,
  ['0'...'9']=2, ['-']=2, ['+']=2,
  ['A'...'Z']=3, ['a'...'z']=3, ['_']=3, ['?']=3, ['.']=3, ['*']=3, ['/']=3,







>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
static char pushback=0;
static Hash*glohash;
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,
  ['0'...'9']=2, ['-']=2, ['+']=2,
  ['A'...'Z']=3, ['a'...'z']=3, ['_']=3, ['?']=3, ['.']=3, ['*']=3, ['/']=3,
2150
2151
2152
2153
2154
2155
2156






2157
2158
2159
2160
2161
2162
2163
      break;
    } else {
      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(main_options['C']) dump_class(cla,ptr,hash);
  if(main_options['H']) {
    for(i=0;i<LOCAL_HASH_SIZE;i++) if(hash[i].id) printf(" \"%s\": %04X\n",hash[i].txt,hash[i].id);
  }
  for(i=0;i<LOCAL_HASH_SIZE;i++) {
    if(vst && hash[i].id>=0x2000 && hash[i].id<0x2800) {
      sqlite3_reset(vst);







>
>
>
>
>
>







2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
      break;
    } else {
      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<<i)&cl->collisionLayers)) {
      cl->density=dense[i];
      break;
    }
  }
  if(main_options['C']) dump_class(cla,ptr,hash);
  if(main_options['H']) {
    for(i=0;i<LOCAL_HASH_SIZE;i++) if(hash[i].id) printf(" \"%s\": %04X\n",hash[i].txt,hash[i].id);
  }
  for(i=0;i<LOCAL_HASH_SIZE;i++) {
    if(vst && hash[i].id>=0x2000 && hash[i].id<0x2800) {
      sqlite3_reset(vst);
2516
2517
2518
2519
2520
2521
2522











2523
2524
2525
2526
2527
2528
2529
      if(!(i&15)) printf("\n    [%04X]",i);
      printf(" %04X",ll_code[i]);
    }
    putchar('\n');
    printf("---\n\n");
  }
}












void load_classes(void) {
  int i;
  int gloptr=0;
  Hash*glolocalhash;
  char*nam=sqlite3_mprintf("%s.class",basefilename);
  sqlite3_stmt*vst=0;







>
>
>
>
>
>
>
>
>
>
>







2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
      if(!(i&15)) printf("\n    [%04X]",i);
      printf(" %04X",ll_code[i]);
    }
    putchar('\n');
    printf("---\n\n");
  }
}

static void parse_density_block(void) {
  int i;
  for(i=0;i<8;i++) {
    nxttok();
    if(tokent==TF_CLOSE) return;
    if(tokent!=TF_INT || tokenv<1 || tokenv>255) 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;
  char*nam=sqlite3_mprintf("%s.class",basefilename);
  sqlite3_stmt*vst=0;
2690
2691
2692
2693
2694
2695
2696



2697
2698
2699
2700
2701
2702
2703
          level_table_definition();
          break;
        case OP_INPUTXY:
          has_xy_input=1;
          nxttok();
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;



        default:
          ParseError("Invalid top level definition: %s\n",tokenstr);
      }
    } else {
      ParseError("Invalid top level definition\n");
    }
  }







>
>
>







2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
          level_table_definition();
          break;
        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");
    }
  }