Skip to content

Commit 26a0139

Browse files
committed
Start of implementation of the (Trigger) block (currently only syntax is implemented) to control timing/ordering of some events.
1 parent baf0e20 commit 26a0139

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

class.c

+7
Original file line numberDiff line numberDiff line change
@@ -2931,6 +2931,13 @@ void load_classes(void) {
29312931
case OP_DENSITY:
29322932
parse_density_block();
29332933
break;
2934+
case OP_TRIGGER:
2935+
nxttok();
2936+
if(tokent!=TF_INT) ParseError("Number expected\n");
2937+
trigmode=tokenv;
2938+
nxttok();
2939+
if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n");
2940+
break;
29342941
default:
29352942
ParseError("Invalid top level definition: %s\n",tokenstr);
29362943
}

class.doc

+3
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ these definitions are optional.)
343343
be 0 to 7, the length is the number of images in the sequence, and the
344344
speed is the number of centiseconds between frames.
345345

346+
(Trigger <number>)
347+
Not defined yet. (TODO)
348+
346349
(Volume <number>)
347350
Define the maximum allowed volume for an object to move diagonally
348351
between two other objects. The default value is 10000.

exec.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Uint8 no_dead_anim;
4444
Uint32 max_trigger;
4545
Uint8 conn_option;
4646
Sint32 gameover_score;
47+
Uint32 trigmode;
4748

4849
typedef struct {
4950
Uint16 msg;

heromesh.h

+1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ extern Uint8 no_dead_anim;
328328
extern Uint32 max_trigger;
329329
extern Uint8 conn_option;
330330
extern Sint32 gameover_score;
331+
extern Uint32 trigmode;
331332

332333
const unsigned char*value_string_ptr(Value v);
333334
void pfunlink(Uint32 n);

0 commit comments

Comments
 (0)