Free Hero Mesh

Check-in [0f84344e70]
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:Start the implementation of animations.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0f84344e7064649c361c14d4f3f5fc2077daa6f9
User & Date: user on 2020-12-16 00:08:39
Other Links: manifest | tags
Context
2020-12-16
00:37
Correct a few problems in the animation handling check-in: 3608bd2d5d user: user tags: trunk
00:08
Start the implementation of animations. check-in: 0f84344e70 user: user tags: trunk
2020-12-15
05:21
Add some documentation files. check-in: b9ac4c0116 user: user tags: trunk
Changes

Modified class.c from [26222c9175] to [dde1df9612].

41
42
43
44
45
46
47

48
49
50
51
52
53
54
Class*classes[0x4000];
const char*messages[0x4000];
Uint16 functions[0x4000];
int max_animation=32;
Sint32 max_volume=10000;
Uint8 back_color=1;
char**stringpool;


#define HASH_SIZE 8888
#define LOCAL_HASH_SIZE 5555
typedef struct {
  Uint16 id;
  char*txt;
} Hash;







>







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Class*classes[0x4000];
const char*messages[0x4000];
Uint16 functions[0x4000];
int max_animation=32;
Sint32 max_volume=10000;
Uint8 back_color=1;
char**stringpool;
AnimationSlot anim_slot[8];

#define HASH_SIZE 8888
#define LOCAL_HASH_SIZE 5555
typedef struct {
  Uint16 id;
  char*txt;
} Hash;
1619
1620
1621
1622
1623
1624
1625
















1626
1627
1628
1629
1630
1631
1632
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;
        case OP_ANIMATE:
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          if(tokenv<1 || tokenv>256) ParseError("Number of max animation steps out of range\n");
          max_animation=tokenv;
















          nxttok();
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;
        case OP_VOLUME:
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          max_volume=tokenv;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;
        case OP_ANIMATE:
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          if(tokenv<1 || tokenv>256) ParseError("Number of max animation steps out of range\n");
          max_animation=tokenv;
          nxttok();
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;
        case OP_SYNCHRONIZE:
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          i=tokenv;
          if(i&~7) ParseError("Animation slot number out of range\n");
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          if(tokenv<1 || tokenv>255) ParseError("Length of synchronized animation too long\n");
          anim_slot[i].length=tokenv;
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          if(tokenv<1 || tokenv>255) ParseError("Synchronized animation speed out of range\n");
          anim_slot[i].speed=tokenv;
          nxttok();
          if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
          break;
        case OP_VOLUME:
          nxttok();
          if(tokent!=TF_INT) ParseError("Number expected\n");
          max_volume=tokenv;

Modified exec.c from [b6ec622234] to [150ed1a0ef].

169
170
171
172
173
174
175
176







































177

178














































179











180
181
182
183
184
185
186
  objects[n]=0;
  generation_number_inc=1;
}

static inline Uint8 resolve_dir(Uint32 n,Uint32 d) {
  return d<8?d:(objects[n]->dir+d)&7;
}








































static void animate(Uint32 n,Uint32 f,Uint32 a0,Uint32 a1,Uint32 t) {

  objects[n]->image=a0;














































  //TODO











}

static Uint32 obj_above(Uint32 i) {
  Object*o;
  if(i==VOIDLINK) return VOIDLINK;
  o=objects[i];
  i=o->up;








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
  objects[n]=0;
  generation_number_inc=1;
}

static inline Uint8 resolve_dir(Uint32 n,Uint32 d) {
  return d<8?d:(objects[n]->dir+d)&7;
}

/*
  Working of animation: There are two separate animations, being logical
  and visual animations. New animations replace the current logical
  animation; if there isn't one, but there is a visual animation, then a
  new logical animation is added at the end. The logical animation is
  always at the same step or ahead of the visual animation.

  - lstep - Step number of the logical animation; this cannot equal or
  exceed max_animation. Only a single logical step is present at once.

  - vstep - Step number of the visual animation; this cannot equal or
  exceed max_animation. The tail of the visual animation is the same as
  the head of the logical animation, and the buffer is circular.

  - status - Contains bit flags. If the ANISTAT_LOGICAL flag is set, then
  it means a logical animation is active. If the ANISTAT_VISUAL flag is
  set, then it means a visual animation is active. ANISTAT_SYNCHRONIZED
  is set only for synchronized animations, which are visual only.

  - ltime - Amount of logical time passed

  - vtime - Number of centiseconds elapsed.

  - vimage - If the status field has the ANISTAT_VISUAL bit set, then this
  will decide the picture to display rather than using the object's image.

  - count - Number of logical animation steps so far this turn. If it is
  equal to max_animation then no more animations can be added this turn.

  Synchronized animations only use vstep, status, and vimage.
*/

static Animation*animalloc(void) {
  Animation*a=malloc(sizeof(Animation)+max_animation*sizeof(AnimationStep));
  if(!a) fatal("Allocation failed\n");
  a->lstep=a->vstep=a->ltime=a->vtime=a->status=a->count=0;
  return a;
}

static void animate(Uint32 n,Uint32 f,Uint32 a0,Uint32 a1,Uint32 t) {
  Animation*an=objects[n]->anim;
  objects[n]->image=a0;
  f&=0x0A;
  if(!an) an=objects[n]->anim=animalloc();
  if(an->status&ANISTAT_SYNCHRONIZED) an->status=0;
  if(an->count==max_animation) f=ANI_STOP;
  if(f&(ANI_ONCE|ANI_LOOP)) {
    switch(an->status) {
      case 0:
        an->vtime=an->lstep=an->vstep=0;
        an->vimage=a0;
        break;
      case ANISTAT_LOGICAL:
        an->vstep=an->lstep;
        an->vtime=0;
        an->vimage=a0;
        break;
      case ANISTAT_VISUAL:
        an->lstep++;
        if(an->lstep>=max_animation) an->lstep=0;
        if(an->lstep==an->vstep && max_animation>1) {
          an->vstep++;
          if(an->vstep==max_animation) an->vstep=0;
          an->vimage=an->step[an->vstep].start;
          an->vtime=0;
        }
        break;
      case ANISTAT_VISUAL|ANISTAT_LOGICAL:
        if(an->lstep==an->vstep) {
          an->vimage=a0;
          an->vtime=0;
        }
        break;
    }
    an->step[an->lstep].flag=f;
    an->step[an->lstep].start=a0;
    an->step[an->lstep].end=a1;
    an->step[an->lstep].speed=t;
    an->ltime=0;
    an->status=ANISTAT_VISUAL|ANISTAT_LOGICAL;
    an->count++;
  } else if(an->lstep==an->vstep) {
    an->status=0;
  } else if(an->status&ANISTAT_LOGICAL) {
    an->lstep=(an->lstep?:max_animation)-1;
    an->status&=~ANISTAT_LOGICAL;
  }
}

static void animate_sync(Uint32 n,Uint32 sl,Uint32 a0) {
  Animation*an=objects[n]->anim;
  objects[n]->image=a0;
  sl&=7;
  if(!an) an=objects[n]->anim=animalloc();
  an->status=ANISTAT_VISUAL|ANISTAT_SYNCHRONIZED;
  an->vimage=a0+anim_slot[sl].frame;
  an->lstep=an->vstep=0;
  an->step->flag=ANI_LOOP|ANI_SYNC;
  an->step->start=a0;
  an->step->slot=sl;
}

static Uint32 obj_above(Uint32 i) {
  Object*o;
  if(i==VOIDLINK) return VOIDLINK;
  o=objects[i];
  i=o->up;
943
944
945
946
947
948
949

950
951
952
953
954
955
956
    case OP_STRENGTH_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u; break;
    case OP_STRENGTH_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u&0xFFFF; break;
    case OP_STRENGTH_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) o->strength=t1.u; break;
    case OP_STRENGTH_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) o->strength=t1.u; break;
    case OP_SOUND: StackReq(2,0); t2=Pop(); t1=Pop(); break; // Sound not implemented at this time
    case OP_SUB: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u-t2.u)); break;
    case OP_SWAP: StackReq(2,2); t1=Pop(); t2=Pop(); Push(t1); Push(t2); break;

    case OP_TRACE: StackReq(3,0); trace_stack(obj); break;
    case OP_TUCK: StackReq(2,3); t2=Pop(); t1=Pop(); Push(t2); Push(t1); Push(t2); break;
    case OP_USERSIGNAL: StackReq(0,1); if(o->oflags&OF_USERSIGNAL) Push(NVALUE(1)); else Push(NVALUE(0)); break;
    case OP_USERSIGNAL_C: StackReq(1,1); GetFlagOf(OF_USERSIGNAL); break;
    case OP_USERSIGNAL_E: NoIgnore(); StackReq(1,0); if(v_bool(Pop())) o->oflags|=OF_USERSIGNAL; else o->oflags&=~OF_USERSIGNAL; break;
    case OP_USERSIGNAL_EC: NoIgnore(); StackReq(2,0); SetFlagOf(OF_USERSIGNAL); break;
    case OP_USERSTATE: StackReq(0,1); if(o->oflags&OF_USERSTATE) Push(NVALUE(1)); else Push(NVALUE(0)); break;







>







1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
    case OP_STRENGTH_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u; break;
    case OP_STRENGTH_E16: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->strength=t1.u&0xFFFF; break;
    case OP_STRENGTH_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) o->strength=t1.u; break;
    case OP_STRENGTH_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) o->strength=t1.u; break;
    case OP_SOUND: StackReq(2,0); t2=Pop(); t1=Pop(); break; // Sound not implemented at this time
    case OP_SUB: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(t1.u-t2.u)); break;
    case OP_SWAP: StackReq(2,2); t1=Pop(); t2=Pop(); Push(t1); Push(t2); break;
    case OP_SYNCHRONIZE: StackReq(2,0); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); animate_sync(obj,t1.u,t2.u); break;
    case OP_TRACE: StackReq(3,0); trace_stack(obj); break;
    case OP_TUCK: StackReq(2,3); t2=Pop(); t1=Pop(); Push(t2); Push(t1); Push(t2); break;
    case OP_USERSIGNAL: StackReq(0,1); if(o->oflags&OF_USERSIGNAL) Push(NVALUE(1)); else Push(NVALUE(0)); break;
    case OP_USERSIGNAL_C: StackReq(1,1); GetFlagOf(OF_USERSIGNAL); break;
    case OP_USERSIGNAL_E: NoIgnore(); StackReq(1,0); if(v_bool(Pop())) o->oflags|=OF_USERSIGNAL; else o->oflags&=~OF_USERSIGNAL; break;
    case OP_USERSIGNAL_EC: NoIgnore(); StackReq(2,0); SetFlagOf(OF_USERSIGNAL); break;
    case OP_USERSTATE: StackReq(0,1); if(o->oflags&OF_USERSTATE) Push(NVALUE(1)); else Push(NVALUE(0)); break;
1097
1098
1099
1100
1101
1102
1103

1104
1105
1106
1107
1108
1109
1110
  all_flushed=0;
  lastimage_processing=0;
  vstackptr=0;
  current_key=key;
  for(n=0;n<nobjects;n++) if(objects[n]) {
    objects[n]->distance=0;
    objects[n]->oflags&=~(OF_KEYCLEARED|OF_DONE);

  }
  
  current_key=0;
  if(key_ignored) return changed?"Invalid use of IgnoreKey":0;
  move_number++;
  
  if(generation_number<=TY_MAXTYPE) return "Too many generations of objects";







>







1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
  all_flushed=0;
  lastimage_processing=0;
  vstackptr=0;
  current_key=key;
  for(n=0;n<nobjects;n++) if(objects[n]) {
    objects[n]->distance=0;
    objects[n]->oflags&=~(OF_KEYCLEARED|OF_DONE);
    if(objects[n]->anim) objects[n]->anim->count=0;
  }
  
  current_key=0;
  if(key_ignored) return changed?"Invalid use of IgnoreKey":0;
  move_number++;
  
  if(generation_number<=TY_MAXTYPE) return "Too many generations of objects";

Modified game.c from [39fcdeb76e] to [fc378111c4].

72
73
74
75
76
77
78













































79
80
81
82
83
84
85
  if(x>0 && y>0 && x<=pfwidth && y<=pfheight) snprintf(buf,8,"(%2d,%2d)",x,y);
  else strcpy(buf,"       ");
  draw_text(0,40,buf,0xF0,0xF1);
  SDL_UnlockSurface(screen);
  SDL_Flip(screen);
  set_cursor(XC_arrow);
}














































static void show_mouse_xy(SDL_Event*ev) {
  char buf[32];
  int x,y;
  x=(ev->motion.x-left_margin)/picture_size+1;
  y=ev->motion.y/picture_size+1;
  if(ev->motion.x<left_margin) x=0;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
  if(x>0 && y>0 && x<=pfwidth && y<=pfheight) snprintf(buf,8,"(%2d,%2d)",x,y);
  else strcpy(buf,"       ");
  draw_text(0,40,buf,0xF0,0xF1);
  SDL_UnlockSurface(screen);
  SDL_Flip(screen);
  set_cursor(XC_arrow);
}

static void continue_animation(void) {
  Uint32 n=firstobj;
  Object*o;
  Animation*a;
  int i;
  for(i=0;i<8;i++) if(anim_slot[i].length && ++anim_slot[i].vtime==anim_slot[i].speed && ++anim_slot[i].frame==anim_slot[i].length) anim_slot[i].frame=0;
  while(n!=VOIDLINK) {
    o=objects[n];
    if((a=o->anim) && (a->status&ANISTAT_VISUAL)) {
      i=a->vstep;
      if(a->step[i].flag&ANI_SYNC) {
        i=anim_slot[a->step[i].slot].frame+a->step[i].start;
        if(i!=a->vimage) {
          a->vimage=i;
          draw_cell(o->x,o->y);
        }
      } else if(++a->vtime>=a->step[i].speed) {
        a->vtime=0;
        if(a->vimage==a->step[i].end) {
          if(a->step[i].flag&ANI_ONCE) {
            if(a->vstep==a->lstep) {
              a->status&=~ANISTAT_VISUAL;
            } else {
              if(++a->vstep==max_animation) a->vstep=0;
              a->vimage=a->step[a->vstep].start;
            }
          } else if(a->step[i].flag&ANI_OSC) {
            a->step[i].end=a->step[i].start;
            a->step[i].start=a->vimage;
            goto advance;
          } else {
            a->vimage=a->step[i].start;
          }
        } else {
          advance:
          if(a->step[i].end>=a->step[i].start) ++a->vimage; else --a->vimage;
        }
        draw_cell(o->x,o->y);
      }
    }
    n=o->next;
  }
  SDL_Flip(screen);
}

static void show_mouse_xy(SDL_Event*ev) {
  char buf[32];
  int x,y;
  x=(ev->motion.x-left_margin)/picture_size+1;
  y=ev->motion.y/picture_size+1;
  if(ev->motion.x<left_margin) x=0;
96
97
98
99
100
101
102

103
104
105
106
107
108
109
  t=load_level(id)?:init_level();
  if(t) {
    gameover=-1;
    screen_message(t);
  } else {
    gameover=0;
  }

}

static inline void exam_value(const char*t,int y,Value v) {
  char buf[256];
  int i;
  y=(y-exam_scroll)*8;
  if(y<0 || y>screen->h-8) return;







>







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  t=load_level(id)?:init_level();
  if(t) {
    gameover=-1;
    screen_message(t);
  } else {
    gameover=0;
  }
  timerflag=0;
}

static inline void exam_value(const char*t,int y,Value v) {
  char buf[256];
  int i;
  y=(y-exam_scroll)*8;
  if(y<0 || y>screen->h-8) return;
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
      case SDL_QUIT:
        exit(0);
        break;
      case SDL_MOUSEMOTION:
        show_mouse_xy(&ev);
        break;
      case SDL_USEREVENT:
        //TODO: animation
        timerflag=0;
        break;
      case SDL_MOUSEBUTTONDOWN:
        if(ev.button.x<left_margin) {
          
          break;
        } else {







|







444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
      case SDL_QUIT:
        exit(0);
        break;
      case SDL_MOUSEMOTION:
        show_mouse_xy(&ev);
        break;
      case SDL_USEREVENT:
        if(!gameover) continue_animation();
        timerflag=0;
        break;
      case SDL_MOUSEBUTTONDOWN:
        if(ev.button.x<left_margin) {
          
          break;
        } else {

Modified heromesh.h from [63c8f5b734] to [6f44ec7cde].

129
130
131
132
133
134
135




136
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
  Sint32 height,weight,climb,density,volume,strength,arrivals,departures;
  Sint32 temperature,misc4,misc5,misc6,misc7;
  Uint16 uservars,oflags,nmsg;
  Uint16 sharp[4];
  Uint16 hard[4];
  Uint8 cflags,shape,shovable,collisionLayers,nimages;
} Class;





extern Value initglobals[0x800];
extern Class*classes[0x4000]; // 0 isn't a real class
extern const char*messages[0x4000]; // index is 256 less than message number
extern Uint16 functions[0x4000];
extern int max_animation; // max steps in animation queue (default 32)
extern Sint32 max_volume; // max total volume to allow moving diagonally (default 10000)
extern Uint8 back_color;
extern char**stringpool;


Uint16 get_message_ptr(int c,int m);
void load_classes(void);

// == bindings ==

typedef struct {







>
>
>
>









>







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
  Sint32 height,weight,climb,density,volume,strength,arrivals,departures;
  Sint32 temperature,misc4,misc5,misc6,misc7;
  Uint16 uservars,oflags,nmsg;
  Uint16 sharp[4];
  Uint16 hard[4];
  Uint8 cflags,shape,shovable,collisionLayers,nimages;
} Class;

typedef struct {
  Uint8 length,speed,vtime,frame;
} AnimationSlot;

extern Value initglobals[0x800];
extern Class*classes[0x4000]; // 0 isn't a real class
extern const char*messages[0x4000]; // index is 256 less than message number
extern Uint16 functions[0x4000];
extern int max_animation; // max steps in animation queue (default 32)
extern Sint32 max_volume; // max total volume to allow moving diagonally (default 10000)
extern Uint8 back_color;
extern char**stringpool;
extern AnimationSlot anim_slot[8];

Uint16 get_message_ptr(int c,int m);
void load_classes(void);

// == bindings ==

typedef struct {
169
170
171
172
173
174
175

176
177






178







179
180
181
182
183
184
185

#define VOIDLINK ((Uint32)(-1))

#define ANI_STOP 0x00
#define ANI_ONCE 0x01
#define ANI_LOOP 0x02
#define ANI_OSC 0x08


typedef struct {






  //TODO







} Animation;

typedef struct {
  Sint32 height,weight,climb,density,volume,strength,arrivals,departures,temperature,inertia;
  Uint32 arrived,departed,arrived2,departed2,generation;
  Uint32 up,down,prev,next; // links to other objects
  Uint16 class,oflags,distance;







>


>
>
>
>
>
>
|
>
>
>
>
>
>
>







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204

#define VOIDLINK ((Uint32)(-1))

#define ANI_STOP 0x00
#define ANI_ONCE 0x01
#define ANI_LOOP 0x02
#define ANI_OSC 0x08
#define ANI_SYNC 0x80

typedef struct {
  Uint8 flag,start,end;
  union {
    Uint8 speed; // unsynchronized
    Uint8 slot; // synchronized
  };
} AnimationStep;

#define ANISTAT_LOGICAL 0x01
#define ANISTAT_VISUAL 0x02
#define ANISTAT_SYNCHRONIZED 0x80

typedef struct {
  Uint8 lstep,vstep,status,ltime,vtime,vimage,count;
  AnimationStep step[0];
} Animation;

typedef struct {
  Sint32 height,weight,climb,density,volume,strength,arrivals,departures,temperature,inertia;
  Uint32 arrived,departed,arrived2,departed2,generation;
  Uint32 up,down,prev,next; // links to other objects
  Uint16 class,oflags,distance;

Modified instruc from [9a4e81af56] to [ad08ada1fc].

225
226
227
228
229
230
231

232
233
234
235
236
237
238
PopUp
*PopUpArgs ; for (PopUp [number])
QueueTurn ; queue another turn that automatically occurs after this one
.,Send
.,SendEx ; send with three arguments
SetInventory
Sound

Trace
VolumeAt
WinLevel
,XDir
,YDir

; Specials







>







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
PopUp
*PopUpArgs ; for (PopUp [number])
QueueTurn ; queue another turn that automatically occurs after this one
.,Send
.,SendEx ; send with three arguments
SetInventory
Sound
Synchronize
Trace
VolumeAt
WinLevel
,XDir
,YDir

; Specials

Modified instruc.h from [033737e886] to [5b4b106152].

339
340
341
342
343
344
345

346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
#define OP_SEND_CD 43166
#define OP_SENDEX 32927
#define OP_SENDEX_C 34975
#define OP_SENDEX_D 41119
#define OP_SENDEX_CD 43167
#define OP_SETINVENTORY 32928
#define OP_SOUND 32929

#define OP_TRACE 32930
#define OP_VOLUMEAT 32931
#define OP_WINLEVEL 32932
#define OP_XDIR 32933
#define OP_XDIR_C 34981
#define OP_YDIR 32934
#define OP_YDIR_C 34982
#define OP_FUNCTION 32935
#define OP_LOCAL 32936
#define OP_LABEL 32937
#define OP_STRING 32938
#define OP_INT16 32939
#define OP_INT32 32940
#ifdef HEROMESH_CLASS
static const Op_Names op_names[]={
{"*",8486935},
{"+",8421397},
{"-",8421398},
{"-rot",8421382},
{".",10518528},







>
|
|
|
|
|
|
|
|
|
|
|
|
|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
#define OP_SEND_CD 43166
#define OP_SENDEX 32927
#define OP_SENDEX_C 34975
#define OP_SENDEX_D 41119
#define OP_SENDEX_CD 43167
#define OP_SETINVENTORY 32928
#define OP_SOUND 32929
#define OP_SYNCHRONIZE 32930
#define OP_TRACE 32931
#define OP_VOLUMEAT 32932
#define OP_WINLEVEL 32933
#define OP_XDIR 32934
#define OP_XDIR_C 34982
#define OP_YDIR 32935
#define OP_YDIR_C 34983
#define OP_FUNCTION 32936
#define OP_LOCAL 32937
#define OP_LABEL 32938
#define OP_STRING 32939
#define OP_INT16 32940
#define OP_INT32 32941
#ifdef HEROMESH_CLASS
static const Op_Names op_names[]={
{"*",8486935},
{"+",8421397},
{"-",8421398},
{"-rot",8421382},
{".",10518528},
534
535
536
537
538
539
540

541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
{"Shape",8618032},
{"ShapeDir",8618055},
{"Sharp",8618054},
{"Shovable",8618056},
{"Sound",8421537},
{"Stealthy",8618081},
{"Strength",9142339},

{"TAHTASHH",8389409},
{"THMP_thmp",8389405},
{"THWIT",8389384},
{"TICK",8389391},
{"Temperature",9142318},
{"Trace",8421538},
{"UH_OH",8389382},
{"UNCORK",8389414},
{"UNHH",8389381},
{"UserSignal",8618078},
{"UserState",8618079},
{"VACUUM",8389411},
{"VisualOnly",8618080},
{"Volume",9142331},
{"VolumeAt",8421539},
{"W",9437188},
{"WAHOO",8389400},
{"WHACK",8389423},
{"Weight",9142333},
{"WinLevel",8421540},
{"XDir",8487077},
{"Xloc",8486961},
{"YDir",8487078},
{"YEEHAW",8389401},
{"Yloc",8486962},
{"again",8683532},
{"band",8421405},
{"begin",8683531},
{"bit",8683553},
{"bit0",8388609},







>





|








|




|
|

|







535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
{"Shape",8618032},
{"ShapeDir",8618055},
{"Sharp",8618054},
{"Shovable",8618056},
{"Sound",8421537},
{"Stealthy",8618081},
{"Strength",9142339},
{"Synchronize",8421538},
{"TAHTASHH",8389409},
{"THMP_thmp",8389405},
{"THWIT",8389384},
{"TICK",8389391},
{"Temperature",9142318},
{"Trace",8421539},
{"UH_OH",8389382},
{"UNCORK",8389414},
{"UNHH",8389381},
{"UserSignal",8618078},
{"UserState",8618079},
{"VACUUM",8389411},
{"VisualOnly",8618080},
{"Volume",9142331},
{"VolumeAt",8421540},
{"W",9437188},
{"WAHOO",8389400},
{"WHACK",8389423},
{"Weight",9142333},
{"WinLevel",8421541},
{"XDir",8487078},
{"Xloc",8486961},
{"YDir",8487079},
{"YEEHAW",8389401},
{"Yloc",8486962},
{"again",8683532},
{"band",8421405},
{"begin",8683531},
{"bit",8683553},
{"bit0",8388609},
629
630
631
632
633
634
635
636
637
{"rsh",8486940},
{"swap",8421378},
{"then",8683529},
{"tuck",8421380},
{"until",8683533},
{"while",8683534},
};
#define N_OP_NAMES 274
#endif







|

631
632
633
634
635
636
637
638
639
{"rsh",8486940},
{"swap",8421378},
{"then",8683529},
{"tuck",8421380},
{"until",8683533},
{"while",8683534},
};
#define N_OP_NAMES 275
#endif

Modified picture.c from [4a851ea778] to [27a9f01e5e].

91
92
93
94
95
96
97

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  SDL_BlitSurface(picts,&src,screen,&dst);
}

void draw_cell(int x,int y) {
  // To be called only when screen is unlocked!
  Uint32 o;
  Class*c;

  SDL_Rect dst={x,y,picture_size,picture_size};
  if(x<1 || x>64 || y<1 || y>64) return;
  SDL_FillRect(screen,&dst,back_color);
  o=playfield[y*64+x-65];
  while(o!=VOIDLINK) {
    if(main_options['e'] || !(objects[o]->oflags&OF_INVISIBLE)) {
      c=classes[objects[o]->class];
      if(objects[o]->image<c->nimages)
       draw_picture((x-1)*picture_size+left_margin,(y-1)*picture_size,c->images[objects[o]->image]&0x7FFF);
    }
    o=objects[o]->up;
  }
}

void draw_text(int x,int y,const unsigned char*t,int bg,int fg) {
  // To be called only when screen is locked!







>
|






|
|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  SDL_BlitSurface(picts,&src,screen,&dst);
}

void draw_cell(int x,int y) {
  // To be called only when screen is unlocked!
  Uint32 o;
  Class*c;
  int i;
  SDL_Rect dst={(x-1)*picture_size+left_margin,(y-1)*picture_size,picture_size,picture_size};
  if(x<1 || x>64 || y<1 || y>64) return;
  SDL_FillRect(screen,&dst,back_color);
  o=playfield[y*64+x-65];
  while(o!=VOIDLINK) {
    if(main_options['e'] || !(objects[o]->oflags&OF_INVISIBLE)) {
      c=classes[objects[o]->class];
      if(objects[o]->anim && (objects[o]->anim->status&ANISTAT_VISUAL)) i=objects[o]->anim->vimage; else i=objects[o]->image;
      if(i<c->nimages) draw_picture((x-1)*picture_size+left_margin,(y-1)*picture_size,c->images[i]&0x7FFF);
    }
    o=objects[o]->up;
  }
}

void draw_text(int x,int y,const unsigned char*t,int bg,int fg) {
  // To be called only when screen is locked!